Revision 06da6e44 Makefile

b/Makefile
1 1
# Makefile for QEMU.
2 2

  
3 3
GENERATED_HEADERS = config-host.h trace.h qemu-options.def
4
ifeq ($(TRACE_BACKEND),dtrace)
5
GENERATED_HEADERS += trace-dtrace.h
6
endif
7 4

  
8 5
ifneq ($(wildcard config-host.mak),)
9 6
# Put the all: rule here so that config-host.mak can contain dependencies.
......
111 108

  
112 109
bt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
113 110

  
114
ifeq ($(TRACE_BACKEND),dtrace)
115
trace.h: trace.h-timestamp trace-dtrace.h
116
else
117 111
trace.h: trace.h-timestamp
118
endif
119 112
trace.h-timestamp: $(SRC_PATH)/trace-events config-host.mak
120 113
	$(call quiet-command,sh $(SRC_PATH)/tracetool --$(TRACE_BACKEND) -h < $< > $@,"  GEN   trace.h")
121 114
	@cmp -s $@ trace.h || cp $@ trace.h
......
127 120

  
128 121
trace.o: trace.c $(GENERATED_HEADERS)
129 122

  
130
trace-dtrace.h: trace-dtrace.dtrace
131
	$(call quiet-command,dtrace -o $@ -h -s $<, "  GEN   trace-dtrace.h")
132

  
133
# Normal practice is to name DTrace probe file with a '.d' extension
134
# but that gets picked up by QEMU's Makefile as an external dependancy
135
# rule file. So we use '.dtrace' instead
136
trace-dtrace.dtrace: trace-dtrace.dtrace-timestamp
137
trace-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events config-host.mak
138
	$(call quiet-command,sh $(SRC_PATH)/tracetool --$(TRACE_BACKEND) -d < $< > $@,"  GEN   trace-dtrace.dtrace")
139
	@cmp -s $@ trace-dtrace.dtrace || cp $@ trace-dtrace.dtrace
140

  
141
trace-dtrace.o: trace-dtrace.dtrace $(GENERATED_HEADERS)
142
	$(call quiet-command,dtrace -o $@ -G -s $<, "  GEN trace-dtrace.o")
143

  
144 123
simpletrace.o: simpletrace.c $(GENERATED_HEADERS)
145 124

  
146 125
version.o: $(SRC_PATH)/version.rc config-host.mak
......
178 157
	rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d block/*.o block/*.d net/*.o net/*.d fsdev/*.o fsdev/*.d ui/*.o ui/*.d
179 158
	rm -f qemu-img-cmds.h
180 159
	rm -f trace.c trace.h trace.c-timestamp trace.h-timestamp
181
	rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp
182
	rm -f trace-dtrace.h trace-dtrace.h-timestamp
183 160
	$(MAKE) -C tests clean
184 161
	for d in $(ALL_SUBDIRS) libhw32 libhw64 libuser libdis libdis-user; do \
185 162
	if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \

Also available in: Unified diff