Skip to contentSkip to conversation

More Build System cleanups

PATCH In review [email protected] 3 participants 17 messages Jul 1, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

cover More Build System cleanups

From: Juan Quintela <[email protected]>

Hi

More cleanups, 1st two are two compile fixes for my previous series (the XEN one already sent to the list.

Generate TARGET_BASE_ARCH and TARGET_CPU on configure, and then we don't complicate Makefile.target having to regerate it.

Switch all objects that depends of one traget to obj-$(TARGET_BASE_ARCH)-y variable, that way we would be able to share Makefiles at some point.

Once there, fix kvm, xen and kqemu to not being duplicated for each arch that support i.t

Comments?

Later, Juan "compiling for qemu ifdef removal prize"

Juan Quintela (13):
fix XEN Build
fix sparc not solaris build
Remove duplicated definition
use block-nested-y for files inside block/
use nwfpe-obj-y for consistence
Remove unused Makefile variable
already defined several lines before in block-obj-y configure already knows what TARGET_BASE_ARCH we need, no need to put

TARGET_ARCH2 is already known at configure time and it is called chang ifdefs by obj-$(CONFIG_TARGET_ARCH)
configure xen in a single place
configure kvm in a single place
configure kqemu in a single place

 Makefile        |   22 +++--
 Makefile.target |  251 +++++++++++++++++++++++--------------------------------
 configure       |   90 +++++++++-----------
 3 files changed, 158 insertions(+), 205 deletions(-)
#1 lore raw

PATCH 1/13 fix XEN Build

From: Juan Quintela <[email protected]>

I miss s/yes/y/ in one place

---
 Makefile.target |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile.target +1 -1
index a593503..5ca90af 100644
@@ -543,7 +543,7 @@ endif
 
 # xen backend driver support
 obj-$(CONFIG_XEN) += xen_machine_pv.o xen_domainbuild.o
-ifeq ($(CONFIG_XEN), yes)
+ifeq ($(CONFIG_XEN), y)
   LIBS += $(XEN_LIBS)
 endif
 
Signature · 1 line
1.6.2.2
#2 lore raw

PATCH 2/13 fix sparc not solaris build

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile.target |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile.target +1 -1
index 5ca90af..6aeea63 100644
@@ -89,7 +89,7 @@ translate.o: CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-unit-at-a-tim
 endif
 
 ifeq ($(ARCH),sparc)
-  ifneq ($(CONFIG_SOLARIS),yes)
+  ifneq ($(CONFIG_SOLARIS),y)
     HELPER_CFLAGS+=-ffixed-i0
   endif
 endif
Signature · 1 line
1.6.2.2
#3 lore raw

PATCH 3/13 Remove duplicated definition

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile.target |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
Makefile.target +0 -2
index 6aeea63..f571ff5 100644
@@ -686,8 +686,6 @@ ifdef CONFIG_SLIRP
 CPPFLAGS+=-I$(SRC_PATH)/slirp
 endif
 
-LIBS+=$(PTHREADLIBS)
-LIBS+=$(CLOCKLIBS)
 # specific flags are needed for non soft mmu emulator
 ifdef CONFIG_STATIC
 LDFLAGS+=-static
Signature · 1 line
1.6.2.2
#4 lore raw

PATCH 4/13 use block-nested-y for files inside block/

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)
Makefile +11 -9
index 2a4b3f3..e03c690 100644
@@ -67,23 +67,25 @@ recurse-all: $(SUBDIR_RULES)
 # block-obj-y is code used by both qemu system emulation and qemu-img
 
 block-obj-y = cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o
-block-obj-y += block/cow.o block/qcow.o aes.o block/vmdk.o block/cloop.o
-block-obj-y += block/dmg.o block/bochs.o block/vpc.o block/vvfat.o
-block-obj-y += block/qcow2.o block/qcow2-refcount.o block/qcow2-cluster.o
-block-obj-y += block/qcow2-snapshot.o
-block-obj-y += block/parallels.o block/nbd.o
-block-obj-y += nbd.o block.o aio.o
+block-obj-y += nbd.o block.o aio.o aes.o
+
+block-nested-y += cow.o qcow.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o
+block-nested-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o
+block-nested-y += parallels.o nbd.o
+
 
 ifdef CONFIG_WIN32
-block-obj-y += block/raw-win32.o
+block-nested-y += raw-win32.o
 else
 ifdef CONFIG_AIO
 block-obj-y += posix-aio-compat.o
 endif
-block-obj-y += block/raw-posix.o
+block-nested-y += raw-posix.o
 endif
 
-block-obj-$(CONFIG_CURL) += block/curl.o
+block-nested-$(CONFIG_CURL) += curl.o
+
+block-obj-y +=  $(addprefix block/, $(block-nested-y))
 
 ######################################################################
 # libqemu_common.a: Target independent part of system emulation. The
Signature · 1 line
1.6.2.2
#6 lore raw

PATCH 6/13 Remove unused Makefile variable

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile.target |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile.target +1 -1
index 60754dc..c33f371 100644
@@ -221,7 +221,7 @@ tcg/tcg.o: cpu.h
 
 # HELPER_CFLAGS is used for all the code compiled with static register
 # variables
-op_helper.o: CFLAGS += $(HELPER_CFLAGS) $(I386_CFLAGS)
+op_helper.o: CFLAGS += $(HELPER_CFLAGS)
 
 cpu-exec.o: CFLAGS += $(HELPER_CFLAGS)
 
Signature · 1 line
1.6.2.2
#5 lore raw

PATCH 5/13 use nwfpe-obj-y for consistence

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile.target |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
Makefile.target +4 -3
index f571ff5..60754dc 100644
@@ -335,9 +335,10 @@ ifeq ($(TARGET_ARCH), i386)
 obj-y += vm86.o
 endif
 ifeq ($(TARGET_ARCH), arm)
-obj-y += nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
-nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
- nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
+nwfpe-obj-y := fpa11.o fpa11_cpdo.o fpa11_cpdt.o fpa11_cprt.o fpopcode.o
+nwfpe-obj-y += single_cpdo.o double_cpdo.o extended_cpdo.o
+obj-y +=  $(addprefix nwfpe/, $(nwfpe-obj-y))
+obj-y += arm-semi.o
 endif
 ifeq ($(TARGET_ARCH), m68k)
 obj-y += m68k-sim.o m68k-semi.o
Signature · 1 line
1.6.2.2
#7 lore raw

PATCH 7/13 already defined several lines before in block-obj-y

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile +1 -1
index e03c690..572e241 100644
@@ -108,7 +108,7 @@ obj-y += sd.o ssi-sd.o
 obj-y += bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o usb-bt.o
 obj-y += bt-hci-csr.o
 obj-y += buffered_file.o migration.o migration-tcp.o net.o qemu-sockets.o
-obj-y += qemu-char.o aio.o net-checksum.o savevm.o cache-utils.o
+obj-y += qemu-char.o aio.o net-checksum.o savevm.o
 obj-y += msmouse.o ps2.o
 obj-y += qdev.o ssi.o
 
Signature · 1 line
1.6.2.2
#8 lore raw

PATCH 8/13 configure already knows what TARGET_BASE_ARCH we need, no need to put the logic in Makefile.target

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile.target |   22 ++--------------------
 configure       |    8 ++++++++
 2 files changed, 10 insertions(+), 20 deletions(-)
Makefile.target +2 -20
index c33f371..4622561 100644
@@ -1,28 +1,10 @@
 include config.mak
 include $(SRC_PATH)/rules.mak
 
+ifndef TARGET_BASE_ARCH
 TARGET_BASE_ARCH:=$(TARGET_ARCH)
-ifeq ($(TARGET_ARCH), x86_64)
-TARGET_BASE_ARCH:=i386
-endif
-ifeq ($(TARGET_ARCH), mipsn32)
-TARGET_BASE_ARCH:=mips
-endif
-ifeq ($(TARGET_ARCH), mips64)
-TARGET_BASE_ARCH:=mips
-endif
-ifeq ($(TARGET_ARCH), ppc64)
-TARGET_BASE_ARCH:=ppc
-endif
-ifeq ($(TARGET_ARCH), ppc64h)
-TARGET_BASE_ARCH:=ppc
-endif
-ifeq ($(TARGET_ARCH), ppcemb)
-TARGET_BASE_ARCH:=ppc
-endif
-ifeq ($(TARGET_ARCH), sparc64)
-TARGET_BASE_ARCH:=sparc
 endif
+
 TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
 VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
 CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H
configure +8 -0
index eb9d73a..a9ce35f 100755
@@ -2000,6 +2000,7 @@ case "$target_cpu" in
   ;;
   x86_64)
     echo "TARGET_ARCH=x86_64" >> $config_mak
+    echo "TARGET_BASE_ARCH=i386" >> $config_mak
     echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
     echo "#define TARGET_I386 1" >> $config_h
     echo "#define TARGET_X86_64 1" >> $config_h
@@ -2067,6 +2068,7 @@ case "$target_cpu" in
   ;;
   mipsn32|mipsn32el)
     echo "TARGET_ARCH=mipsn32" >> $config_mak
+    echo "TARGET_BASE_ARCH=mips" >> $config_mak
     echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
     echo "#define TARGET_MIPS 1" >> $config_h
     echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
@@ -2074,6 +2076,7 @@ case "$target_cpu" in
   ;;
   mips64|mips64el)
     echo "TARGET_ARCH=mips64" >> $config_mak
+    echo "TARGET_BASE_ARCH=mips" >> $config_mak
     echo "#define TARGET_ARCH \"mips64\"" >> $config_h
     echo "#define TARGET_MIPS 1" >> $config_h
     echo "#define TARGET_MIPS64 1" >> $config_h
@@ -2089,6 +2092,7 @@ case "$target_cpu" in
   ;;
   ppcemb)
     echo "TARGET_ARCH=ppcemb" >> $config_mak
+    echo "TARGET_BASE_ARCH=ppc" >> $config_mak
     echo "TARGET_ABI_DIR=ppc" >> $config_mak
     echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
     echo "#define TARGET_PPC 1" >> $config_h
@@ -2103,6 +2107,7 @@ case "$target_cpu" in
   ;;
   ppc64)
     echo "TARGET_ARCH=ppc64" >> $config_mak
+    echo "TARGET_BASE_ARCH=ppc" >> $config_mak
     echo "TARGET_ABI_DIR=ppc" >> $config_mak
     echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
     echo "#define TARGET_PPC 1" >> $config_h
@@ -2112,6 +2117,7 @@ case "$target_cpu" in
   ;;
   ppc64abi32)
     echo "TARGET_ARCH=ppc64" >> $config_mak
+    echo "TARGET_BASE_ARCH=ppc" >> $config_mak
     echo "TARGET_ABI_DIR=ppc" >> $config_mak
     echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
     echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
@@ -2137,6 +2143,7 @@ case "$target_cpu" in
   ;;
   sparc64)
     echo "TARGET_ARCH=sparc64" >> $config_mak
+    echo "TARGET_BASE_ARCH=sparc" >> $config_mak
     echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
     echo "#define TARGET_SPARC 1" >> $config_h
     echo "#define TARGET_SPARC64 1" >> $config_h
@@ -2145,6 +2152,7 @@ case "$target_cpu" in
   ;;
   sparc32plus)
     echo "TARGET_ARCH=sparc64" >> $config_mak
+    echo "TARGET_BASE_ARCH=sparc" >> $config_mak
     echo "TARGET_ABI_DIR=sparc" >> $config_mak
     echo "TARGET_ARCH2=sparc32plus" >> $config_mak
     echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
Signature · 1 line
1.6.2.2
#9 lore raw

PATCH 9/13 TARGET_ARCH2 is already known at configure time and it is called target_cpu Remove re-construction in Makefile.target

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile.target |   33 ++++-----------------------------
 configure       |    9 +++++++--
 2 files changed, 11 insertions(+), 31 deletions(-)
Makefile.target +4 -29
index 4622561..81d0c54 100644
@@ -11,44 +11,19 @@ CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H
 #CFLAGS+=-Werror
 LIBS=
 # user emulator name
-ifndef TARGET_ARCH2
-TARGET_ARCH2=$(TARGET_ARCH)
-endif
-ifeq ($(TARGET_ARCH),arm)
-  ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
-    TARGET_ARCH2=armeb
-  endif
-endif
-ifeq ($(TARGET_ARCH),sh4)
-  ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
-    TARGET_ARCH2=sh4eb
-  endif
-endif
-ifeq ($(TARGET_ARCH),mips)
-  ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
-    TARGET_ARCH2=mipsel
-  endif
-endif
-ifeq ($(TARGET_ARCH),mipsn32)
-  ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
-    TARGET_ARCH2=mipsn32el
-  endif
-endif
-ifeq ($(TARGET_ARCH),mips64)
-  ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
-    TARGET_ARCH2=mips64el
-  endif
+ifndef TARGET_CPU
+TARGET_CPU=$(TARGET_ARCH)
 endif
 
 ifdef CONFIG_USER_ONLY
 # user emulator name
-QEMU_PROG=qemu-$(TARGET_ARCH2)
+QEMU_PROG=qemu-$(TARGET_CPU)
 else
 # system emulator name
 ifeq ($(TARGET_ARCH), i386)
 QEMU_PROG=qemu$(EXESUF)
 else
-QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
+QEMU_PROG=qemu-system-$(TARGET_CPU)$(EXESUF)
 endif
 endif
 
configure +7 -2
index a9ce35f..5b35b69 100755
@@ -2029,6 +2029,7 @@ case "$target_cpu" in
   ;;
   arm|armeb)
     echo "TARGET_ARCH=arm" >> $config_mak
+    echo "TARGET_CPU=$target_cpu" >> $config_mak
     echo "#define TARGET_ARCH \"arm\"" >> $config_h
     echo "#define TARGET_ARM 1" >> $config_h
     bflt="yes"
@@ -2061,6 +2062,7 @@ case "$target_cpu" in
   ;;
  mips|mipsel)
     echo "TARGET_ARCH=mips" >> $config_mak
+    echo "TARGET_CPU=$target_cpu" >> $config_mak
     echo "#define TARGET_ARCH \"mips\"" >> $config_h
     echo "#define TARGET_MIPS 1" >> $config_h
     echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
@@ -2068,6 +2070,7 @@ case "$target_cpu" in
   ;;
   mipsn32|mipsn32el)
     echo "TARGET_ARCH=mipsn32" >> $config_mak
+    echo "TARGET_CPU=$target_cpu" >> $config_mak
     echo "TARGET_BASE_ARCH=mips" >> $config_mak
     echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
     echo "#define TARGET_MIPS 1" >> $config_h
@@ -2076,6 +2079,7 @@ case "$target_cpu" in
   ;;
   mips64|mips64el)
     echo "TARGET_ARCH=mips64" >> $config_mak
+    echo "TARGET_CPU=$target_cpu" >> $config_mak
     echo "TARGET_BASE_ARCH=mips" >> $config_mak
     echo "#define TARGET_ARCH \"mips64\"" >> $config_h
     echo "#define TARGET_MIPS 1" >> $config_h
@@ -2119,7 +2123,7 @@ case "$target_cpu" in
     echo "TARGET_ARCH=ppc64" >> $config_mak
     echo "TARGET_BASE_ARCH=ppc" >> $config_mak
     echo "TARGET_ABI_DIR=ppc" >> $config_mak
-    echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
+    echo "TARGET_CPU=ppc64abi32" >> $config_mak
     echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
     echo "#define TARGET_PPC 1" >> $config_h
     echo "#define TARGET_PPC64 1" >> $config_h
@@ -2129,6 +2133,7 @@ case "$target_cpu" in
   ;;
   sh4|sh4eb)
     echo "TARGET_ARCH=sh4" >> $config_mak
+    echo "TARGET_CPU=$target_cpu" >> $config_mak
     echo "#define TARGET_ARCH \"sh4\"" >> $config_h
     echo "#define TARGET_SH4 1" >> $config_h
     bflt="yes"
@@ -2154,7 +2159,7 @@ case "$target_cpu" in
     echo "TARGET_ARCH=sparc64" >> $config_mak
     echo "TARGET_BASE_ARCH=sparc" >> $config_mak
     echo "TARGET_ABI_DIR=sparc" >> $config_mak
-    echo "TARGET_ARCH2=sparc32plus" >> $config_mak
+    echo "TARGET_CPU=sparc32plus" >> $config_mak
     echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
     echo "#define TARGET_SPARC 1" >> $config_h
     echo "#define TARGET_SPARC64 1" >> $config_h
Signature · 1 line
1.6.2.2
#13 lore raw

PATCH 10/13 chang ifdefs by obj-

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 Makefile.target |  181 ++++++++++++++++++++++++++++---------------------------
 1 files changed, 93 insertions(+), 88 deletions(-)
Makefile.target +93 -88
index 81d0c54..cfb0bab 100644
@@ -518,122 +518,127 @@ obj-y += e1000.o
 # Generic watchdog support and some watchdog devices
 obj-y += wdt_ib700.o wdt_i6300esb.o
 
-ifeq ($(TARGET_BASE_ARCH), i386)
 # Hardware support
-obj-y += ide.o pckbd.o vga.o $(sound-obj-y) dma.o
-obj-y += fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
-obj-y += cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o
-obj-y += usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
-obj-y += device-hotplug.o pci-hotplug.o smbios.o
+obj-i386-y = ide.o pckbd.o vga.o $(sound-obj-y) dma.o
+obj-i386-y += fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
+obj-i386-y += cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o
+obj-i386-y += usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
+obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o
+
+ifeq ($(TARGET_BASE_ARCH), i386)
 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
 endif
-ifeq ($(TARGET_BASE_ARCH), ppc)
-CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
+
 # shared objects
-obj-y += ppc.o ide.o vga.o $(sound-obj-y) dma.o openpic.o
+obj-ppc-y = ppc.o ide.o vga.o $(sound-obj-y) dma.o openpic.o
 # PREP target
-obj-y += pckbd.o serial.o i8259.o i8254.o fdc.o mc146818rtc.o
-obj-y += prep_pci.o ppc_prep.o
+obj-ppc-y += pckbd.o serial.o i8259.o i8254.o fdc.o mc146818rtc.o
+obj-ppc-y += prep_pci.o ppc_prep.o
 # Mac shared devices
-obj-y += macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
+obj-ppc-y += macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
 # OldWorld PowerMac
-obj-y += heathrow_pic.o grackle_pci.o ppc_oldworld.o
+obj-ppc-y += heathrow_pic.o grackle_pci.o ppc_oldworld.o
 # NewWorld PowerMac
-obj-y += unin_pci.o ppc_newworld.o
+obj-ppc-y += unin_pci.o ppc_newworld.o
 # PowerPC 4xx boards
-obj-y += pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
-obj-y += ppc440.o ppc440_bamboo.o
+obj-ppc-y += pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
+obj-ppc-y += ppc440.o ppc440_bamboo.o
 # PowerPC E500 boards
-obj-y += ppce500_pci.o ppce500_mpc8544ds.o
+obj-ppc-y += ppce500_pci.o ppce500_mpc8544ds.o
+obj-ppc-$(CONFIG_KVM) += kvm_ppc.o
+
+ifeq ($(TARGET_BASE_ARCH), ppc)
+CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
+endif
+
 ifdef FDT_LIBS
