help-gnu-utils
[Top][All Lists]
Advanced

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

Re: GNUMAKE: rebuild target when any of the dependencies are done


From: Brenda J. Butler
Subject: Re: GNUMAKE: rebuild target when any of the dependencies are done
Date: Tue, 25 Jan 2005 09:42:53 -0500
User-agent: Mutt/1.5.6+20040907i

With this makefile, ALLSCRIPT will also be run if One and Two
already exist but all has to be made.

Move $(ALLSCRIPT) into the rules for One and Two to have
the effect you want (which I think is:  only run ALLSCRIPT
if either ONESCRIPT or TWOSCRIPT (or both) run).


all:  One Two

One:  $(ONEDEPS)
        $(ONESCRIPT)
        $(ALLSCRIPT)

Two:  $(TWODEPS)
        $(TWOSCRIPT)
        $(ALLSCRIPT)



On Tue, Jan 25, 2005 at 09:28:59AM -0500, John Graham-Cumming wrote:
> Yuri Shtil wrote:
> >Given an example below, I want to start start $(ALLSCRIPT) when ANY of the
> >prerequisites One or Two have been updated.
> >Any idea?
> >
> >all: One Two
> >    $(ALLSCRIPT)
> >
> >One: $(ONEDEPS)
> >    $(ONESCRIPT)
> >
> >Two: $(TWODEPS)
> >    $(TWOSCRIPT)
> 
> It's not clear from your question exactly what you are expecting to 
> happen, but from the looks of your Makefile if either One or Two are 
> updated the then all rule will run, i.e. $(ALLSCRIPT) will be run.
> 
> I suspect there's something more because of the way in which you 
> highlighted the word ANY.  Could you give a concrete example of the 
> output you are expecting; perhaps use this example Makefile
> 
>     all: One Two ; @echo Building all
>     One: ; @echo Building One
>     Two: ; @echo Building Two
> 
> John.
> -- 
> John Graham-Cumming
> jgc@jgc.org
> 
> Home: http://www.jgc.org/
> Work: http://www.electric-cloud.com/
> POPFile: http://getpopfile.org/
> _______________________________________________
> help-gnu-utils mailing list
> help-gnu-utils@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-utils
---end quoted text---



reply via email to

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