Received: from eggs.gnu.org ([2001:4830:134:3::10]:51895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9v6T-0003X0-VR for qemu-devel@nongnu.org; Mon, 06 Jun 2016 10:02:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9v6O-0005tH-M3 for qemu-devel@nongnu.org; Mon, 06 Jun 2016 10:02:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9v6O-0005tB-Gs for qemu-devel@nongnu.org; Mon, 06 Jun 2016 10:02:00 -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> From: Paolo Bonzini Message-ID: Date: Mon, 6 Jun 2016 16:01:53 +0200 MIME-Version: 1.0 In-Reply-To: <20160606125034.GE19055@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 , Fam Zheng Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org 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) > 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. Paolo