-obj-y += device_tree.o
+obj-ppc-y += device_tree.o
 LIBS+= $(FDT_LIBS)
 endif
-obj-$(CONFIG_KVM) += kvm_ppc.o
-endif
+
+obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
+obj-mips-y += mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
+obj-mips-y += g364fb.o jazz_led.o dp8393x.o
+obj-mips-y += ide.o gt64xxx.o pckbd.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
+obj-mips-y += piix_pci.o parallel.o cirrus_vga.o pcspk.o $(sound-obj-y)
+obj-mips-y += mipsnet.o
+obj-mips-y += pflash_cfi01.o
+obj-mips-y += vmware_vga.o
+
 ifeq ($(TARGET_BASE_ARCH), mips)
-obj-y += mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
-obj-y += mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
-obj-y += g364fb.o jazz_led.o dp8393x.o
-obj-y += ide.o gt64xxx.o pckbd.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
-obj-y += piix_pci.o parallel.o cirrus_vga.o pcspk.o $(sound-obj-y)
-obj-y += mipsnet.o
-obj-y += pflash_cfi01.o
-obj-y += vmware_vga.o
 CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
 endif
-ifeq ($(TARGET_BASE_ARCH), microblaze)
-obj-y += petalogix_s3adsp1800_mmu.o
 
-obj-y += microblaze_pic_cpu.o
-obj-y += xilinx_intc.o
-obj-y += xilinx_timer.o
-obj-y += xilinx_uartlite.o
-obj-y += xilinx_ethlite.o
+obj-microblaze-y = petalogix_s3adsp1800_mmu.o
+
+obj-microblaze-y += microblaze_pic_cpu.o
+obj-microblaze-y += xilinx_intc.o
+obj-microblaze-y += xilinx_timer.o
+obj-microblaze-y += xilinx_uartlite.o
+obj-microblaze-y += xilinx_ethlite.o
+
+obj-microblaze-y += pflash_cfi02.o
 
-obj-y += pflash_cfi02.o
 ifdef FDT_LIBS
-obj-y += device_tree.o
+obj-microblaze-y += device_tree.o
 LIBS+= $(FDT_LIBS)
 endif
-endif
-ifeq ($(TARGET_BASE_ARCH), cris)
+
 # Boards
-obj-y += cris_pic_cpu.o etraxfs.o axis_dev88.o
+obj-cris-y = cris_pic_cpu.o etraxfs.o axis_dev88.o
 
 # IO blocks
-obj-y += etraxfs_dma.o
-obj-y += etraxfs_pic.o
-obj-y += etraxfs_eth.o
-obj-y += etraxfs_timer.o
-obj-y += etraxfs_ser.o
+obj-cris-y += etraxfs_dma.o
+obj-cris-y += etraxfs_pic.o
+obj-cris-y += etraxfs_eth.o
+obj-cris-y += etraxfs_timer.o
+obj-cris-y += etraxfs_ser.o
+
+obj-cris-y += pflash_cfi02.o
 
-obj-y += pflash_cfi02.o
-endif
-ifeq ($(TARGET_BASE_ARCH), sparc)
 ifeq ($(TARGET_ARCH), sparc64)
-obj-y += sun4u.o ide.o pckbd.o vga.o apb_pci.o
-obj-y += fdc.o mc146818rtc.o serial.o
-obj-y += cirrus_vga.o parallel.o
+obj-sparc-y = sun4u.o ide.o pckbd.o vga.o apb_pci.o
+obj-sparc-y += fdc.o mc146818rtc.o serial.o
+obj-sparc-y += cirrus_vga.o parallel.o
 else
-obj-y += sun4m.o tcx.o iommu.o slavio_intctl.o
-obj-y += slavio_timer.o slavio_misc.o fdc.o sparc32_dma.o
-obj-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o
-endif
-endif
+obj-sparc-y = sun4m.o tcx.o iommu.o slavio_intctl.o
+obj-sparc-y += slavio_timer.o slavio_misc.o fdc.o sparc32_dma.o
+obj-sparc-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o
+endif
+
+obj-arm-y = integratorcp.o versatilepb.o smc91c111.o arm_pic.o arm_timer.o
+obj-arm-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
+obj-arm-y += versatile_pci.o
+obj-arm-y += realview_gic.o realview.o arm_sysctl.o mpcore.o
+obj-arm-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
+obj-arm-y += pl061.o
+obj-arm-y += arm-semi.o
+obj-arm-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
+obj-arm-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
+obj-arm-y += pflash_cfi01.o gumstix.o
+obj-arm-y += zaurus.o ide.o serial.o spitz.o tosa.o tc6393xb.o
+obj-arm-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
+obj-arm-y += omap2.o omap_dss.o soc_dma.o
+obj-arm-y += omap_sx1.o palm.o tsc210x.o
+obj-arm-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
+obj-arm-y += mst_fpga.o mainstone.o
+obj-arm-y += musicpal.o pflash_cfi02.o
+obj-arm-y += framebuffer.o
+obj-arm-y += syborg.o syborg_fb.o syborg_interrupt.o syborg_keyboard.o
+obj-arm-y += syborg_serial.o syborg_timer.o syborg_pointer.o syborg_rtc.o
+obj-arm-y += syborg_virtio.o
+
 ifeq ($(TARGET_BASE_ARCH), arm)
-obj-y += integratorcp.o versatilepb.o smc91c111.o arm_pic.o arm_timer.o
-obj-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
-obj-y += versatile_pci.o
-obj-y += realview_gic.o realview.o arm_sysctl.o mpcore.o
-obj-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
-obj-y += pl061.o
-obj-y += arm-semi.o
-obj-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
-obj-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
-obj-y += pflash_cfi01.o gumstix.o
-obj-y += zaurus.o ide.o serial.o spitz.o tosa.o tc6393xb.o
-obj-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
-obj-y += omap2.o omap_dss.o soc_dma.o
-obj-y += omap_sx1.o palm.o tsc210x.o
-obj-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
-obj-y += mst_fpga.o mainstone.o
-obj-y += musicpal.o pflash_cfi02.o
-obj-y += framebuffer.o
-obj-y += syborg.o syborg_fb.o syborg_interrupt.o syborg_keyboard.o
-obj-y += syborg_serial.o syborg_timer.o syborg_pointer.o syborg_rtc.o
-obj-y += syborg_virtio.o
 CPPFLAGS += -DHAS_AUDIO
 endif
-ifeq ($(TARGET_BASE_ARCH), sh4)
-obj-y += shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
-obj-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o
-obj-y += ide.o
-endif
-ifeq ($(TARGET_BASE_ARCH), m68k)
-obj-y += an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
-obj-y += m68k-semi.o dummy_m68k.o
-endif
+
+obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
+obj-sh4-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o
+obj-sh4-y += ide.o
+
+obj-m68k-y = an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
+obj-m68k-y += m68k-semi.o dummy_m68k.o
+
 ifdef CONFIG_COCOA
 COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
 ifdef CONFIG_COREAUDIO
@@ -684,8 +689,8 @@ monitor.o: qemu-monitor.h
 
 $(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) $(CURL_LIBS)
 $(QEMU_PROG): ARLIBS=../libqemu_common.a libqemu.a $(HWLIB)
-$(QEMU_PROG): $(obj-y) ../libqemu_common.a libqemu.a $(HWLIB)
-	$(call LINK,$(obj-y))
+$(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y) ../libqemu_common.a libqemu.a $(HWLIB)
+	$(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y))
 
 endif # !CONFIG_USER_ONLY
 
Signature · 1 line
1.6.2.2
#14 lore raw

PATCH 11/13 configure xen in a single place

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 configure |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)
configure +7 -10
index 5b35b69..56e4d38 100755
@@ -1991,11 +1991,6 @@ case "$target_cpu" in
       echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
       echo "#define CONFIG_KVM 1" >> $config_h
     fi
-    if test "$xen" = "yes" -a "$target_softmmu" = "yes";
-    then
-      echo "CONFIG_XEN=y" >> $config_mak
-      echo "#define CONFIG_XEN 1" >> $config_h
-    fi
     target_phys_bits=32
   ;;
   x86_64)
@@ -2014,11 +2009,6 @@ case "$target_cpu" in
       echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
       echo "#define CONFIG_KVM 1" >> $config_h
     fi
-    if test "$xen" = "yes" -a "$target_softmmu" = "yes"
-    then
-      echo "CONFIG_XEN=y" >> $config_mak
-      echo "#define CONFIG_XEN 1" >> $config_h
-    fi
     target_phys_bits=64
   ;;
   alpha)
@@ -2174,6 +2164,13 @@ esac
 if [ $target_phys_bits -lt $hostlongbits ] ; then
   target_phys_bits=$hostlongbits
 fi
+case "$target_cpu" in
+  i386|x86_64)
+    if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then
+      echo "CONFIG_XEN=y" >> $config_mak
+      echo "#define CONFIG_XEN 1" >> $config_h
+    fi
+esac
 echo "HWLIB=../libhw$target_phys_bits/libqemuhw$target_phys_bits.a" >> $config_mak
 echo "#define TARGET_PHYS_ADDR_BITS $target_phys_bits" >> $config_h
 echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak
Signature · 1 line
1.6.2.2
#15 lore raw

PATCH 12/13 configure kvm in a single place

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 configure |   41 +++++++++++++----------------------------
 1 files changed, 13 insertions(+), 28 deletions(-)
configure +13 -28
index 56e4d38..1fe01af 100755
@@ -1962,19 +1962,6 @@ target_nptl="no"
 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
 gdb_xml_files=""
-target_kvm="$kvm"
-
-# Make sure the target and host cpus are compatible
-if test ! \( "$target_cpu" = "$cpu" -o \
-  \( "$target_cpu" = "ppcemb" -a "$cpu" = "ppc" \) -o \
-  \( "$target_cpu" = "x86_64" -a "$cpu" = "i386"   \) -o \
-  \( "$target_cpu" = "i386"   -a "$cpu" = "x86_64" \) \) ; then
-  target_kvm="no"
-fi
-# Disable KVM for linux-user
-if test "$target_softmmu" = "no" ; then
-  target_kvm="no"
-fi
 
 case "$target_cpu" in
   i386)
@@ -1986,11 +1973,6 @@ case "$target_cpu" in
       echo "CONFIG_KQEMU=y" >> $config_mak
       echo "#define CONFIG_KQEMU 1" >> $config_h
     fi
-    if test "$target_kvm" = "yes" ; then
-      echo "CONFIG_KVM=y" >> $config_mak
-      echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
-      echo "#define CONFIG_KVM 1" >> $config_h
-    fi
     target_phys_bits=32
   ;;
   x86_64)
@@ -2004,11 +1986,6 @@ case "$target_cpu" in
       echo "CONFIG_KQEMU=y" >> $config_mak
       echo "#define CONFIG_KQEMU 1" >> $config_h
     fi
-    if test "$target_kvm" = "yes" ; then
-      echo "CONFIG_KVM=y" >> $config_mak
-      echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
-      echo "#define CONFIG_KVM 1" >> $config_h
-    fi
     target_phys_bits=64
   ;;
   alpha)
@@ -2091,11 +2068,6 @@ case "$target_cpu" in
     echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
     echo "#define TARGET_PPC 1" >> $config_h
     echo "#define TARGET_PPCEMB 1" >> $config_h
-    if test "$target_kvm" = "yes" ; then
-      echo "CONFIG_KVM=y" >> $config_mak
-      echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
-      echo "#define CONFIG_KVM 1" >> $config_h
-    fi
     gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
     target_phys_bits=64
   ;;
@@ -2171,6 +2143,19 @@ case "$target_cpu" in
       echo "#define CONFIG_XEN 1" >> $config_h
     fi
 esac
+case "$target_cpu" in
+  i386|x86_64|ppcemb)
+    # Make sure the target and host cpus are compatible
+    if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \
+      \( "$target_cpu" = "$cpu" -o \
+      \( "$target_cpu" = "ppcemb" -a "$cpu" = "ppc" \) -o \
+      \( "$target_cpu" = "x86_64" -a "$cpu" = "i386"   \) -o \
+      \( "$target_cpu" = "i386"   -a "$cpu" = "x86_64" \) \) ; then
+      echo "CONFIG_KVM=y" >> $config_mak
+      echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
+      echo "#define CONFIG_KVM 1" >> $config_h
+    fi
+esac
 echo "HWLIB=../libhw$target_phys_bits/libqemuhw$target_phys_bits.a" >> $config_mak
 echo "#define TARGET_PHYS_ADDR_BITS $target_phys_bits" >> $config_h
 echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak
Signature · 1 line
1.6.2.2
#16 lore raw

PATCH 13/13 configure kqemu in a single place

In reply to [email protected]

From: Juan Quintela <[email protected]>

---
 configure |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)
configure +5 -10
index 1fe01af..29dcee6 100755
@@ -1968,11 +1968,6 @@ case "$target_cpu" in
     echo "TARGET_ARCH=i386" >> $config_mak
     echo "#define TARGET_ARCH \"i386\"" >> $config_h
     echo "#define TARGET_I386 1" >> $config_h
-    if test $kqemu = "yes" -a "$target_softmmu" = "yes"
-    then
-      echo "CONFIG_KQEMU=y" >> $config_mak
-      echo "#define CONFIG_KQEMU 1" >> $config_h
-    fi
     target_phys_bits=32
   ;;
   x86_64)
@@ -1981,11 +1976,6 @@ case "$target_cpu" in
     echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
     echo "#define TARGET_I386 1" >> $config_h
     echo "#define TARGET_X86_64 1" >> $config_h
-    if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
-    then
-      echo "CONFIG_KQEMU=y" >> $config_mak
-      echo "#define CONFIG_KQEMU 1" >> $config_h
-    fi
     target_phys_bits=64
   ;;
   alpha)
@@ -2142,6 +2132,11 @@ case "$target_cpu" in
       echo "CONFIG_XEN=y" >> $config_mak
       echo "#define CONFIG_XEN 1" >> $config_h
     fi
+    if test $kqemu = "yes" -a "$target_softmmu" = "yes"
+    then
+      echo "CONFIG_KQEMU=y" >> $config_mak
+      echo "#define CONFIG_KQEMU 1" >> $config_h
+    fi
 esac
 case "$target_cpu" in
   i386|x86_64|ppcemb)
