From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 28 16:04:19 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 812D8106566C; Thu, 28 Apr 2011 16:04:19 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from mailhost.dlr.de (mailhost.dlr.de [129.247.252.32]) by mx1.freebsd.org (Postfix) with ESMTP id 186DE8FC13; Thu, 28 Apr 2011 16:04:19 +0000 (UTC) Received: from DLREXHUB02.intra.dlr.de (172.21.152.140) by mailhost.dlr.de (172.21.163.100) with Microsoft SMTP Server (TLS) id 14.1.270.2; Thu, 28 Apr 2011 17:52:53 +0200 Received: from beagle.kn.op.dlr.de (129.247.178.136) by smtp.dlr.de (172.21.152.151) with Microsoft SMTP Server (TLS) id 14.1.270.2; Thu, 28 Apr 2011 17:52:57 +0200 Date: Thu, 28 Apr 2011 17:52:58 +0200 From: Hartmut Brandt X-X-Sender: brandt_h@beagle.kn.op.dlr.de To: Roman Divacky In-Reply-To: <20110427193946.GA41659@freebsd.org> Message-ID: <20110428174523.I61666@beagle.kn.op.dlr.de> References: <20110427193946.GA41659@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [129.247.178.136] Cc: hackers@freebsd.org Subject: Re: make question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2011 16:04:19 -0000 Hi Roman, On Wed, 27 Apr 2011, Roman Divacky wrote: RD>You seem to have messed with bsd make so I have a question for you :) Yeah, that was some time ago ... RD>When a job is about to be executed in JobStart() a pipe is created with RD>its ends connected to job->inPipe/job->outPipe. When the job is actually RD>created in JobExec() the ps.out is set to job->outPipe so that in RD>JobDoOutput() we can read from that pipe and basically just parse the output RD>for shell->noPrint and leaving it out from the output. This is meant (I think) RD>for supressing the "filter" thing. Ie. that if we do some @command the RD>restoration of setting of quiet mode is filtered out. RD> RD> RD>In -B mode we do it differently, as we invoke one shell per command we don't RD>have to insert quiet/verbose commands and thus avoid all the piping/parsing RD>dance. RD> RD>So my question is - why don't we invoke one shell per command by default RD>and avoid the piping/parsing? Is this because of performance? I think that RD>the piping/parsing of the output can have worse impact than invoking a shell RD>for every command. Especially given that most targets consists of just one RD>command. The answer is in /usr/share/doc/psd/12.make. This is so one can write something like debug: DEBUG_FLAGS=-g for i in $(SUBDIR); do $(MAKE) -C $$i all done instead of: debug: DEBUG_FLAGS=-g \ for i in $(SUBDIR); do \ $(MAKE) -C $$i all ; \ done -B means 'backward compatible' and does what the original v7 make did: one shell per command. This means you don't have to write the backslashes and the shell variable will be seen in the sub-makes and programs. I think we can change this, because it would break makefiles that assume that the entire script is given to the shell in one piece. harti