[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Make dependency on a directory without regards to timestamp
From: |
Doug |
Subject: |
Make dependency on a directory without regards to timestamp |
Date: |
Tue, 28 Aug 2007 22:17:01 -0000 |
User-agent: |
G2/1.0 |
Hi,
Is there a way with GNU make to specify a dependency on the existence
of a directory while ignoring the timestamp of the directory?
Specifically, say I have the following makefile:
default: myfile
myfile: mydir
touch mydir/myfile
mydir:
mkdir -p mydir
If I make using this makefile it is never up to date. :(
I need the dependency on the directory so that it exists when the
touch is executed. But the touch updates the timestamp of the
directory so if I call make again it executes the touch again. I
simply want myfile to depend on the existence of mydir.
I know I could just put the mkdir under the myfile rule, but my actual
scenario isn't this straightforward. I am calling another program to
create the directory and don't want to call it every time.
Thanks,
-Doug
- Make dependency on a directory without regards to timestamp,
Doug <=