提交 d5aebef8 编写于 作者: E Eduardo Habkost 提交者: Peter Maydell

docker: Don't use eval trick on Makefile

The eval trick for defining DOCKER_SRC_COPY doesn't do anything
useful, as DOCKER_SRC_COPY is immediately expanded just after it
is defined, and CUR_TIME is already defined using ":=". Simply
define it using ":=" so it is evaluated only once.

The eval trick was also triggering an weird error on Travis builds:
  qemu/tests/docker/Makefile.include:34: *** unterminated variable reference.  Stop.

The issue is not easily reproducible (maybe it's a bug in some
versions of Make), but it is avoided if removing the eval trick.
Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
上级 0601d6a4
...@@ -28,8 +28,7 @@ make-archive-maybe = $(if $(wildcard $1/*), \ ...@@ -28,8 +28,7 @@ make-archive-maybe = $(if $(wildcard $1/*), \
" ARCHIVE $(notdir $2)")) " ARCHIVE $(notdir $2)"))
CUR_TIME := $(shell date +%Y-%m-%d-%H.%M.%S.$$$$) CUR_TIME := $(shell date +%Y-%m-%d-%H.%M.%S.$$$$)
# Makes the definition constant after the first expansion DOCKER_SRC_COPY := docker-src.$(CUR_TIME)
DOCKER_SRC_COPY = $(eval DOCKER_SRC_COPY := docker-src.$(CUR_TIME))$(DOCKER_SRC_COPY)
$(DOCKER_SRC_COPY): $(DOCKER_SRC_COPY):
@mkdir $@ @mkdir $@
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册