Skip to content

Commit

Permalink
docker: Don't use eval trick on Makefile
Browse files Browse the repository at this point in the history
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: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
ehabkost authored and pm215 committed Jun 7, 2016
1 parent 0601d6a commit d5aebef
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/docker/Makefile.include
Expand Up @@ -28,8 +28,7 @@ make-archive-maybe = $(if $(wildcard $1/*), \
" ARCHIVE $(notdir $2)"))

CUR_TIME := $(shell date +%Y-%m-%d-%H.%M.%S.$$$$)
# Makes the definition constant after the first expansion
DOCKER_SRC_COPY = $(eval DOCKER_SRC_COPY := docker-src.$(CUR_TIME))$(DOCKER_SRC_COPY)
DOCKER_SRC_COPY := docker-src.$(CUR_TIME)

$(DOCKER_SRC_COPY):
@mkdir $@
Expand Down

0 comments on commit d5aebef

Please sign in to comment.