From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9vaS-0004Uj-BS for qemu-devel@nongnu.org; Mon, 06 Jun 2016 10:33:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9vaM-0004zg-8T for qemu-devel@nongnu.org; Mon, 06 Jun 2016 10:33:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45031) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9vaM-0004zO-1r for qemu-devel@nongnu.org; Mon, 06 Jun 2016 10:32:58 -0400 References: <1464774324-886-1-git-send-email-famz@redhat.com> <1464774324-886-5-git-send-email-famz@redhat.com> <20160602191305.GB31052@thinpad.lan.raisama.net> <20160603012327.GB29298@ad.usersys.redhat.com> <20160603182601.GS19055@thinpad.lan.raisama.net> <20160606065824.GA9676@ad.usersys.redhat.com> <20160606114724.GB19055@thinpad.lan.raisama.net> <20160606115423.GC19055@thinpad.lan.raisama.net> <20160606125034.GE19055@thinpad.lan.raisama.net> <20160606141528.GF19055@thinpad.lan.raisama.net> From: Paolo Bonzini Message-ID: Date: Mon, 6 Jun 2016 16:32:50 +0200 MIME-Version: 1.0 In-Reply-To: <20160606141528.GF19055@thinpad.lan.raisama.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 04/16] Makefile: Rules for docker testing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Fam Zheng , peter.maydell@linaro.org, qemu-devel@nongnu.org On 06/06/2016 16:15, Eduardo Habkost wrote: >> > No, the second time you'll get the expansion of >> > >> > DOCKER_SRC_COPY := docker-src.$(CUR_TIME) > And why it isn't enough to simply write the above line in the > Makefile without any eval trick? Because 1) initially the idea was to delay the $(mkdir) too 2) Too many $(shell) end up slowing down make. >>> > > Why did you use this trick instead of just relying on ":=" to >>> > > expand the shell command only once? >> > >> > I think initially the $(mkdir) was in DOCKER_SRC_COPY too. Also, too >> > many $(shell) end up slowing down make. > And how exactly does the eval trick helps avoiding slowing down > make, that wouldn't happen if using just: > DOCKER_SRC_COPY = docker-src.$(CUR_TIME) > ? If you define CUR_TIME with "=", the DOCKER_SRC_COPY value changes every second. If you define CUR_TIME with ":=", again you have a useless $(shell). In this particular case I agree that it's probably premature optimization. Thanks, Paolo