[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Making needed Directory
From: |
Paul D. Smith |
Subject: |
Re: Making needed Directory |
Date: |
Tue, 11 Apr 2006 13:37:10 -0400 |
%% Jason Lunz <address@hidden> writes:
jl> address@hidden said:
>> I prefer to do something like this:
>>
>> MKDIRS += foo
>> MKDIRS += bar
>> ...
>>
>> __dummy := $(shell foreach d in $(MKDIRS); do [ -d $$d ] || mkdir -p $$d;
done)
>>
>> That is loop is invoked once per invocation of make.
jl> Is there any reason for the __dummy? I have a Makefile that does:
jl> $(shell mkdir -p $(OUTDIR))
jl> and that seems to work fine.
It's a safety feature. If for some reason the shell script prints
something to stdout then the __dummy will capture it.
Otherwise it'll be interpreted as part of your makefile and most likely
generate a syntax error.
Just a habit, basically.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist