[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: depend on directory existance, not timestamp
From: |
Paul D. Smith |
Subject: |
Re: depend on directory existance, not timestamp |
Date: |
Thu, 14 Dec 2000 14:43:07 -0500 |
%% "Henry Gessau" <address@hidden> writes:
hg> I want to create a rule that creates a directory if the directory
hg> does not exist, and another rule where a file depends on the
hg> existence of this directory, but not how old the directory is.
You can't.
I always recommend against this approach (directories as prerequisites).
It can never work well with make.
If you're using GNU make, just do something like this:
__dummy := $(shell [ -d $(DIR) ] || $(MKDIR) $(DIR))
(where I typically set MKDIR to "mkdir -p" on systems that support it).
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist