help-make
[Top][All Lists]
Advanced

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

Re: Use result of sub-make as a prerequisite?


From: Noel Yap
Subject: Re: Use result of sub-make as a prerequisite?
Date: Wed, 11 Feb 2004 07:47:50 -0500

Read http://aegis.sourceforge.net/auug97.pdf.

HTH,
Noel

Nestor Amaya wrote:
> 
> 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
> address@hidden
> http://mail.gnu.org/mailman/listinfo/help-make

-- 
NOTICE: If received in error, please destroy and notify sender.  Sender does 
not waive confidentiality or privilege, and use is prohibited.




reply via email to

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