build: some simplifications for "trace/Makefile.objs"
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 24 Dec 2012 13:06:27 +0000 (14:06 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 12 Jan 2013 17:42:51 +0000 (18:42 +0100)
Signed-off-by: LluĂ­s Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
include/trace.h [new file with mode: 0644]
trace.h [deleted file]
trace/Makefile.objs

diff --git a/include/trace.h b/include/trace.h
new file mode 100644 (file)
index 0000000..c15f498
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef TRACE_H
+#define TRACE_H
+
+#include "trace/generated-tracers.h"
+
+#endif  /* TRACE_H */
diff --git a/trace.h b/trace.h
deleted file mode 100644 (file)
index c15f498..0000000
--- a/trace.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef TRACE_H
-#define TRACE_H
-
-#include "trace/generated-tracers.h"
-
-#endif  /* TRACE_H */
index 40febce5a19a0df54a5cc394e732c1265037d6e0..ed2e30b001bb54636cd7a5b3c9fee2169f472350 100644 (file)
@@ -1,12 +1,9 @@
 # -*- mode: makefile -*-
 
 ######################################################################
-# Auto-generated tracing routines
+# Auto-generated header for tracing routines
 
-ifeq ($(TRACE_BACKEND),dtrace)
-TRACE_H_EXTRA_DEPS=$(obj)/generated-tracers-dtrace.h
-endif
-$(obj)/generated-tracers.h: $(obj)/generated-tracers.h-timestamp $(TRACE_H_EXTRA_DEPS)
+$(obj)/generated-tracers.h: $(obj)/generated-tracers.h-timestamp
 $(obj)/generated-tracers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
        $(call quiet-command,$(TRACETOOL) \
                --format=h \
@@ -14,6 +11,10 @@ $(obj)/generated-tracers.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/conf
                < $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
        @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
 
+######################################################################
+# Auto-generated tracing routines (non-DTrace)
+
+ifneq ($(TRACE_BACKEND),dtrace)
 $(obj)/generated-tracers.c: $(obj)/generated-tracers.c-timestamp
 $(obj)/generated-tracers.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
        $(call quiet-command,$(TRACETOOL) \
@@ -23,9 +24,6 @@ $(obj)/generated-tracers.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/conf
        @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
 
 $(obj)/generated-tracers.o: $(obj)/generated-tracers.c $(obj)/generated-tracers.h
-
-ifneq ($(TRACE_BACKEND),dtrace)
-trace-obj-y += generated-tracers.o
 endif
 
 
@@ -35,19 +33,20 @@ endif
 # Normal practice is to name DTrace probe file with a '.d' extension
 # but that gets picked up by QEMU's Makefile as an external dependency
 # rule file. So we use '.dtrace' instead
-$(obj)/generated-tracers-dtrace.dtrace: $(obj)/generated-tracers-dtrace.dtrace-timestamp
-$(obj)/generated-tracers-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
+ifeq ($(TRACE_BACKEND),dtrace)
+$(obj)/generated-tracers.dtrace: $(obj)/generated-tracers.dtrace-timestamp
+$(obj)/generated-tracers.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
        $(call quiet-command,$(TRACETOOL) \
                --format=d \
                --backend=$(TRACE_BACKEND) \
                < $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
        @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
 
-$(obj)/generated-tracers-dtrace.h: trace/generated-tracers-dtrace.dtrace
+$(obj)/generated-tracers-dtrace.h: $(obj)/generated-tracers.dtrace
        $(call quiet-command,dtrace -o $@ -h -s $<, "  GEN   $@")
 
-trace-obj-$(CONFIG_TRACE_DTRACE) += generated-tracers-dtrace.o
-
+$(obj)/generated-tracers.o: $(obj)/generated-tracers.dtrace
+endif
 
 ######################################################################
 # Backend code
@@ -56,3 +55,4 @@ trace-obj-$(CONFIG_TRACE_DEFAULT) += default.o
 trace-obj-$(CONFIG_TRACE_SIMPLE) += simple.o
 trace-obj-$(CONFIG_TRACE_STDERR) += stderr.o
 trace-obj-y += control.o
+trace-obj-y += generated-tracers.o