Signature · 1 line
1.6.2.2
#10 lore raw

Re: [Qemu-devel] [PATCH 09/13] TARGET_ARCH2 is already known at configure time and it is called target_cpu Remove re-construction in Makefile.target

In reply to [email protected]
Quoted 2 lines · On 7/1/09, [email protected] <[email protected]> wrote:

From: Juan Quintela <[email protected]>

TARGET_CPU would be a misleading name. TARGET_ARCH2 means that it's a kind of subarchitecture. TARGET_SUBARCH or TARGET_ABI32_NAME should be OK too.

For example, there is no CPU type (or even class of CPUs) called sparc32plus. There is Sparc (a.k.a. Sparc32, V8) and Sparc64 (a.k.a. Ultrasparc, V9, V9plusa etc.). Sparc32plus is a userland mode for Sparc64 CPUs where the address space is limited to 32 bits. The same probably applies to other 32 bit subarchitectures.

#11 lore raw

[Qemu-devel] Re: [PATCH 09/13] TARGET_ARCH2 is already known at configure time and it is called target_cpu Remove re-construction in Makefile.target

Quoted 8 lines · Blue Swirl
Quoted 2 lines · On 7/1/09, [email protected] <[email protected]> wrote:

From: Juan Quintela <[email protected]>

TARGET_CPU would be a misleading name. TARGET_ARCH2 means that it's a kind of subarchitecture. TARGET_SUBARCH or TARGET_ABI32_NAME should be OK too.

Quoted 5 lines

For example, there is no CPU type (or even class of CPUs) called sparc32plus. There is Sparc (a.k.a. Sparc32, V8) and Sparc64 (a.k.a. Ultrasparc, V9, V9plusa etc.). Sparc32plus is a userland mode for Sparc64 CPUs where the address space is limited to 32 bits. The same probably applies to other 32 bit subarchitectures.

I agree, but I just used the same name than in configure:

case "$target_cpu" in
....
sparc32plus)
....
esac.

I don't matter the name, but we have just now:

ARCH
cpu
TARGET_ARCH
TARGET_ARCH2
TARGET_BASE_ARCH
target_cpu
TARGET_ABI_DIR

and I am not sure that I have all of them here. target_cpu and TARGET_ARCH2 always had the same value, but perhaps changing it to TARGET_SUBARCH is a good idea. The we would end:

TARGET_BASE_ARCH: architecture name (mips, sparc, ppc)
TARGET_ARCH: Actual architecture
TARGET_SUBARCH: change about TARGET_ARCH (sparc32plus, little/big endian
variants) (was TARGET_ARCH2 and target_cpu)
TARGET_ABI: call ABI for this TARGET_SUBARCH
cpu = canonical name for the cpu, not sure how to relate this one with ARCH
ARCH: where are we building, it is always the same than 'cpu' on
configure, it is only used on the Makefiles, but I would preffer to only use one name for the same meaning.

kill also cpu in configure script?

Anyone with a good idea?

Later, Juan.

#12 lore raw

Re: [Qemu-devel] Re: [PATCH 09/13] TARGET_ARCH2 is already known at configure time and it is called target_cpu Remove re-construction in Makefile.target

Quoted 9 lines · Juan Quintela

TARGET_BASE_ARCH: architecture name (mips, sparc, ppc)
TARGET_ARCH: Actual architecture
TARGET_SUBARCH: change about TARGET_ARCH (sparc32plus, little/big endian
variants) (was TARGET_ARCH2 and target_cpu)
TARGET_ABI: call ABI for this TARGET_SUBARCH
cpu = canonical name for the cpu, not sure how to relate this one with ARCH
ARCH: where are we building, it is always the same than 'cpu' on
configure, it is only used on the Makefiles, but I would preffer to only use one name for the same meaning.

Perhaps TARGET_CPU as the 'CPU architecture' (i.e. the name in the target-* directory), and TARGET_ARCH as the 'subarch' (i.e. taking big vs little-endian and 32 vs 64-bit into account)?

BTW, the handling of these definitions is duplicated in the configure script for config.h and config.mak, and it'd be good to fix that.

I think it might be nicer to specify target_bigendian in the same way that target_phys_bits is dealt with (and to cease assuming little-endian by default). The same probably applied to softfloat, although I do not know whether defaulting to '$target_softfloat = "yes"' and then setting that to "no" for the targets where it is not wanted would be preferred.

FWIW, the list of architectures that currently don't define CONFIG_SOFTFLOAT seems to be:

i386
x86_64
alpha
sh4
sh4eb

Also, I'm not sure whether setting target_has_{kqemu,kvm,xen} variables where target_phys_bits is set would also be slightly cleaner... although perhaps those particular architecture lists are unlikely to grow much...

I'm not sure how much of this you're interested in fixing, but I'll be happy to post patches for any changes that you don't see as essential.

Cheers,

Signature · 1 line
Stuart Brady