From owner-freebsd-ports@FreeBSD.ORG Fri Mar 12 16:28:11 2004 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 63CE116A4D1; Fri, 12 Mar 2004 16:28:11 -0800 (PST) Received: from mail.dt.e-technik.uni-dortmund.de (mail.dt.E-Technik.Uni-Dortmund.DE [129.217.163.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id C493743D31; Fri, 12 Mar 2004 16:28:10 -0800 (PST) (envelope-from ma@dt.e-technik.uni-dortmund.de) Received: from m2a2.dyndns.org (krusty.dt.e-technik.uni-dortmund.de [129.217.163.1])A907824BFE; Sat, 13 Mar 2004 01:28:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by merlin.emma.line.org (Postfix) with ESMTP id D6B39A54F7; Sat, 13 Mar 2004 01:28:07 +0100 (CET) Received: from merlin.emma.line.org ([127.0.0.1]) by localhost (m2a2.dyndns.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 14746-02; Sat, 13 Mar 2004 01:28:07 +0100 (CET) Received: by merlin.emma.line.org (Postfix, from userid 500) id 507C1A5498; Sat, 13 Mar 2004 01:28:07 +0100 (CET) Date: Sat, 13 Mar 2004 01:28:07 +0100 From: Matthias Andree To: fuyuki@nigredo.org, pav@freebsd.org Message-ID: <20040313002807.GA13745@merlin.emma.line.org> Mail-Followup-To: fuyuki@nigredo.org, pav@freebsd.org, knu@freebsd.org, ports@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.5.1i X-Virus-Scanned: by amavisd-new at m2a2.dyndns.org cc: ports@freebsd.org Subject: ports/64037 and the alleged && -> ; failure from March 2002 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Mar 2004 00:28:11 -0000 Hi, I filed PR #64037 with a patch for a port that fuyuki maintains. My patch included changing the ";" in "cd some dir ; some command " to "&&" in shell command lines was refused by the maintainer, with a reference to http://lists.liquidneon.com/pipermail/kde-freebsd/2002-March/000940.html that claims that "make -jN" could break up a shell command such as "cd dir && foo" and execute foo before cd dir. I am refuting that claim in Akinori's post. 'cd dir && foo' IS a proper use of && in a Makefile. The whole line is a shell command and make doesn't care about the && or ; - it's up to the shell to handle it. (I assume make uses a sane shell such as /bin/sh or ksh.) make(1) is specified to run shell commands, with the exception that command lines have to start with a TAB and if the first non-blank character is - or @ it is treated specially (exit code ignored or not echoed). The shell command lines associated with a target are "a series of shell commands" (make(1)), hence the lines for any single target are executed in order. Consider target: depA depB checksomething && dosomething domore Then make -j4 may build depB before depA - but it will run dosomething and domore in exactly this order only if checksomething passes (exits with code 0). If you believe otherwise, please show evidence that a construct like this target: depends cd foo && bar executes "bar" without having successfully completed "cd foo" first with make -jN. If that evidence cannot be shown or cannot be verified with the make commands of currently supported FreeBSD versions, I ask that spreading FUD about "&&" being invalid in make shell commands be stopped once and for all and that "cd blah && foo" constructs be rehabilitated in Makefiles. Best regards, -- Matthias Andree Encrypt your mail: my GnuPG key ID is 0x052E7D95