From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9vJZ-0000zU-1I for qemu-devel@nongnu.org; Mon, 06 Jun 2016 10:15:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9vJT-0000KM-81 for qemu-devel@nongnu.org; Mon, 06 Jun 2016 10:15:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56111) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9vJT-0000KC-2A for qemu-devel@nongnu.org; Mon, 06 Jun 2016 10:15:31 -0400 Date: Mon, 6 Jun 2016 11:15:28 -0300 From: Eduardo Habkost Message-ID: <20160606141528.GF19055@thinpad.lan.raisama.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: Paolo Bonzini Cc: Fam Zheng , peter.maydell@linaro.org, qemu-devel@nongnu.org On Mon, Jun 06, 2016 at 04:01:53PM +0200, Paolo Bonzini wrote: > > > On 06/06/2016 14:50, Eduardo Habkost wrote: > > # Makes the definition constant after the first expansion > > DOCKER_SRC_COPY = $(eval DOCKER_SRC_COPY := docker-src.$(CUR_TIME))$(DOCKER_SRC_COPY) > > > > $(shell echo DEBUG: src_copy: $(DOCKER_SRC_COPY) >&2) > > > > $(DOCKER_SRC_COPY): > > @mkdir $@ > > $(call make-archive-maybe, $(SRC_PATH), $@/qemu.tgz) > > > > and I still get a failure: https://travis-ci.org/ehabkost/qemu/jobs/135574871 > > > > $ make -j3 && ${TEST_CMD} > > DEBUG: cur_time: 2016.13278 > > /home/travis/build/ehabkost/qemu/tests/docker/Makefile.include:37: *** unterminated variable reference. Stop. > > > > I am very confused by that code: using "=" to make a variable > > reference itself is not allowed, but in this case no error is > > reported because of the $(eval) trick. I have no idea what will > > happen the second time the variable is expanded. Isn't $(eval) > > going to be expanded again? > > 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? > > > 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) ? -- Eduardo