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? :confused: %/.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 |
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:
Code:
mkdir -p thisapp/config touch will create an empty file. |
What does the exists mean? is it a kind of macro ? or a rule?
|
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. |
All times are GMT -5. The time now is 08:34 PM. |