🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2323

Makefile mystery

#2323
From: Gary S. Trujillo
Date: Wed, 15 Feb 1989 20:45
49 lines
2392 bytes
I must be missing something here, but I can't help feeling that the gcc
Makefile is designed to recompile very nearly the entire universe whether
or not very much has been touched.  It has been my recent experience that
if I do a "make -n" following a successful make, I get something like:

	gcc -g -c expr.c
	gcc -g -c stmt.c
	gcc -g -c expmed.c
	gcc -g -c explow.c
	.
	.
	.

In looking at the Makefile, and having performed a few experiments, I have
been able to determine that the sequences that go as follows are what's
causing this behavior:

	insn-config.h: stamp-config.h ;
	stamp-config.h : md genconfig
		./genconfig md > tmp-insn-config.h
		./move-if-change tmp-insn-config.h insn-config.h
		touch stamp-config.h

Now, to me, it looks as if this construction *guarantees* that the *.c
files will get compiled whether or not their corresponding *.o files
are out of date with respect to them.  For example, for expr.c, we have:

	expr.o : expr.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h  \
	   insn-flags.h insn-codes.h expr.h insn-config.h recog.h

Since expr.o depends upon, among other things, insn-config.h, which, in
turn, depends on stamp-config.h, the re-creation of expr.o is triggered
if insn-config.h is older than stamp-config.h.  However, it will *always*
be older, given that it is created by genconfig before the creation of
stamp-config.h.  To prove this assertion, one has merely to re-run the
make after having deleted the rule-set in question (insn-config.h: ...).

I have found a quick work-around, though.  If one does a "rm -f stamp-*.h"
followed by a manual linking of insn-*.h files with their corresponding
stamp-*.h files, it will fool make into accepting the insn-*.h files as
being up to date.

BTW, I'm using the standard System-V make on the AT&T 3B1 (UNIXpc).

Any ideas?

--
Gary S. Trujillo			      {linus,bbn,m2c}!spdcc!gnosys!gst
Somerville, Massachusetts		     {icus,ima,stech,wjh12}!gnosys!gst
Technical Details
Message-ID: <8902152054.AA06228@prep.ai.mit.edu>
Path: arc1-ca.pugleaf.net!utzoo!telly!lethe!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!WJH12.HARVARD.EDU!gnosys!gst

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!lethe!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!WJH12.HARVARD.EDU!gnosys!gst
From: gnosys!gst@WJH12.HARVARD.EDU (Gary S. Trujillo)
Newsgroups: gnu.gcc.bug
Subject: Makefile mystery
Message-ID: <8902152054.AA06228@prep.ai.mit.edu>
Date: 15 Feb 89 20:45:12 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 49