Why do double-colon MAKE targets with no dependencies always get made?

Ian! D. Allen [CGL] idallen at watcgl.waterloo.edu
Sun May 27 13:41:30 AEST 1990


    % cat Makefile
    foo:
	    echo "$@ updated by '$?'"

    bar::
	    echo "$@ updated by '$?'"
    % touch foo bar ; make foo bar
    `foo' is up to date.
    echo "bar updated by ''"
    bar updated by ''

This is annoying.  I can't see the utility of this, and it prevents me
from writing this cleanly:

    target::
	 <create missing target from scratch>

    target:: some files
	 <update target using old target and some files>

MIT has code in their X11 Imake/Makefile:: target to work around this bug.

I want Mr.GnuMake to fix the bug, but he insists on Unix compatibility:

    From: Roland McGrath <mcgrath at helen.Berkeley.EDU>
    Subject: Re: possible GNU Make bug 
    Ask Athena if they the change you suggest would be good for use in
    conjunction with Imake.  If they say so, I'll change it.

What say the Wizards?  Am I missing something?
The kludge work-around is to use:

    target:: target
	 <create missing target from scratch>

which fools make into doing the right thing.
-- 
-IAN! (Ian! D. Allen) idallen at watcgl.uwaterloo.ca idallen at watcgl.waterloo.edu
 [129.97.128.64]  Computer Graphics Lab/University of Waterloo/Ontario/Canada



More information about the Comp.unix.wizards mailing list