Date: Tue, 12 May 1998 12:00:03 -0700 (PDT) From: woods@zeus.leitch.com (Greg A. Woods) To: freebsd-bugs@FreeBSD.ORG Subject: Re: bin/6550 Message-ID: <199805121900.MAA26252@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/6550; it has been noted by GNATS.
From: woods@zeus.leitch.com (Greg A. Woods)
To: freebsd-gnats-submit@FreeBSD.ORG
Cc: Subject: Re: bin/6550
Date: Tue, 12 May 1998 14:55:58 -0400 (EDT)
[ On Sun, May 10, 1998 at 12:57:25 (-0700), Poul-Henning Kamp wrote: ]
> Subject: Re: bin/6550
>
> Synopsis: make(1): shell meta-character optimization incomplete
>
> State-Changed-From-To: open-closed
> State-Changed-By: phk
> State-Changed-When: Sun May 10 12:56:00 PDT 1998
> State-Changed-Why:
> what made you think that it should support all of that stuff ?
>
> make only supports some of the primitives to gain some speed,
> it has never promised to replace your shell entirely.
If you want FreeBSD's make to be standards compliant then perhaps the
following statement will be of help:
Commands will be executed by passing the command line to the command
interpreter in the same manner as if the string were the argument to
the XSH specification system() function.
This is from:
http://www.opengroup.org/onlinepubs/7908799/xcu/make.html
(You might have to go via http://www.UNIX-systems.org/online.html to get
there though because of the copyright restricitons.)
I think POSIX.2 is slightly more specific about skipping the use of
system() where possible, though perhaps only in the rationale sections.
Indeed this was the case in P1003.2 Draft 11.2:
6.2.7.2 Makefile Execution
Command lines shall be processed one at a time by writing the command
line to the standard output (unless one of the conditions listed below 1
under ``@'' suppresses the writing) and executing the command(s) in the 1
line. A <tab> character may precede the command to standard output.
Commands shall be executed by passing the command line to the command
interpreter in the same manner as if the string were the argument to the
function in 7.1.1 [such as the system() function in the C binding].
(7.1.1 is, of course, "Execute Shell Command")
The relevant part of the rationale from that draft reads:
Some implementations do not use system() for all command lines, as
required by the POSIX.2 portable makefile format; as a performance
enhancement, they select lines without shell metacharacters for direct
execution by execve(). There is no requirement that system() be used
specifically, but merely that the same results be achieved. The
metacharacters typically used to bypass the direct execve() execution
have been any of:
= | ^ ( ) ; & < > * ? [ ] : $ ` ' " \ \n
The default in some advanced versions of make is to group all the command
lines for a target and execute them using a single shell invocation; the
System V method is to pass each line individually to a separate shell.
The single-shell method has the advantages in performance and the lack of
a requirement for many continued lines. However, converting to this
newer method has caused portability problems with many historical
makefiles, so the behavior with the POSIX makefile is specified to be the
same as System V's. It is suggested that the special target .ONESHELL be
used as an implementation extension to achieve the single-shell grouping
for a target or group of targets.
--
Greg A. Woods
+1 416 443-1734 VE3TCP <gwoods@acm.org> <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199805121900.MAA26252>
