Patchwork [05/27] build: move dtrace rules to rules.mak

login
register
mail settings
Submitter Paolo Bonzini
Date Dec. 21, 2012, 4:05 p.m.
Message ID <1356105948-13216-6-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/207830/
State New
Headers show

Comments

Paolo Bonzini - Dec. 21, 2012, 4:05 p.m.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile.objs |    8 --------
 rules.mak     |    9 +++++++++
 2 files changed, 9 insertions(+), 8 deletions(-)

Patch

diff --git a/Makefile.objs b/Makefile.objs
index 346bf9d..7858c4e 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -169,14 +169,6 @@  trace-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host
 trace-dtrace.o: trace-dtrace.dtrace $(GENERATED_HEADERS)
 	$(call quiet-command,dtrace -o $@ -G -s $<, "  GEN   trace-dtrace.o")
 
-ifeq ($(LIBTOOL),)
-trace-dtrace.lo: trace-dtrace.dtrace
-	@echo "missing libtool. please install and rerun configure."; exit 1
-else
-trace-dtrace.lo: trace-dtrace.dtrace
-	$(call quiet-command,$(LIBTOOL) --mode=compile --tag=CC dtrace -o $@ -G -s $<, "  lt GEN trace-dtrace.o")
-endif
-
 trace/simple.o: trace/simple.c $(GENERATED_HEADERS)
 
 trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
diff --git a/rules.mak b/rules.mak
index 6a7af8a..494fff8 100644
--- a/rules.mak
+++ b/rules.mak
@@ -23,6 +23,9 @@  QEMU_CFLAGS += -I$(<D) -I$(@D)
 ifeq ($(LIBTOOL),)
 %.lo: %.c
 	@echo "missing libtool. please install and rerun configure"; exit 1
+%.lo: %.dtrace
+	@echo "missing libtool. please install and rerun configure."; exit 1
+
 LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \
        $(sort $(filter %.o, $1)) $(filter-out %.o, $1) \
        $(LIBS),"  LINK  $(TARGET_DIR)$@")
@@ -30,6 +33,9 @@  else
 LIBTOOL += $(if $(V),,--quiet)
 %.lo: %.c
 	$(call quiet-command,$(LIBTOOL) --mode=compile --tag=CC $(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<,"  lt CC $@")
+%.lo: %.dtrace
+	$(call quiet-command,$(LIBTOOL) --mode=compile --tag=CC dtrace -o $@ -G -s $<, " lt GEN $(TARGET_DIR)$@")
+
 LINK = $(call quiet-command,\
        $(if $(filter %.lo %.la,$^),$(LIBTOOL) --mode=link --tag=CC \
        )$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \
@@ -43,6 +49,9 @@  endif
 %.o: %.m
 	$(call quiet-command,$(OBJCC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<,"  OBJC  $(TARGET_DIR)$@")
 
+%.o: %.dtrace
+	$(call quiet-command,dtrace -o $@ -G -s $<, "  GEN   $(TARGET_DIR)$@")
+
 %$(EXESUF): %.o
 	$(call LINK,$^)