build: cleanup in Makefile.objs
v3 cover build: cleanup in Makefile.objs
This cleanup removes hardware objects from the list of files to be built for linux-user only targets.
It also builds traces files only when the related file is built.
Tested with all combinations of --{disable,enable}-{system,user,tools}
v3:
- don't move hw/display to CONFIG_BLOCK section
v2:
- add CONFIG_TOOLS and CONFIG_BLOCK
- replace GENERATED_FILES by generated-files-y
and use generated-files-${CONFIG_TRACE_UST} and
generated-files-${CONFIG_SOFTMMU} - move chardev-obj-y from SUBDIR_RULES to SOFTMMU_SUBDIR_RULES
- use $(CONFIG_BLOCK) in tests/Makefile.include
- disable qemu-ga with linux-user only
Laurent Vivier (5):
trace: only include trace-event-subdirs when they are needed
build: replace GENERATED_FILES by generated-files-y
configure: qemu-ga is only needed with softmmu targets
build: chardev is only needed for softmmu targets
build: don't build hardware objects with linux-user
Makefile | 43 +++++++------- Makefile.objs | 22 ++++--- Makefile.target | 6 +- configure | 4 +- target/s390x/Makefile.objs | 2 +- tests/Makefile.include | 116 ++++++++++++++++++------------------- 6 files changed, 102 insertions(+), 91 deletions(-)
Signature · 1 line
2.20.1
PATCH v3 1/5 trace: only include trace-event-subdirs when they are needed
Some directories are built only for softmmu targets, and the related trace-event-subdirs must do the same
--- Makefile.objs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
Makefile.objs +7 -5
@@ -127,11 +127,12 @@ rdmacm-mux-obj-y = contrib/rdmacm-mux/ trace-events-subdirs = trace-events-subdirs += accel/kvm trace-events-subdirs += accel/tcg -trace-events-subdirs += audio trace-events-subdirs += authz trace-events-subdirs += block trace-events-subdirs += chardev trace-events-subdirs += crypto +ifeq ($(CONFIG_SOFTMMU),y) +trace-events-subdirs += audio trace-events-subdirs += hw/9pfs trace-events-subdirs += hw/acpi trace-events-subdirs += hw/alpha
@@ -140,7 +141,6 @@ trace-events-subdirs += hw/audio trace-events-subdirs += hw/block trace-events-subdirs += hw/block/dataplane trace-events-subdirs += hw/char -trace-events-subdirs += hw/display trace-events-subdirs += hw/dma trace-events-subdirs += hw/hppa trace-events-subdirs += hw/i2c
@@ -173,11 +173,14 @@ trace-events-subdirs += hw/virtio trace-events-subdirs += hw/watchdog trace-events-subdirs += hw/xen trace-events-subdirs += hw/gpio +trace-events-subdirs += migration +trace-events-subdirs += net +trace-events-subdirs += ui +endif +trace-events-subdirs += hw/display trace-events-subdirs += io trace-events-subdirs += linux-user -trace-events-subdirs += migration trace-events-subdirs += nbd -trace-events-subdirs += net trace-events-subdirs += qapi trace-events-subdirs += qom trace-events-subdirs += scsi
@@ -189,7 +192,6 @@ trace-events-subdirs += target/ppc trace-events-subdirs += target/riscv trace-events-subdirs += target/s390x trace-events-subdirs += target/sparc -trace-events-subdirs += ui trace-events-subdirs += util trace-events-files = $(SRC_PATH)/trace-events $(trace-events-subdirs:%=$(SRC_PATH)/%/trace-events)
Signature · 1 line
2.20.1
PATCH v3 2/5 build: replace GENERATED_FILES by generated-files-y
In reply to Laurent VivierWhen possible use generated-files-$(FLAG) to disable some targets (like KEYCODEMAP_FILES).
--- Makefile | 36 +++++++++++++++++------------------- Makefile.target | 6 +++--- target/s390x/Makefile.objs | 2 +- tests/Makefile.include | 26 +++++++++++++------------- 4 files changed, 34 insertions(+), 36 deletions(-)
Makefile +17 -19
@@ -101,7 +101,7 @@ QEMU_PKGVERSION := $(if $(PKGVERSION),$(PKGVERSION),$(shell \ # Either "version (pkgversion)", or just "version" if pkgversion not set FULL_VERSION := $(if $(QEMU_PKGVERSION),$(VERSION) ($(QEMU_PKGVERSION)),$(VERSION)) -GENERATED_FILES = qemu-version.h config-host.h qemu-options.def +generated-files-y = qemu-version.h config-host.h qemu-options.def GENERATED_QAPI_FILES = qapi/qapi-builtin-types.h qapi/qapi-builtin-types.c GENERATED_QAPI_FILES += qapi/qapi-types.h qapi/qapi-types.c
@@ -121,20 +121,18 @@ GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-events-%.c) GENERATED_QAPI_FILES += qapi/qapi-introspect.c qapi/qapi-introspect.h GENERATED_QAPI_FILES += qapi/qapi-doc.texi -GENERATED_FILES += $(GENERATED_QAPI_FILES) +generated-files-y += $(GENERATED_QAPI_FILES) -GENERATED_FILES += trace/generated-tcg-tracers.h +generated-files-y += trace/generated-tcg-tracers.h -GENERATED_FILES += trace/generated-helpers-wrappers.h -GENERATED_FILES += trace/generated-helpers.h -GENERATED_FILES += trace/generated-helpers.c +generated-files-y += trace/generated-helpers-wrappers.h +generated-files-y += trace/generated-helpers.h +generated-files-y += trace/generated-helpers.c -ifdef CONFIG_TRACE_UST -GENERATED_FILES += trace-ust-all.h -GENERATED_FILES += trace-ust-all.c -endif +generated-files-$(CONFIG_TRACE_UST) += trace-ust-all.h +generated-files-$(CONFIG_TRACE_UST) += trace-ust-all.c -GENERATED_FILES += module_block.h +generated-files-y += module_block.h TRACE_HEADERS = trace-root.h $(trace-events-subdirs:%=%/trace.h) TRACE_SOURCES = trace-root.c $(trace-events-subdirs:%=%/trace.c)
@@ -147,10 +145,10 @@ ifdef CONFIG_TRACE_UST TRACE_HEADERS += trace-ust-root.h $(trace-events-subdirs:%=%/trace-ust.h) endif -GENERATED_FILES += $(TRACE_HEADERS) -GENERATED_FILES += $(TRACE_SOURCES) -GENERATED_FILES += $(BUILD_DIR)/trace-events-all -GENERATED_FILES += .git-submodule-status +generated-files-y += $(TRACE_HEADERS) +generated-files-y += $(TRACE_SOURCES) +generated-files-y += $(BUILD_DIR)/trace-events-all +generated-files-y += .git-submodule-status trace-group-name = $(shell dirname $1 | sed -e 's/[^a-zA-Z0-9]/_/g')
@@ -281,7 +279,7 @@ KEYCODEMAP_FILES = \ ui/input-keymap-osx-to-qcode.c \ $(NULL) -GENERATED_FILES += $(KEYCODEMAP_FILES) +generated-files-$(CONFIG_SOFTMMU) += $(KEYCODEMAP_FILES) ui/input-keymap-%.c: $(KEYCODEMAP_GEN) $(KEYCODEMAP_CSV) $(SRC_PATH)/ui/Makefile.objs $(call quiet-command,\
@@ -637,10 +635,10 @@ clean: rm -f fsdev/*.pod scsi/*.pod rm -f qemu-img-cmds.h rm -f ui/shader/*-vert.h ui/shader/*-frag.h - @# May not be present in GENERATED_FILES + @# May not be present in generated-files-y rm -f trace/generated-tracers-dtrace.dtrace* rm -f trace/generated-tracers-dtrace.h* - rm -f $(foreach f,$(GENERATED_FILES),$(f) $(f)-timestamp) + rm -f $(foreach f,$(generated-files-y),$(f) $(f)-timestamp) rm -f qapi-gen-timestamp rm -rf qga/qapi-generated for d in $(ALL_SUBDIRS); do \
@@ -1032,7 +1030,7 @@ endif # CONFIG_WIN # rebuilt before other object files ifneq ($(wildcard config-host.mak),) ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail)) -Makefile: $(GENERATED_FILES) +Makefile: $(generated-files-y) endif endif
Makefile.target +3 -3
@@ -166,7 +166,7 @@ else obj-y += hw/$(TARGET_BASE_ARCH)/ endif -GENERATED_FILES += hmp-commands.h hmp-commands-info.h +generated-files-y += hmp-commands.h hmp-commands-info.h endif # CONFIG_SOFTMMU
@@ -236,5 +236,5 @@ ifdef CONFIG_TRACE_SYSTEMTAP $(INSTALL_DATA) $(QEMU_PROG)-log.stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG)-log.stp" endif -GENERATED_FILES += config-target.h -Makefile: $(GENERATED_FILES) +generated-files-y += config-target.h +Makefile: $(generated-files-y)
target/s390x/Makefile.objs +1 -1
@@ -12,7 +12,7 @@ obj-$(call lnot,$(CONFIG_TCG)) += tcg-stub.o feat-src = $(SRC_PATH)/target/$(TARGET_BASE_ARCH)/ feat-dst = $(BUILD_DIR)/$(TARGET_DIR) ifneq ($(MAKECMDGOALS),clean) -GENERATED_FILES += $(feat-dst)gen-features.h +generated-files-y += $(feat-dst)gen-features.h endif $(feat-dst)gen-features.h: $(feat-dst)gen-features.h-timestamp
tests/Makefile.include +13 -13
@@ -468,19 +468,19 @@ qapi-schema += unknown-expr-key.json check-qapi-schema-y := $(addprefix tests/qapi-schema/, $(qapi-schema)) -GENERATED_FILES += tests/test-qapi-types.h \ - tests/include/test-qapi-types-sub-module.h \ - tests/test-qapi-types-sub-sub-module.h \ - tests/test-qapi-visit.h \ - tests/include/test-qapi-visit-sub-module.h \ - tests/test-qapi-visit-sub-sub-module.h \ - tests/test-qapi-commands.h \ - tests/include/test-qapi-commands-sub-module.h \ - tests/test-qapi-commands-sub-sub-module.h \ - tests/test-qapi-events.h \ - tests/include/test-qapi-events-sub-module.h \ - tests/test-qapi-events-sub-sub-module.h \ - tests/test-qapi-introspect.h +generated-files-y += tests/test-qapi-types.h +generated-files-y += tests/include/test-qapi-types-sub-module.h +generated-files-y += tests/test-qapi-types-sub-sub-module.h +generated-files-y += tests/test-qapi-visit.h +generated-files-y += tests/include/test-qapi-visit-sub-module.h +generated-files-y += tests/test-qapi-visit-sub-sub-module.h +generated-files-y += tests/test-qapi-commands.h +generated-files-y += tests/include/test-qapi-commands-sub-module.h +generated-files-y += tests/test-qapi-commands-sub-sub-module.h +generated-files-y += tests/test-qapi-events.h +generated-files-y += tests/include/test-qapi-events-sub-module.h +generated-files-y += tests/test-qapi-events-sub-sub-module.h +generated-files-y += tests/test-qapi-introspect.h test-obj-y = tests/check-qnum.o tests/check-qstring.o tests/check-qdict.o \ tests/check-qlist.o tests/check-qnull.o tests/check-qobject.o \
Signature · 1 line
2.20.1
PATCH v3 3/5 configure: qemu-ga is only needed with softmmu targets
In reply to Laurent VivierRemove it from the list of tools if --disable-system and --disable-tools are used as we don't need it for linux-user targets.
--- configure | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
configure +3 -1
@@ -6083,7 +6083,9 @@ fi # Probe for guest agent support/options if [ "$guest_agent" != "no" ]; then - if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then + if [ "$softmmu" = no -a "$want_tools" = no ] ; then + guest_agent=no + elif [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then tools="qemu-ga $tools" guest_agent=yes elif [ "$guest_agent" != yes ]; then
Signature · 1 line
2.20.1
Re: [Qemu-devel] [PATCH v3 3/5] configure: qemu-ga is only needed with softmmu targets
Quoted 17 lines · Laurent Vivier
Remove it from the list of tools if --disable-system and --disable-tools are used as we don't need it for linux-user targets.
Suggested-by Paolo Bonzini <[email protected]>[lv: I also disable it with disable-tools, not only with disable-system]Signed-off-by Laurent Vivier <[email protected]>--- configure | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)configure +0
-0
configure fi · line 6091
Quoted 10 lines
configure +3
-1@@ -6083,7 +6083,9 @@ fi # Probe for guest agent support/options if [ "$guest_agent" != "no" ]; then - if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then + if [ "$softmmu" = no -a "$want_tools" = no ] ; then + guest_agent=no + elif [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then tools="qemu-ga $tools" guest_agent=yes elif [ "$guest_agent" != yes ]; then
PATCH v3 4/5 build: chardev is only needed for softmmu targets
In reply to Laurent VivierMove the dependency from SUBDIR_RULES to SOFTMMU_SUBDIR_RULES
--- Makefile | 3 ++- Makefile.objs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
Makefile +2 -1
@@ -440,6 +440,7 @@ SOFTMMU_SUBDIR_RULES=$(filter %-softmmu,$(SUBDIR_RULES)) $(SOFTMMU_SUBDIR_RULES): $(authz-obj-y) $(SOFTMMU_SUBDIR_RULES): $(block-obj-y) +$(SOFTMMU_SUBDIR_RULES): $(chardev-obj-y) $(SOFTMMU_SUBDIR_RULES): $(crypto-obj-y) $(SOFTMMU_SUBDIR_RULES): $(io-obj-y) $(SOFTMMU_SUBDIR_RULES): config-all-devices.mak
@@ -475,7 +476,7 @@ subdir-capstone: .git-submodule-status subdir-slirp: .git-submodule-status $(call quiet-command,$(MAKE) -C $(SRC_PATH)/slirp BUILD_DIR="$(BUILD_DIR)/slirp" CC="$(CC)" AR="$(AR)" LD="$(LD)" RANLIB="$(RANLIB)" CFLAGS="$(QEMU_CFLAGS)") -$(SUBDIR_RULES): libqemuutil.a $(common-obj-y) $(chardev-obj-y) \ +$(SUBDIR_RULES): libqemuutil.a $(common-obj-y) \ $(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY)) ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
Makefile.objs +1 -1
@@ -129,9 +129,9 @@ trace-events-subdirs += accel/kvm trace-events-subdirs += accel/tcg trace-events-subdirs += authz trace-events-subdirs += block -trace-events-subdirs += chardev trace-events-subdirs += crypto ifeq ($(CONFIG_SOFTMMU),y) +trace-events-subdirs += chardev trace-events-subdirs += audio trace-events-subdirs += hw/9pfs trace-events-subdirs += hw/acpi
Signature · 1 line
2.20.1
PATCH v3 5/5 build: don't build hardware objects with linux-user
In reply to Laurent VivierSome objects are only needed for system emulation and tools. We can ignore them for the user mode case
Update tests to run accordingly: conditionally build some tests on CONFIG_BLOCK.
Some tests use components that are only built when softmmu or block tools are enabled, not for linux-user. So, if these components are not available, disable the tests.
--- Makefile | 4 ++ Makefile.objs | 14 ++++--- tests/Makefile.include | 90 +++++++++++++++++++++--------------------- 3 files changed, 58 insertions(+), 50 deletions(-)
Makefile +4 -0
@@ -87,6 +87,10 @@ endif include $(SRC_PATH)/rules.mak +# notempy and lor are defined in rules.mak +CONFIG_TOOLS := $(call notempty,$(TOOLS)) +CONFIG_BLOCK := $(call lor,$(CONFIG_SOFTMMU),$(CONFIG_TOOLS)) + # Create QEMU_PKGVERSION and FULL_VERSION strings # If PKGVERSION is set, use that; otherwise get version and -dirty status from git QEMU_PKGVERSION := $(if $(PKGVERSION),$(PKGVERSION),$(shell \
Makefile.objs +9 -5
@@ -127,9 +127,17 @@ rdmacm-mux-obj-y = contrib/rdmacm-mux/ trace-events-subdirs = trace-events-subdirs += accel/kvm trace-events-subdirs += accel/tcg +trace-events-subdirs += crypto +ifeq ($(CONFIG_USER_ONLY),y) +trace-events-subdirs += linux-user +endif +ifeq ($(CONFIG_BLOCK),y) trace-events-subdirs += authz trace-events-subdirs += block -trace-events-subdirs += crypto +trace-events-subdirs += io +trace-events-subdirs += nbd +trace-events-subdirs += scsi +endif ifeq ($(CONFIG_SOFTMMU),y) trace-events-subdirs += chardev trace-events-subdirs += audio
@@ -178,12 +186,8 @@ trace-events-subdirs += net trace-events-subdirs += ui endif trace-events-subdirs += hw/display -trace-events-subdirs += io -trace-events-subdirs += linux-user -trace-events-subdirs += nbd trace-events-subdirs += qapi trace-events-subdirs += qom -trace-events-subdirs += scsi trace-events-subdirs += target/arm trace-events-subdirs += target/hppa trace-events-subdirs += target/i386
tests/Makefile.include +45 -45
124 lines not on this page · raw message
Signature · 1 line
2.20.1
Paolo Bonzini
AppliedQuoted 25 lines · Laurent Vivier
This cleanup removes hardware objects from the list of files to be built for linux-user only targets.
It also builds traces files only when the related file is built.
Tested with all combinations of --{disable,enable}-{system,user,tools}
v3:
- don't move hw/display toCONFIG_BLOCKsection
v2:
- addCONFIG_TOOLSandCONFIG_BLOCK
- replaceGENERATED_FILESby generated-files-yand use generated-files-${CONFIG_TRACE_UST} and generated-files-${CONFIG_SOFTMMU}- move chardev-obj-y from
SUBDIR_RULEStoSOFTMMU_SUBDIR_RULES
- use $(CONFIG_BLOCK) in tests/Makefile.include
- disable qemu-ga with linux-user onlyLaurent Vivier (5):
trace: only include trace-event-subdirs when they are needed
build: replaceGENERATED_FILESby generated-files-y
configure: qemu-ga is only needed with softmmu targets
build: chardev is only needed for softmmu targets
build: don't build hardware objects with linux-user
Quoted 8 lines
Makefile | 43 +++++++------- Makefile.objs | 22 ++++--- Makefile.target | 6 +- configure | 4 +- target/s390x/Makefile.objs | 2 +- tests/Makefile.include | 116 ++++++++++++++++++------------------- 6 files changed, 102 insertions(+), 91 deletions(-)
Queued for 4.1, thanks.
Paolo
Quoted 35 lines · Paolo Bonzini
Quoted 25 lines · Laurent Vivier
This cleanup removes hardware objects from the list of files to be built for linux-user only targets.
It also builds traces files only when the related file is built.
Tested with all combinations of --{disable,enable}-{system,user,tools}
v3:
- don't move hw/display toCONFIG_BLOCKsection
v2:
- addCONFIG_TOOLSandCONFIG_BLOCK
- replaceGENERATED_FILESby generated-files-yand use generated-files-${CONFIG_TRACE_UST} and generated-files-${CONFIG_SOFTMMU}- move chardev-obj-y from
SUBDIR_RULEStoSOFTMMU_SUBDIR_RULES
- use $(CONFIG_BLOCK) in tests/Makefile.include
- disable qemu-ga with linux-user onlyLaurent Vivier (5):
trace: only include trace-event-subdirs when they are needed
build: replaceGENERATED_FILESby generated-files-y
configure: qemu-ga is only needed with softmmu targets
build: chardev is only needed for softmmu targets
build: don't build hardware objects with linux-userQuoted 8 lines
Makefile | 43 +++++++------- Makefile.objs | 22 ++++--- Makefile.target | 6 +- configure | 4 +- target/s390x/Makefile.objs | 2 +- tests/Makefile.include | 116 ++++++++++++++++++------------------- 6 files changed, 102 insertions(+), 91 deletions(-)
Quoted 1 line
Queued for 4.1, thanks.
Any news?
Thanks,
Laurent
Will send it out this week.
Paolo
Il lun 13 mag 2019, 16:18 Laurent Vivier <[email protected]> ha scritto:
Quoted 44 lines · Paolo Bonzini
Quoted 35 lines · Laurent Vivier
Quoted 25 lines
This cleanup removes hardware objects from the list of files to be built for linux-user only targets.
It also builds traces files only when the related file is built.
Tested with all combinations of --{disable,enable}-{system,user,tools}
v3:
- don't move hw/display toCONFIG_BLOCKsection
v2:
- addCONFIG_TOOLSandCONFIG_BLOCK
- replaceGENERATED_FILESby generated-files-yand use generated-files-${CONFIG_TRACE_UST} and generated-files-${CONFIG_SOFTMMU}- move chardev-obj-y from
SUBDIR_RULEStoSOFTMMU_SUBDIR_RULES
- use $(CONFIG_BLOCK) in tests/Makefile.include
- disable qemu-ga with linux-user onlyLaurent Vivier (5):
trace: only include trace-event-subdirs when they are needed
build: replaceGENERATED_FILESby generated-files-y
configure: qemu-ga is only needed with softmmu targets
build: chardev is only needed for softmmu targets
build: don't build hardware objects with linux-userQuoted 8 lines
Makefile | 43 +++++++------- Makefile.objs | 22 ++++--- Makefile.target | 6 +- configure | 4 +- target/s390x/Makefile.objs | 2 +- tests/Makefile.include | 116 ++++++++++++++++++------------------- 6 files changed, 102 insertions(+), 91 deletions(-)Quoted 1 line
Queued for 4.1, thanks.
Any news?
Thanks,
Laurent