Subject: make(1) correctness
To: None <tech-userlevel@netbsd.org>
From: VaX#n8 <vax@linkdead.paranoia.com>
List: tech-userlevel
Date: 11/19/1998 09:05:26
$ ls
Makefile
$ cat Makefile
foo: FORCE
        test -e foo || touch foo

FORCE:

bar: foo
        touch bar
$ make bar
test -e foo || touch foo
touch bar
$ make bar
test -e foo || touch foo
touch bar					# foo wasn't touched

The command marked "foo wasn't touched" was the subject of some gnashing
of teeth and me irritating the author of ispell.  He has a rule in the
Makefile which doesn't do anything in most cases.  Everything depends on
its target, and so our make (what make are we using?) appears to say,
"I ran the rule, so I will treat the target as modified".

Apparently if the file is timestamped with the current second it
will be treated as up-to-date, even if this (bogus?) dependency
indicates it should be re-made.  This can be confusing:

$ make bar;make bar;make bar; make bar
test -e foo || touch foo
touch bar
test -e foo || touch foo
`bar' is up to date.
test -e foo || touch foo
touch bar
test -e foo || touch foo
`bar' is up to date.

Incidentally, what's with BSD and Pmake?
I noticed the 4.4BSD manuals have a paper on Pmake,
but the manpages seem to be describing something else.

I'm not on the list so keep me CC'd.  Thanks.
--
``If you trust that everything they say is a lie, you are just
  as much in danger as if you trusted everything they say.''
  -- Michael H. Warfield