LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-18-2006, 01:23 AM   #1
Inbal
LQ Newbie
 
Registered: Jun 2006
Posts: 7

Rep: Reputation: 0
To exists or not to exists, this is the Q.


Hi,

I got a makefile and trying to figure it out, What does these lines mean?

%/.exists:
mkdir -p $(@D) (****)
touch $@

(****) I think it means to make a new directory while preserving attributes to the target directory .
if the directory doesn't exists.

Thanks for the help,

Inbal
 
Old 07-18-2006, 05:06 AM   #2
penguintutor
Member
 
Registered: Jun 2006
Location: UK
Distribution: Ubuntu, Mandriva, Redhat and Fedora
Posts: 118

Rep: Reputation: 15
mkdir -p
creates a directory, even if the parent directory is missing.

For example if you have a system, you are in your home directory and you wanted to create a directory ~/thisapp/config
(the ~/ bit means your home directory)

If the thisapp directory didn't exist then using mkdir thisapp/config will give the error:
Quote:
mkdir: cannot create directory `thisapp/config': No such file or directory
so you either need to create the thisapp directory first or use:
Code:
mkdir -p thisapp/config
which will create both the thisapp and the thisapp/config directory in a single command.


touch will create an empty file.
 
Old 07-18-2006, 05:39 AM   #3
Inbal
LQ Newbie
 
Registered: Jun 2006
Posts: 7

Original Poster
Rep: Reputation: 0
What does the exists mean? is it a kind of macro ? or a rule?
 
Old 07-18-2006, 06:04 AM   #4
penguintutor
Member
 
Registered: Jun 2006
Location: UK
Distribution: Ubuntu, Mandriva, Redhat and Fedora
Posts: 118

Rep: Reputation: 15
I'm not sure, but believe this is a rule.

A target rule normally consists of a string followed by a colon. The can be prefixed with an @ (to turn off echo), and/or a hyphen (so it continues even if that section fails), but I don't know what the percent means.

You would probably need to provide more info from the makefile to make more sense of it. (e.g. is this an internal target referenced from elsewhere in the file?)

There is more info on the autconf tools at: http://sourceware.org/autobook/autob...obook_toc.html.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
why this mesasge exists? alaios Programming 10 07-16-2005 04:39 PM
Why do dentist exists? irfanhab General 24 07-13-2005 06:39 PM
SIOCADDRT: File exists SIOCCADDRT: File Exists Failed to bring up eth0. opsraja Linux - Networking 0 01-10-2005 08:29 AM
File already exists mickstaff Programming 3 05-13-2004 03:34 AM
file exists? raven Programming 7 10-26-2003 07:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration