help-make
[Top][All Lists]
Advanced

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

Re: Multidirectory libraries make


From: Paul Smith
Subject: Re: Multidirectory libraries make
Date: Thu, 21 Jun 2012 08:37:15 -0400

On Thu, 2012-06-21 at 02:55 -0700, icegood wrote:
> Paul Smith-20 wrote:
> > 
> > then it
> > should depend on THAT (that is, the "obj" variable should contain the
> > path to that object file) and not depend on the library in bar.
> > 
> > Then make the directories order-only prerequisites:
> > 
> >         .PHONY: $(sublibraries)
> >         $(sublibraries) : 
> >                $(MAKE) "--directory=$@" -f makefile.mak
> >         
> >         $(currlib) : $(obj) | $(sublibraries)
> >                 ar -cqs $@ $(obj) 2>/dev/null
> > 
> > Now all the sublibraries rules will be done before $(currlib) is built,
> > but it won't cause $(currlib) to be rebuilt.
> > 
> No, this is defenetly what i don't want too. sublibraries have own makefiles
> with own logic inside it (let's say 3rd party ones) and i want regulate all
> dependencies inside them by calling submake and nothing more. $(currlib) 
> shouldn't depend on ANY object inside $(sublibraries). 

Well, as written here you're not including any objects in currlib that
aren't provided in the obj variable, and hence in the prerequisite list,
anyway.  If you don't provide make with full and complete information on
your dependency graph, there's always a chance make won't build things
in the correct order.

However, you can keep the dependency on the real libraries if you
prefer; order-only prerequisites will still help solve your problem.




reply via email to

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