]> xenbits.xensource.com Git - people/pauldu/qemu.git/commitdiff
trace: ensure $(tracetool-y) is defined in top level makefile
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 15 Mar 2017 12:34:21 +0000 (12:34 +0000)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 16 Mar 2017 03:51:26 +0000 (11:51 +0800)
The build rules for trace files have a dependancy on $(tracetool-y).
This variable populated in the trace/Makefile.objs file and thus its
definition gets pulled into the top level makefile. This happens too
late in the process though, so by the time $(tracetool-y) is defined,
make has already evaluated $(tracetool-y) in the dependancies and
found it to be empty. The result is that when the tracetool source
is changed, the generated files are not rebuilt. The solution is to
define the variable in the top level makefile too

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Eric Blake <eblake@redhat.com>
Message-id: 20170315123421.28815-1-berrange@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Makefile
trace/Makefile.objs

index 62917641f1b6cd6382a9731c9404b1bf46ca2155..108b984fb9baa0b224d9417c31847dcf8b4210f7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -86,6 +86,9 @@ GENERATED_FILES += $(BUILD_DIR)/trace-events-all
 
 trace-group-name = $(shell dirname $1 | sed -e 's/[^a-zA-Z0-9]/_/g')
 
+tracetool-y = $(SRC_PATH)/scripts/tracetool.py
+tracetool-y += $(shell find $(SRC_PATH)/scripts/tracetool -name "*.py")
+
 %/trace.h: %/trace.h-timestamp
        @cmp $< $@ >/dev/null 2>&1 || cp $< $@
 %/trace.h-timestamp: $(SRC_PATH)/%/trace-events $(tracetool-y)
index 7de840ad7ecc2244cd4385cb64dfedd4f91658cb..1b8eb4a6164e0191c3380293cd3f333fc7cb81e2 100644 (file)
@@ -1,13 +1,5 @@
 # -*- mode: makefile -*-
 
-######################################################################
-# tracetool source files
-# Every rule that invokes tracetool must depend on this so code is regenerated
-# if tracetool itself changes.
-
-tracetool-y = $(SRC_PATH)/scripts/tracetool.py
-tracetool-y += $(shell find $(SRC_PATH)/scripts/tracetool -name "*.py")
-
 $(BUILD_DIR)/trace-events-all: $(trace-events-files)
        $(call quiet-command,cat $^ > $@)