makefile: merge GENERATED_HEADERS & GENERATED_SOURCES variables

The only functional difference between the GENERATED_HEADERS
and GENERATED_SOURCES variables is that 'Makefile' has a
dependancy on GENERATED_HEADERS, causing generated header files
to be created immediatey at the start of the build process.
There is no reason why this early creation should be restricted
to the .h files, and not include .c files too. Merge both of
the variables into a single GENERATED_FILES variable to make
it clear it is for any type of generated file.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 20170228122901.24520-2-berrange@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Daniel P. Berrange 2017-02-28 12:29:00 +00:00 committed by Stefan Hajnoczi
parent 1883ff34b5
commit 4f04f13c2a
4 changed files with 22 additions and 23 deletions

View File

@ -50,24 +50,24 @@ endif
include $(SRC_PATH)/rules.mak include $(SRC_PATH)/rules.mak
GENERATED_HEADERS = qemu-version.h config-host.h qemu-options.def GENERATED_FILES = qemu-version.h config-host.h qemu-options.def
GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h qapi-event.h GENERATED_FILES += qmp-commands.h qapi-types.h qapi-visit.h qapi-event.h
GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c GENERATED_FILES += qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c
GENERATED_HEADERS += qmp-introspect.h GENERATED_FILES += qmp-introspect.h
GENERATED_SOURCES += qmp-introspect.c GENERATED_FILES += qmp-introspect.c
GENERATED_HEADERS += trace/generated-tcg-tracers.h GENERATED_FILES += trace/generated-tcg-tracers.h
GENERATED_HEADERS += trace/generated-helpers-wrappers.h GENERATED_FILES += trace/generated-helpers-wrappers.h
GENERATED_HEADERS += trace/generated-helpers.h GENERATED_FILES += trace/generated-helpers.h
GENERATED_SOURCES += trace/generated-helpers.c GENERATED_FILES += trace/generated-helpers.c
ifdef CONFIG_TRACE_UST ifdef CONFIG_TRACE_UST
GENERATED_HEADERS += trace-ust-all.h GENERATED_FILES += trace-ust-all.h
GENERATED_SOURCES += trace-ust-all.c GENERATED_FILES += trace-ust-all.c
endif endif
GENERATED_HEADERS += module_block.h GENERATED_FILES += module_block.h
TRACE_HEADERS = trace-root.h $(trace-events-subdirs:%=%/trace.h) TRACE_HEADERS = trace-root.h $(trace-events-subdirs:%=%/trace.h)
TRACE_SOURCES = trace-root.c $(trace-events-subdirs:%=%/trace.c) TRACE_SOURCES = trace-root.c $(trace-events-subdirs:%=%/trace.c)
@ -80,8 +80,8 @@ ifdef CONFIG_TRACE_UST
TRACE_HEADERS += trace-ust-root.h $(trace-events-subdirs:%=%/trace-ust.h) TRACE_HEADERS += trace-ust-root.h $(trace-events-subdirs:%=%/trace-ust.h)
endif endif
GENERATED_HEADERS += $(TRACE_HEADERS) GENERATED_FILES += $(TRACE_HEADERS)
GENERATED_SOURCES += $(TRACE_SOURCES) GENERATED_FILES += $(TRACE_SOURCES)
trace-group-name = $(shell dirname $1 | sed -e 's/[^a-zA-Z0-9]/_/g') trace-group-name = $(shell dirname $1 | sed -e 's/[^a-zA-Z0-9]/_/g')
@ -485,11 +485,10 @@ clean:
rm -f fsdev/*.pod rm -f fsdev/*.pod
rm -f qemu-img-cmds.h rm -f qemu-img-cmds.h
rm -f ui/shader/*-vert.h ui/shader/*-frag.h rm -f ui/shader/*-vert.h ui/shader/*-frag.h
@# May not be present in GENERATED_HEADERS @# May not be present in GENERATED_FILES
rm -f trace/generated-tracers-dtrace.dtrace* rm -f trace/generated-tracers-dtrace.dtrace*
rm -f trace/generated-tracers-dtrace.h* rm -f trace/generated-tracers-dtrace.h*
rm -f $(foreach f,$(GENERATED_HEADERS),$(f) $(f)-timestamp) rm -f $(foreach f,$(GENERATED_FILES),$(f) $(f)-timestamp)
rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp)
rm -rf qapi-generated rm -rf qapi-generated
rm -rf qga/qapi-generated rm -rf qga/qapi-generated
for d in $(ALL_SUBDIRS); do \ for d in $(ALL_SUBDIRS); do \
@ -784,7 +783,7 @@ endif # CONFIG_WIN
# Add a dependency on the generated files, so that they are always # Add a dependency on the generated files, so that they are always
# rebuilt before other object files # rebuilt before other object files
ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail)) ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
Makefile: $(GENERATED_HEADERS) Makefile: $(GENERATED_FILES)
endif endif
.SECONDARY: $(TRACE_HEADERS) $(TRACE_HEADERS:%=%-timestamp) \ .SECONDARY: $(TRACE_HEADERS) $(TRACE_HEADERS:%=%-timestamp) \

View File

@ -162,7 +162,7 @@ else
obj-y += hw/$(TARGET_BASE_ARCH)/ obj-y += hw/$(TARGET_BASE_ARCH)/
endif endif
GENERATED_HEADERS += hmp-commands.h hmp-commands-info.h GENERATED_FILES += hmp-commands.h hmp-commands-info.h
endif # CONFIG_SOFTMMU endif # CONFIG_SOFTMMU
@ -238,5 +238,5 @@ ifdef CONFIG_TRACE_SYSTEMTAP
$(INSTALL_DATA) $(QEMU_PROG)-simpletrace.stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG)-simpletrace.stp" $(INSTALL_DATA) $(QEMU_PROG)-simpletrace.stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG)-simpletrace.stp"
endif endif
GENERATED_HEADERS += config-target.h GENERATED_FILES += config-target.h
Makefile: $(GENERATED_HEADERS) Makefile: $(GENERATED_FILES)

View File

@ -8,7 +8,7 @@ obj-$(CONFIG_KVM) += kvm.o
feat-src = $(SRC_PATH)/target/$(TARGET_BASE_ARCH)/ feat-src = $(SRC_PATH)/target/$(TARGET_BASE_ARCH)/
feat-dst = $(BUILD_DIR)/$(TARGET_DIR) feat-dst = $(BUILD_DIR)/$(TARGET_DIR)
ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),clean)
GENERATED_HEADERS += $(feat-dst)gen-features.h GENERATED_FILES += $(feat-dst)gen-features.h
endif endif
$(feat-dst)gen-features.h: $(feat-dst)gen-features.h-timestamp $(feat-dst)gen-features.h: $(feat-dst)gen-features.h-timestamp

View File

@ -482,7 +482,7 @@ qapi-schema += unknown-expr-key.json
check-qapi-schema-y := $(addprefix tests/qapi-schema/, $(qapi-schema)) check-qapi-schema-y := $(addprefix tests/qapi-schema/, $(qapi-schema))
GENERATED_HEADERS += tests/test-qapi-types.h tests/test-qapi-visit.h \ GENERATED_FILES += tests/test-qapi-types.h tests/test-qapi-visit.h \
tests/test-qmp-commands.h tests/test-qapi-event.h \ tests/test-qmp-commands.h tests/test-qapi-event.h \
tests/test-qmp-introspect.h tests/test-qmp-introspect.h