trace: rebuild generated-events.o when configuration changes
authorStefan Hajnoczi <stefanha@redhat.com>
Fri, 8 Mar 2013 14:52:15 +0000 (15:52 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 28 Mar 2013 13:19:57 +0000 (14:19 +0100)
Make sure to rebuild generated-events.o when ./configure options change.
This prevents linker errors when a stale generated-events.o gets linked
with code compiled against fresh headers.  For example, try building
with ./configure --enable-trace-backend=stderr followed by ./configure
--enable-trace-backend=dtrace.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
trace/Makefile.objs

index 156aa25..a043072 100644 (file)
@@ -11,7 +11,7 @@ $(obj)/generated-events.h-timestamp: $(SRC_PATH)/trace-events
                < $< > $@,"  GEN   $(patsubst %-timestamp,%,$@)")
        @cmp -s $@ $(patsubst %-timestamp,%,$@) || cp $@ $(patsubst %-timestamp,%,$@)
 
-$(obj)/generated-events.c: $(obj)/generated-events.c-timestamp
+$(obj)/generated-events.c: $(obj)/generated-events.c-timestamp $(BUILD_DIR)/config-host.mak
 $(obj)/generated-events.c-timestamp: $(SRC_PATH)/trace-events
        $(call quiet-command,$(TRACETOOL) \
                --format=events-c \