Received: from eggs.gnu.org ([140.186.70.92]:35647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtQTt-0003IA-GJ for qemu-devel@nongnu.org; Fri, 03 Feb 2012 16:15:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RtQTr-00084n-Gs for qemu-devel@nongnu.org; Fri, 03 Feb 2012 16:15:41 -0500 Received: from gw.ac.upc.edu ([147.83.30.3]:50454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtQTr-00084g-5I for qemu-devel@nongnu.org; Fri, 03 Feb 2012 16:15:39 -0500 From: =?utf-8?b?TGx1w61z?= Vilanova Date: Fri, 03 Feb 2012 22:15:27 +0100 Message-ID: <20120203211527.31173.65983.stgit@ginnungagap.bsc.es> In-Reply-To: <20120203211457.31173.55544.stgit@ginnungagap.bsc.es> References: <20120203211457.31173.55544.stgit@ginnungagap.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 2/3] [trivial] Simpler handling of tracetool-generated files in makfiles List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: stefanha@gmail.com Signed-off-by: Llu=C3=ADs Vilanova --- Makefile.objs | 19 +++++++++---------- rules.mak | 6 ++++++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index 941386b..b187d17 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -349,18 +349,17 @@ libdis-$(CONFIG_SPARC_DIS) +=3D sparc-dis.o # trace =20 ifeq ($(TRACE_BACKEND),dtrace) -trace.h: trace.h-timestamp trace-dtrace.h -else -trace.h: trace.h-timestamp +TRACE_H_EXTRA_DEPS=3Dtrace-dtrace.h endif +trace.h: trace.h-timestamp $(TRACE_H_EXTRA_DEPS) trace.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/tracetool.py --forma= t=3Dh --backend=3D$(TRACE_BACKEND) < $< > $@," GEN trace.h") - @cmp -s $@ trace.h || cp $@ trace.h + $(call tracetool-gen,h,$(TRACE_BACKEND)) + $(call tracetool-ci) =20 trace.c: trace.c-timestamp trace.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/tracetool.py --forma= t=3Dc --backend=3D$(TRACE_BACKEND) < $< > $@," GEN trace.c") - @cmp -s $@ trace.c || cp $@ trace.c + $(call tracetool-gen,c,$(TRACE_BACKEND)) + $(call tracetool-ci) =20 trace.o: trace.c $(GENERATED_HEADERS) =20 @@ -372,11 +371,11 @@ trace-dtrace.h: trace-dtrace.dtrace # rule file. So we use '.dtrace' instead trace-dtrace.dtrace: trace-dtrace.dtrace-timestamp trace-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/con= fig-host.mak - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/tracetool.py --forma= t=3Dd --backend=3D$(TRACE_BACKEND) < $< > $@," GEN trace-dtrace.dtrace= ") - @cmp -s $@ trace-dtrace.dtrace || cp $@ trace-dtrace.dtrace + $(call tracetool-gen,d,$(TRACE_BACKEND)) + $(call tracetool-ci) =20 trace-dtrace.o: trace-dtrace.dtrace $(GENERATED_HEADERS) - $(call quiet-command,dtrace -o $@ -G -s $<, " GEN trace-dtrace.o") + $(call quiet-command,dtrace -o $@ -G -s $<, " GEN trace-dtrace.o") =20 ifeq ($(LIBTOOL),) trace-dtrace.lo: trace-dtrace.dtrace diff --git a/rules.mak b/rules.mak index 04a9198..a7e58a0 100644 --- a/rules.mak +++ b/rules.mak @@ -59,6 +59,12 @@ find-in-path =3D $(if $(find-string /, $1), \ $(wildcard $1), \ $(wildcard $(patsubst %, %/$1, $(subst :, ,$(PATH))))) =20 +# Generate files with tracetool + +TRACETOOL=3D$(SRC_PATH)/scripts/tracetool.py +tracetool-gen=3D$(call quiet-command,$(PYTHON) $(TRACETOOL) $(3) --forma= t=3D$(1) --backend=3D$(2) < $< > $@," GEN $(subst -timestamp,,$@)") +tracetool-ci=3D@cmp -s $@ $(subst -timestamp,,$@) || cp $@ $(subst -time= stamp,,$@) + # Generate timestamp files for .h include files =20 %.h: %.h-timestamp