help-make
[Top][All Lists]
Advanced

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

Re: OR rules


From: Daniel Mahler
Subject: Re: OR rules
Date: Wed, 5 Nov 2003 17:23:17 -0600

if I ahave the makefile

+++++++++++++++++++++++++
a : b
        echo a : b

a : c
        echo a : c

a : d
        echo a : d


c :
        echo c
++++++++++++++++++++++++++

then I get the following:


bash-2.04$ make a
Makefile:7: warning: overriding commands for target `a'
Makefile:4: warning: ignoring old commands for target `a'
Makefile:10: warning: overriding commands for target `a'
Makefile:7: warning: ignoring old commands for target `a'
make: *** No rule to make target `d', needed by `a'.  Stop.
bash-2.04$ 

I would like to get

c
a : c

since a : c is that only rule that can succeed.


Paul D. Smith writes:
 > %% Daniel Mahler <address@hidden> writes:
 > 
 >   dm> I would like to be able to write parallel rules with disjunctive
 >   dm> semantics eg
 > 
 >   dm> %.tar : %.tar.Z
 >   dm>       unzip $<
 > 
 >   dm> %.tar : %.tar.gz
 >   dm>       gunzip $<
 > 
 >   dm> Which would only run gunzip if there was a .gz file 
 >   dm> and only unzip if there was a .Z file and either one
 >   dm> if both were present.
 > 
 > What you wrote here will do what you want.  Is there a reason you think
 > this doesn't work?
 > 
 > -- 
 > -------------------------------------------------------------------------------
 >  Paul D. Smith <address@hidden>          Find some GNU make tips at:
 >  http://www.gnu.org                      http://make.paulandlesley.org
 >  "Please remain calm...I may be mad, but I am a professional." --Mad 
 > Scientist





reply via email to

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