From owner-svn-src-all@FreeBSD.ORG Tue Aug 21 05:46:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A94510657F4; Tue, 21 Aug 2012 05:46:34 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1800A8FC0A; Tue, 21 Aug 2012 05:46:33 +0000 (UTC) Received: by obbun3 with SMTP id un3so14434713obb.13 for ; Mon, 20 Aug 2012 22:46:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=JbkCBkvCgRPSaeziztmxAbY3ututXa4VyMdq82JJ7yM=; b=cdWG36u8ng9+3kn1Bur/e1g2wou8lMx/AL57hRkaDMd23aWaOe8LkfpocQpYMgdgk6 P6/SfWaFWG49cZ14tpltWeXyznLQCwS1AavURKaa6DqA7iO24CQOqGVkAA/MStsu64si WcW+ECK83IkGTY9VdOGXsH4TDSBZhdzjsGpSUTWKu6YInGfCx+lzozBIXZHxPA9N6YqJ IlSb5W5O38JRH6fyI8+kpxtT+DsLD+YZp3sGXAAFV+9zNuzsvsotfsdcRyk482F9qPg5 Kwfo3/tiU2ySVcOVKIgyDAQzi/3CBMvEr/5bs/xlTjj8Vj6KLsKqKSZW6qfbZLRozY0j B/FA== MIME-Version: 1.0 Received: by 10.60.20.69 with SMTP id l5mr11825506oee.114.1345527993655; Mon, 20 Aug 2012 22:46:33 -0700 (PDT) Received: by 10.76.142.201 with HTTP; Mon, 20 Aug 2012 22:46:33 -0700 (PDT) In-Reply-To: <20120821053519.BD5A158085@chaos.jnpr.net> References: <201207180557.q6I5vheM034018@svn.freebsd.org> <20120726084903.GA48240@lo0.su> <20120821053519.BD5A158085@chaos.jnpr.net> Date: Mon, 20 Aug 2012 22:46:33 -0700 Message-ID: From: Garrett Cooper To: "Simon J. Gerraty" Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ruslan Ermilov , "David E. O'Brien" Subject: Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2012 05:46:34 -0000 On Mon, Aug 20, 2012 at 10:35 PM, Simon J. Gerraty wrote: > Hi, sorry about the slow response. > > On Thu, 26 Jul 2012 12:49:03 +0400, Ruslan Ermilov writes: >>On Wed, Jul 18, 2012 at 05:57:43AM +0000, David E. O'Brien wrote: >>> Author: obrien >>> Date: Wed Jul 18 05:57:42 2012 >>> New Revision: 238563 >>> URL: http://svn.freebsd.org/changeset/base/238563 >>> >>> Log: >>> a ";" tells make we want the shell to be used >>> >>> Submitted by: Simon Gerraty >>> >>> Modified: >>> head/gnu/usr.bin/groff/tmac/Makefile >> >>I don't quite understand what this change does, could you elaborate? > > Sure. This is a consequence of bmake trying to be clever. > >>Without -jN (in backwards compatibility mode), the "cd" is a no-op >>(whether it's terminated by `;' or not) because make will execute a >>single shell per command, with cwd set to ${.OBJDIR}. > > Except on very weird systems, bmake is built in what NetBSD call > "native" mode, and even in compat mode will attempt to avoid the > overhead of all those shells. > Thus, unless it spots a shell meta char, it will try and skip the shell. > > Shell builtins like 'cd' or 'chdir' cannot be directly invoked, but make > doesn't know that. Simply adding the ';' convinces it to use a shell. > It is still a no-op. > >>With -jN, "cd" becomes necessary because all commands are executed as >>a script by one shell (the reason it was added in the first place), >>but adding `;' is a no-op because commands are on separate lines. > > A better way to construct targets like this is to put any excursion out > of .OBJDIR inside (): > > (cd ${.CURDIR} && \ > ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ > koi8-r.tmac hyphen.ru ${DESTDIR}${TMACDIR}) > > then the cd ${.OBJDIR} isn't needed at all. > note use of && rather than ; which can be very dangerous In standard scripts I would agree. In FreeBSD pmake, I would disagree, but it seems that it's the odd man out: $ bmake -f ~/Makefile.bad false; echo hmmm hmmm $ gmake -f ~/Makefile.bad false; echo hmmm hmmm $ make -f ~/Makefile.bad false; echo hmmm *** [all] Error code 1 Stop in /scratch/p4/user/gcooper/atf-head. Cheers, -Garrett