Hello,

My question: Is there a way for the top-level make to use a sub-make to
check for whether test.db is up-to-date or not? 

Take this simple makefile:
#START Makefile
%.db :
        $(MAKE) -C db $@

all.log : test.db
        @echo remaking all | tee all.log
#END Makefile

Now assume that the sub-make within "db" dir is a complicated one, with many
checks, etc...

In my tests, "all.log" will be remade even if "test.db" is up to date,
because the top-level make doesn't know what the prereqs for "test.db" are,
and thus assumes that it must be remade.

I have tried using VPATH so that the top-level make "sees" db/test.db, but
then it never makes all.log even if test.db is out-of-date (since there are
no pre-reqs)...

I guess I could try to auto-generate the pre-reqs for test.db using the
sub-make, and then include them into the top-level make. But then I am
testing "test.db" twice to see if it is up-to-date... This seems clumsy and
inefficent.

Is there any other way? Your help is much appreciated.

Cheers,
Nestor


_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to