[4917] in Athena Bugs

home help back first fref pref prev next nref lref last post

"make -n" with no commands to run (all versions)

daemon@ATHENA.MIT.EDU (Ken Raeburn)
Sat May 12 15:34:07 1990

Date: Sat, 12 May 90 15:33:56 -0400
From: Ken Raeburn <Raeburn@MIT.Edu>
To: bugs@ATHENA.MIT.EDU
When the rules for rebuilding a file do not contain any commands, make
does not realize that the target will not be modified, and therefore
things depending on it need not be rebuilt.  For example:

foo.h : timestamp-foo.h
timestamp-foo.h : config-file
	process config-file > tmp-foo.h
	move-if-changed tmp-foo.h foo.h
	touch timestamp-foo.h
blah.o : foo.h

If config-file is newer than foo.h but older than timestamp-foo.h
(because the last generated tmp-foo.h was identical to the existing
foo.h), "make -n" and "make" give different sets of commands.  The
former figures that foo.h will be modified, even though no commands
are to be run; the latter checks the timestamp and finds that the file
hasn't changed, and therefor blah.o needn't be regenerated.

There are a number of instances of this in the gcc build procedure.

home help back first fref pref prev next nref lref last post