aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2010-10-02 14:28:12 +0000
committerBlue Swirl <blauwirbel@gmail.com>2010-10-02 14:28:12 +0000
commita82cdd58fd9ffa8c651f51de8d855f6baf708681 (patch)
treec07111dd003a2875da57d33246d350223868ac38 /Makefile
parent904fe1fbd10388f384c9930fa2d8a25113b7e7aa (diff)
trace: avoid unnecessary recompilation if nothing changed
Add logic to detect changes in generated files. If the old and new files are identical, don't touch the generated file. This avoids a lot of churn since many files depend on trace.h. Based on suggestion by Paolo Bonzini. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 9 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 7c71c83a18..04ce07d7c4 100644
--- a/Makefile
+++ b/Makefile
@@ -106,11 +106,15 @@ ui/vnc.o: QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
bt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
-trace.h: $(SRC_PATH)/trace-events config-host.mak
- $(call quiet-command,sh $(SRC_PATH)/tracetool --$(TRACE_BACKEND) -h < $< > $@," GEN $@")
-
-trace.c: $(SRC_PATH)/trace-events config-host.mak
- $(call quiet-command,sh $(SRC_PATH)/tracetool --$(TRACE_BACKEND) -c < $< > $@," GEN $@")
+trace.h: trace.h-timestamp
+trace.h-timestamp: $(SRC_PATH)/trace-events config-host.mak
+ $(call quiet-command,sh $(SRC_PATH)/tracetool --$(TRACE_BACKEND) -h < $< > $@," GEN trace.h")
+ @cmp -s $@ trace.h || cp $@ trace.h
+
+trace.c: trace.c-timestamp
+trace.c-timestamp: $(SRC_PATH)/trace-events config-host.mak
+ $(call quiet-command,sh $(SRC_PATH)/tracetool --$(TRACE_BACKEND) -c < $< > $@," GEN trace.c")
+ @cmp -s $@ trace.c || cp $@ trace.c
trace.o: trace.c $(GENERATED_HEADERS)