Path: utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!csd4.csd.uwm.edu!mailrus!ames!fxgrp!news From: grady@fxgrp.fx.com (Steven Grady) Newsgroups: gnu.utils.bug Subject: Re: make 3.55 infinite loop Message-ID: <1989Aug31.080610.20127@fxgrp.fx.com> Date: 31 Aug 89 08:06:10 GMT References: <1989Aug31.014333.18904@fxgrp.fx.com> Reply-To: grady@fxgrp.UUCP (Steven Grady) Organization: FX Development Group, Inc., Mountain View, CA Lines: 44 [Sorry these are so long.] Hmm. On looking at this further, I see a more insidious problem. Consider the siuation where you want to include one makefile in another, but you want to provide the opportunity for overriding productions (which is what I want to do). This requires using a ".DEFAULT" rule (as recommended in the "Overriding Makefiles" section of the texinfo document). But consider the following makefile: a: b @echo making a .DEFAULT: $(MAKE) -f OtherMakefile $@ The default production, a, depends on b. Assume b exists. Well, since there is a default production, b has commands associated with it (namely, the commands in the default production which are used whenever no other productions can be found). Since b has commands but no dependencies, the default rule will be executed. So it's going to invoke another make just because it can't find any production on what to do for a file that already exists. If there were an additional line up there: "include a", then even if some other production were invoked, it would still check if "a" was up-to-date (since all include files are checked), and therefore the default rule would fire to try to update "b". It also seems to be the case that gnumake always checks to see if the makefile being used is up-to-date. Again, if there's a default production, gnumake will try to use it to update the makefile itself, meaning that gnumake will _always_ be invoked at least twice if there's a DEFAULT production. I think I've made my point that firing off commands if there are no dependencies, combined with DEFAULT productions, is a bad thing. I'm not sure what the right fix would be, but it seems that if there are no dependencies, commands should only be executed if the target is PHONY. Steven ...!ucbvax!grady grady@postgres.berkeley.edu "But Calvin is no kind and loving god! He's one of the _old_ gods! He demands sacrifice!"