Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!blake!ogccse!littlei!omepd!merlyn From: merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge) Newsgroups: comp.unix.questions Subject: uhhh, use Make as The Creator intended (was Re: help with make needed) Message-ID: <4351@omepd.UUCP> Date: 28 Apr 89 18:40:39 GMT References: <459@front.se> <477@front.se> Sender: news@omepd.UUCP Reply-To: merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge) Organization: Stonehenge; netaccess via BiiN, Hillsboro, Oregon, USA Lines: 36 In-reply-to: zap@front.se (Svante Lindahl) In article <477@front.se>, zap@front (Svante Lindahl) writes: | In article <459@front.se>,I wrote: | [ The target, a library, should be removed and rebuilt if the makefile | has been updated. ] | | > Makefile: FRC | > -@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 | -@if echo "Makefile: $(TARGET) ; @/bin/false" | make -qf - ; \ | then rm -f $(TARGET) ; fi | | Svante.Lindahl@front.se (!-net: ...!uunet!front.se!svante) | (non-mx: Svante.Lindahl%front.se@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 } { ...!uunet!tektronix!biin!merlyn } { or try after 30 May 1989 } \=Cute quote: "Welcome to Oregon... home of the California Raisins!"=/