help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to create a single rule to build a directory as necessary


From: Mark Marshall
Subject: Re: how to create a single rule to build a directory as necessary
Date: Wed, 23 Sep 2009 13:02:59 +0100
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

Sam Steingold wrote:
so,
I have this:
---------------------------------------------------
.PHONY : gllib

gllib:
        mkdir -p $@
if test ! -f $@/Makefile; then sh config.status $@/Makefile depfiles; fi
        cd $@ && $(MAKE) CFLAGS="$(SUBDIR_CFLAGS)"
---------------------------------------------------

I think this does what you want - things should depend on "gllib/stamp-make" to make sure that it gets rebuilt.

---------------------------------------------------

gllib/Makefile: config.status
        mkdir -p $(dir $@)
        sh config.status $@ depfiles

gllib/stamp-make: gllib/Makefile
        cd $(dir $@) && $(MAKE) CFLAGS="$(SUBDIR_CFLAGS)"
        touch $@

---------------------------------------------------

Should gllib/Makefile also depends on depfiles?

MM





reply via email to

[Prev in Thread] Current Thread [Next in Thread]