Remove the Makefile command to touch perlmain.c after running makedepend.
authorNicholas Clark <nick@ccl4.org>
Fri, 3 Dec 2010 21:07:17 +0000 (21:07 +0000)
committerNicholas Clark <nick@ccl4.org>
Fri, 3 Dec 2010 21:07:17 +0000 (21:07 +0000)
Jerry D. Hedden was right to question whether this was now superfluous, because
as best I can tell it was *always* superfluous. Perl 5.000 shipped with a
Makefile rule to build perlmain.c using a shell script, with a dependency for
perlmain.c on makefile. [Lowercase makefile, now abstracted as $(FIRSTMAKEFILE).
This is generated by makedepend from Makefile, by calculating the dependency
rules to append to it.] The rule to generate perlmain.c had a prerequisite on
$(FIRSTMAKEFILE), and in turn $(FIRSTMAKEFILE) has a dependency on $(c), which
included perlmain.c. Hence there was a circular dependency, and the "solution"
to avoiding repeated rebuilds was to touch perlmain.c (if it exists), after
running makedepend.

As best I can tell there is no *actual* dependency for the correct generation
of perlmain.c on the contents of $(FIRSTMAKEFILE), as the relevant variables
are the same in both Makefile and $(FIRSTMAKEFILE). Hence this command should
have been removed, along with the dependency, years ago. However, no-one
spotted this until Jerry observed that fbcaf61123069fe4 changed the build
rules, and removed the dependency, but not the touch command.

Makefile.SH

index 3cf2939..027b2b2 100755 (executable)
@@ -1352,11 +1352,9 @@ $(FIRSTMAKEFILE):        README $(MAKEDEPEND)
 config.h: config_h.SH config.sh
        $(SHELL) config_h.SH
 
-# When done, touch perlmain.c so that it doesn't get remade each time.
 .PHONY: depend
 depend: makedepend
        sh ./makedepend MAKE=$(MAKE)
-       - test -s perlmain.c && touch perlmain.c
        cd x2p; $(MAKE) depend
 
 # Cannot postpone this until $firstmakefile is ready ;-)