Revision 4115852b

b/Makefile
91 91

  
92 92
SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
93 93

  
94
subdir-%: $(GENERATED_HEADERS)
94
subdir-%:
95 95
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
96 96

  
97 97
ifneq ($(wildcard config-host.mak),)
98 98
include $(SRC_PATH)/Makefile.objs
99 99
endif
100 100

  
101
$(universal-obj-y) $(common-obj-y): $(GENERATED_HEADERS)
102 101
subdir-libcacard: $(oslib-obj-y) $(trace-obj-y) qemu-timer-common.o
103 102

  
104 103
$(filter %-softmmu,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) $(common-obj-y) subdir-libdis
105 104

  
106
$(filter %-user,$(SUBDIR_RULES)): $(GENERATED_HEADERS) $(universal-obj-y) $(trace-obj-y) subdir-libdis-user subdir-libuser
105
$(filter %-user,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) subdir-libdis-user subdir-libuser
107 106

  
108 107
ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
109 108
romsubdir-%:
......
142 141
install-libcacard:
143 142
	@echo "libtool is missing, please install and rerun configure"; exit 1
144 143
else
145
libcacard.la: $(GENERATED_HEADERS) $(oslib-obj-y) qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y)))
144
libcacard.la: $(oslib-obj-y) qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y)))
146 145
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,)
147 146

  
148 147
install-libcacard: libcacard.la
......
151 150
######################################################################
152 151

  
153 152
qemu-img.o: qemu-img-cmds.h
154
qemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o cmd.o qemu-ga.o: $(GENERATED_HEADERS)
155 153

  
156 154
tools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-tool.o qemu-timer.o \
157 155
	qemu-timer-common.o main-loop.o notify.o iohandler.o cutils.o async.o
......
162 160
qemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y)
163 161

  
164 162
qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o
165
qemu-bridge-helper.o: $(GENERATED_HEADERS)
166 163

  
167 164
fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o oslib-posix.o $(trace-obj-y)
168 165
fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
......
170 167
qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
171 168
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
172 169

  
173
$(qapi-obj-y): $(GENERATED_HEADERS)
174 170
qapi-dir := $(BUILD_DIR)/qapi-generated
175 171
qemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
176 172
qemu-ga$(EXESUF): QEMU_CFLAGS += -I $(qapi-dir)
......
203 199

  
204 200
QGALIB_OBJ=$(addprefix $(qapi-dir)/, qga-qapi-types.o qga-qapi-visit.o qga-qmp-marshal.o)
205 201
QGALIB_GEN=$(addprefix $(qapi-dir)/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
206
$(QGALIB_OBJ): $(QGALIB_GEN) $(GENERATED_HEADERS)
207
$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) $(GENERATED_HEADERS)
202
$(QGALIB_OBJ): $(QGALIB_GEN)
203
$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
208 204

  
209 205
qemu-ga$(EXESUF): qemu-ga.o $(qga-obj-y) $(tools-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) $(QGALIB_OBJ)
210 206

  
......
399 395
	cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn
400 396
	rm -rf /tmp/$(FILE)
401 397

  
398
# Add a dependency on the generated files, so that they are always
399
# rebuilt before other object files
400
Makefile: $(GENERATED_HEADERS)
401

  
402 402
# Include automatically generated dependency files
403 403
-include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d ui/*.d qapi/*.d qga/*.d)
b/Makefile.target
1 1
# -*- Mode: makefile -*-
2 2

  
3
GENERATED_HEADERS = config-target.h
4 3
CONFIG_NO_PCI = $(if $(subst n,,$(CONFIG_PCI)),n,y)
5 4
CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
6 5
CONFIG_NO_XEN = $(if $(subst n,,$(CONFIG_XEN)),n,y)
......
105 104

  
106 105
tci-dis.o: QEMU_CFLAGS += -I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/tci
107 106

  
108
$(libobj-y): $(GENERATED_HEADERS)
109

  
110 107
# HELPER_CFLAGS is used for all the legacy code compiled with static register
111 108
# variables
112 109
ifneq ($(TARGET_BASE_ARCH), sparc)
......
143 140

  
144 141
obj-m68k-y += m68k-sim.o m68k-semi.o
145 142

  
146
$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
147

  
148 143
obj-y += $(addprefix ../, $(universal-obj-y))
149 144
obj-y += $(addprefix ../libuser/, $(user-obj-y))
150 145
obj-y += $(addprefix ../libdis-user/, $(libdis-y))
......
166 161

  
167 162
obj-i386-y += ioport-user.o
168 163

  
169
$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
170

  
171 164
obj-y += $(addprefix ../, $(universal-obj-y))
172 165
obj-y += $(addprefix ../libuser/, $(user-obj-y))
173 166
obj-y += $(addprefix ../libdis-user/, $(libdis-y))
......
392 385

  
393 386
main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
394 387

  
395
monitor.o: hmp-commands.h qmp-commands-old.h
396

  
397
$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
388
GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
398 389

  
399 390
obj-y += $(addprefix ../, $(universal-obj-y))
400 391
obj-y += $(addprefix ../, $(common-obj-y))
......
457 448
	$(INSTALL_DATA) $(QEMU_PROG).stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
458 449
endif
459 450

  
451
GENERATED_HEADERS += config-target.h
452
Makefile: $(GENERATED_HEADERS)
453

  
460 454
# Include automatically generated dependency files
461 455
-include $(wildcard *.d */*.d)
b/tests/Makefile
37 37
test-qapi-obj-y += tests/test-qapi-visit.o tests/test-qapi-types.o
38 38
test-qapi-obj-y += module.o
39 39

  
40
$(test-obj-y): $(GENERATED_HEADERS)
41 40
$(test-obj-y): QEMU_INCLUDES += -Itests
42 41

  
43 42
tests/check-qint$(EXESUF): tests/check-qint.o qint.o $(tools-obj-y)

Also available in: Unified diff