%% David Boyce <[EMAIL PROTECTED]> writes:

  db> Just wondering why GNU make (apparently) has logic built in to
  db> skip creating a new process for the ":" shell builtin but not for
  db> the "true" and "false" commands. Running truss on Solaris shows
  db> that with the following Makefile:

  db> % cat Makefile
  db> .PHONY: all

  db> all:
  db>          true
  db>          :
  db>          true

  db> Is this just an accident of history or is there a reason why it's
  db> ok to shortcut ":" but not "true"?

I wasn't around when the decision was made, but I think there is a
reason.

The thinking is (I suspect) that ":" is a shell builtin, and there's
nothing else it could possibly be.  That is, if you're running a Bourne
shell (and GNU make does check for this--if you're not, it never chooses
the "fast path" in the first place) and you see ":" alone as the command
to run, you always know what it is.

With "true" and "false" that's not the case: typically (and certainly in
POSIX sh) these are not shell builtins, so it's possible that there are
some other programs named "true" or "false" that will be found on your
PATH before any standard system versions, that will behave differently
than traditional true and false.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to