Skip to content

Commit

Permalink
build: remove universal-obj-y
Browse files Browse the repository at this point in the history
All of universal-obj-y, user-obj-y (right now unused) and common-obj-y can
be unified into common-obj-y if we take care of defining CONFIG_SOFTMMU
and CONFIG_USER_ONLY in the toplevel makefile.  This is similar to how
we define symbols for hardware components.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
  • Loading branch information
bonzini authored and blueswirl committed Jan 26, 2013
1 parent 737f351 commit 0008234
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 34 deletions.
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ defconfig:

-include config-all-devices.mak
-include config-all-disas.mak
CONFIG_SOFTMMU := $(if $(filter %-softmmu,$(TARGET_DIRS)),y)
CONFIG_USER_ONLY := $(if $(filter %-user,$(TARGET_DIRS)),y)

ifneq ($(wildcard config-host.mak),)
include $(SRC_PATH)/Makefile.objs
Expand Down Expand Up @@ -133,11 +135,7 @@ pixman/Makefile: $(SRC_PATH)/pixman/configure
$(SRC_PATH)/pixman/configure:
(cd $(SRC_PATH)/pixman; autoreconf -v --install)

$(SUBDIR_RULES): libqemuutil.a libqemustub.a

$(filter %-softmmu,$(SUBDIR_RULES)): $(universal-obj-y) $(common-obj-y) $(extra-obj-y)

$(filter %-user,$(SUBDIR_RULES)): $(universal-obj-y) $(user-obj-y)
$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y) $(extra-obj-y)

ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
romsubdir-%:
Expand Down
14 changes: 7 additions & 7 deletions Makefile.objs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ libcacard-y += libcacard/card_7816.o
# suppress *all* target specific code in case of system emulation, i.e. a
# single QEMU executable should support all CPUs and machines.

ifeq ($(CONFIG_SOFTMMU),y)
common-obj-y = $(block-obj-y) blockdev.o blockdev-nbd.o block/
common-obj-y += net/
common-obj-y += readline.o
Expand Down Expand Up @@ -89,15 +90,15 @@ common-obj-$(CONFIG_SMARTCARD_NSS) += $(libcacard-y)

common-obj-y += qmp-marshal.o qapi-visit.o qapi-types.o
common-obj-y += qmp.o hmp.o
endif

#######################################################################
# Target-independent parts used in system and user emulation
universal-obj-y =
universal-obj-y += qemu-log.o
universal-obj-y += tcg-runtime.o
universal-obj-y += hw/
universal-obj-y += qom/
universal-obj-y += disas/
common-obj-y += qemu-log.o
common-obj-y += tcg-runtime.o
common-obj-y += hw/
common-obj-y += qom/
common-obj-y += disas/

######################################################################
# guest agent
Expand All @@ -118,6 +119,5 @@ nested-vars += \
qga-obj-y \
block-obj-y \
common-obj-y \
universal-obj-y \
extra-obj-y
dummy := $(call unnest-vars)
3 changes: 1 addition & 2 deletions Makefile.target
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ nested-vars += obj-y
include $(SRC_PATH)/Makefile.objs

all-obj-y = $(obj-y)
all-obj-y += $(addprefix ../, $(universal-obj-y))
all-obj-$(CONFIG_SOFTMMU) += $(addprefix ../, $(common-obj-y))
all-obj-y += $(addprefix ../, $(common-obj-y))

ifdef QEMU_PROGW
# The linker builds a windows executable. Make also a console executable.
Expand Down
30 changes: 15 additions & 15 deletions disas/Makefile.objs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
universal-obj-$(CONFIG_ALPHA_DIS) += alpha.o
universal-obj-$(CONFIG_ARM_DIS) += arm.o
universal-obj-$(CONFIG_CRIS_DIS) += cris.o
universal-obj-$(CONFIG_HPPA_DIS) += hppa.o
universal-obj-$(CONFIG_I386_DIS) += i386.o
universal-obj-$(CONFIG_IA64_DIS) += ia64.o
universal-obj-$(CONFIG_M68K_DIS) += m68k.o
universal-obj-$(CONFIG_MICROBLAZE_DIS) += microblaze.o
universal-obj-$(CONFIG_MIPS_DIS) += mips.o
universal-obj-$(CONFIG_PPC_DIS) += ppc.o
universal-obj-$(CONFIG_S390_DIS) += s390.o
universal-obj-$(CONFIG_SH4_DIS) += sh4.o
universal-obj-$(CONFIG_SPARC_DIS) += sparc.o
universal-obj-$(CONFIG_LM32_DIS) += lm32.o
common-obj-$(CONFIG_ALPHA_DIS) += alpha.o
common-obj-$(CONFIG_ARM_DIS) += arm.o
common-obj-$(CONFIG_CRIS_DIS) += cris.o
common-obj-$(CONFIG_HPPA_DIS) += hppa.o
common-obj-$(CONFIG_I386_DIS) += i386.o
common-obj-$(CONFIG_IA64_DIS) += ia64.o
common-obj-$(CONFIG_M68K_DIS) += m68k.o
common-obj-$(CONFIG_MICROBLAZE_DIS) += microblaze.o
common-obj-$(CONFIG_MIPS_DIS) += mips.o
common-obj-$(CONFIG_PPC_DIS) += ppc.o
common-obj-$(CONFIG_S390_DIS) += s390.o
common-obj-$(CONFIG_SH4_DIS) += sh4.o
common-obj-$(CONFIG_SPARC_DIS) += sparc.o
common-obj-$(CONFIG_LM32_DIS) += lm32.o

# TODO: As long as the TCG interpreter and its generated code depend
# on the QEMU target, we cannot compile the disassembler here.
#universal-obj-$(CONFIG_TCI_DIS) += tci.o
#common-obj-$(CONFIG_TCI_DIS) += tci.o
8 changes: 5 additions & 3 deletions hw/Makefile.objs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# core qdev-related obj files, also used by *-user:
universal-obj-y += qdev.o qdev-properties.o
common-obj-y += qdev.o qdev-properties.o
# irq.o needed for qdev GPIO handling:
universal-obj-y += irq.o
common-obj-y += irq.o

common-obj-y = usb/ ide/ pci/
ifeq ($(CONFIG_SOFTMMU),y)
common-obj-y += usb/ ide/ pci/
common-obj-y += loader.o
common-obj-$(CONFIG_VIRTIO) += virtio-console.o
common-obj-$(CONFIG_VIRTIO) += virtio-rng.o
Expand Down Expand Up @@ -217,3 +218,4 @@ obj-$(CONFIG_LINUX) += vfio_pci.o
endif

$(obj)/baum.o: QEMU_CFLAGS += $(SDL_CFLAGS)
endif
4 changes: 2 additions & 2 deletions qom/Makefile.objs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
universal-obj-y = object.o container.o qom-qobject.o
universal-obj-y += cpu.o
common-obj-y = object.o container.o qom-qobject.o
common-obj-y += cpu.o

0 comments on commit 0008234

Please sign in to comment.