uhhh, use Make as The Creator intended (was Re: help with make needed)

Randal L. Schwartz @ Stonehenge merlyn at intelob.intel.com
Sat Apr 29 04:40:39 AEST 1989


In article <477 at front.se>, zap at front (Svante Lindahl) writes:
| In article <459 at front.se>,I wrote:
| [ The target, a library, should be removed and rebuilt if the makefile
|   has been updated. ]
| 
| > Makefile:	FRC
| > 		- at if newer Makefile $(TARGET) ; then rm -f $(TARGET); fi
| ...
| 
| I got some good suggestions from Rich $alz on how to avoid the need
| for the newer(1L) program. This is what it looks like:
| 
| Makefile:	FRC
| 	- at if echo "Makefile: $(TARGET) ; @/bin/false" | make -qf - ; \
| 	then rm -f $(TARGET) ; fi
| 
| Svante.Lindahl at front.se	    (!-net: ...!uunet!front.se!svante)
| 			    (non-mx: Svante.Lindahl%front.se at uunet.uu.net)

Whoa, whoa, whoa.  Why not just:

$(TARGET):: Makefile
	-rm -f $@

$(TARGET):: fred.o barney.o wilma.o betty.o
	ar r $@ $?

(Better have them in that order, though.)  This is more along the
spirit of Make.  You are saying that TARGET depends on Makefile, so
*say* it.
-- 
/=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095===\
{ on contract to BiiN, Hillsboro, Oregon, USA, until 30 May 1989     }
{ <merlyn at intelob.intel.com> ...!uunet!tektronix!biin!merlyn         }
{ or try <merlyn at agora.hf.intel.com> after 30 May 1989               }
\=Cute quote: "Welcome to Oregon... home of the California Raisins!"=/



More information about the Comp.unix.questions mailing list