I always use order-only prerequisites for directories. For example,
bar/foo.o: foo.c | bar
cc -o $@ -c $<
bar:
mkdir -p $@
Works for me.
Derek
On Sep 22, 2009, at 11:17 AM, Kristof Provost wrote:
On 2009-09-22 11:44:21 (-0400), Sam Steingold <[email protected]> wrote:
Kristof Provost wrote:
[Dead links]
Hmm, it looks like CM crossroads reworked their website.
You can now find the 'Ask Mr. Make' column here:
http://www.cmcrossroads.com/cm-articles/columns/ask-mr-make
I, too, am struggling with rebuilding a directory.
it appears that the rule:
gllib: config.status
mkdir -p gllib; cd gllib; make
is wrong because the script "mkdir ..." is always executed,
regardless of
whether config.status has changed or not.
So, what is the right way to handle this?
I can't really tell why the gllib rule is always executed. If the
config.status file is older than the gllib directory it shouldn't be.
The '$?' variable might help you debug this problem. It contains the
names of all
the prerequisites that are newer than the target.
Regards.
Kristof
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make