From owner-freebsd-bugs Tue May 12 12:03:38 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA02158 for freebsd-bugs-outgoing; Tue, 12 May 1998 12:03:38 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA02145 for ; Tue, 12 May 1998 12:03:34 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id MAA26252; Tue, 12 May 1998 12:00:03 -0700 (PDT) Date: Tue, 12 May 1998 12:00:03 -0700 (PDT) Message-Id: <199805121900.MAA26252@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.ORG From: woods@zeus.leitch.com (Greg A. Woods) Subject: Re: bin/6550 Reply-To: woods@zeus.leitch.com (Greg A. Woods) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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 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 Planix, Inc. ; Secrets of the Weird To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message