Patchwork [06/24] move libobj-y variable to nested Makefile

login
register
mail settings
Submitter Paolo Bonzini
Date June 3, 2012, 12:25 p.m.
Message ID <1338726358-30681-7-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/162508/
State New
Headers show

Comments

Paolo Bonzini - June 3, 2012, 12:25 p.m.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile.target            |   42 ++++++++----------------------------------
 configure                  |    6 ------
 target-alpha/Makefile      |    3 ++-
 target-arm/Makefile        |    2 ++
 target-cris/Makefile       |    3 ++-
 target-i386/Makefile       |    2 +-
 target-lm32/Makefile       |    2 +-
 target-m68k/Makefile       |    1 +
 target-microblaze/Makefile |    3 ++-
 target-mips/Makefile       |    2 +-
 target-ppc/Makefile        |    2 +-
 target-s390x/Makefile      |    2 +-
 target-sh4/Makefile        |    2 +-
 target-sparc/Makefile      |    6 +++++-
 target-unicore32/Makefile  |    2 +-
 target-xtensa/Makefile     |    1 +
 16 files changed, 30 insertions(+), 51 deletions(-)
Blue Swirl - June 3, 2012, 1:42 p.m.
On Sun, Jun 3, 2012 at 12:25 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  Makefile.target            |   42 ++++++++----------------------------------
>  configure                  |    6 ------
>  target-alpha/Makefile      |    3 ++-
>  target-arm/Makefile        |    2 ++
>  target-cris/Makefile       |    3 ++-
>  target-i386/Makefile       |    2 +-
>  target-lm32/Makefile       |    2 +-
>  target-m68k/Makefile       |    1 +
>  target-microblaze/Makefile |    3 ++-
>  target-mips/Makefile       |    2 +-
>  target-ppc/Makefile        |    2 +-
>  target-s390x/Makefile      |    2 +-
>  target-sh4/Makefile        |    2 +-
>  target-sparc/Makefile      |    6 +++++-
>  target-unicore32/Makefile  |    2 +-
>  target-xtensa/Makefile     |    1 +
>  16 files changed, 30 insertions(+), 51 deletions(-)
>
> diff --git a/Makefile.target b/Makefile.target
> index f64419d..f323ed2 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -76,41 +76,20 @@ all: $(PROGS) stap
>
>  #########################################################
>  # cpu emulator library
> -libobj-y = exec.o translate-all.o cpu-exec.o translate.o
> -libobj-y += tcg/tcg.o tcg/optimize.o
> -libobj-$(CONFIG_TCG_INTERPRETER) += tci.o
> -libobj-y += fpu/softfloat.o
> -ifneq ($(TARGET_BASE_ARCH), sparc)
> -ifneq ($(TARGET_BASE_ARCH), alpha)
> -libobj-y += op_helper.o
> -endif
> -endif
> -libobj-y += helper.o
> -ifneq ($(TARGET_BASE_ARCH), ppc)
> -libobj-y += cpu.o
> -endif
> -libobj-$(TARGET_SPARC64) += vis_helper.o
> -libobj-$(CONFIG_NEED_MMU) += mmu.o
> -libobj-$(TARGET_ARM) += neon_helper.o iwmmxt_helper.o
> -ifeq ($(TARGET_BASE_ARCH), sparc)
> -libobj-y += fop_helper.o cc_helper.o win_helper.o mmu_helper.o ldst_helper.o
> -endif
> -libobj-$(TARGET_SPARC) += int32_helper.o
> -libobj-$(TARGET_SPARC64) += int64_helper.o
> -libobj-$(TARGET_ALPHA) += int_helper.o fpu_helper.o sys_helper.o mem_helper.o
> -
> -libobj-y += disas.o
> -libobj-$(CONFIG_TCI_DIS) += tci-dis.o
> -
> +obj-y = exec.o translate-all.o cpu-exec.o translate.o
> +obj-y += tcg/tcg.o tcg/optimize.o
> +obj-$(CONFIG_TCG_INTERPRETER) += tci.o
> +obj-y += fpu/softfloat.o
> +obj-y += disas.o
> +obj-$(CONFIG_TCI_DIS) += tci-dis.o
>  obj-y += target-$(TARGET_BASE_ARCH)/
> +obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
>
>  tci-dis.o: QEMU_CFLAGS += -I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/tci
>
>  # HELPER_CFLAGS is used for all the legacy code compiled with static register
>  # variables
> -ifneq ($(TARGET_BASE_ARCH), sparc)
> -op_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
> -endif
> +%/op_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)

This should be target specific.

Overall, the target-* changes will conflict with AREG0 conversion,
perhaps those  patches should be postponed.

>  user-exec.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
>
>  # Note: this is a workaround. The real fix is to avoid compiling
> @@ -130,7 +109,6 @@ obj-y += gdbstub.o thunk.o user-exec.o $(oslib-obj-y)
>  obj-y += $(addprefix ../, $(universal-obj-y))
>  obj-y += $(addprefix ../libuser/, $(user-obj-y))
>  obj-y += $(addprefix ../libdis-user/, $(libdis-y))
> -obj-y += $(libobj-y)
>
>  endif #CONFIG_LINUX_USER
>
> @@ -147,7 +125,6 @@ obj-y += gdbstub.o user-exec.o
>  obj-y += $(addprefix ../, $(universal-obj-y))
>  obj-y += $(addprefix ../libuser/, $(user-obj-y))
>  obj-y += $(addprefix ../libdis-user/, $(libdis-y))
> -obj-y += $(libobj-y)
>
>  endif #CONFIG_BSD_USER
>
> @@ -212,7 +189,6 @@ GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
>  obj-y += $(addprefix ../, $(universal-obj-y))
>  obj-y += $(addprefix ../, $(common-obj-y))
>  obj-y += $(addprefix ../libdis/, $(libdis-y))
> -obj-y += $(libobj-y)
>  obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y))
>  obj-y += $(addprefix ../, $(trace-obj-y))
>
> @@ -226,8 +202,6 @@ obj-$(CONFIG_SMARTCARD_NSS) += $(addprefix ../libcacard/, $(libcacard-y))
>  endif # CONFIG_BSD_USER
>  endif # CONFIG_LINUX_USER
>
> -obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
> -
>  nested-vars = obj-y
>  dummy := $(foreach var, $(nested-vars), $(call unnest-var,$(var)))
>
> diff --git a/configure b/configure
> index 48d78e1..082f0e1 100755
> --- a/configure
> +++ b/configure
> @@ -3884,12 +3884,6 @@ if test "$target_softmmu" = "yes" ; then
>   esac
>  fi
>
> -if test "$target_softmmu" = "yes" -a \( \
> -        "$TARGET_ARCH" = "microblaze" -o \
> -        "$TARGET_ARCH" = "cris" \) ; then
> -  echo "CONFIG_NEED_MMU=y" >> $config_target_mak
> -fi
> -
>  if test "$gprof" = "yes" ; then
>   echo "TARGET_GPROF=yes" >> $config_target_mak
>   if test "$target_linux_user" = "yes" ; then
> diff --git a/target-alpha/Makefile b/target-alpha/Makefile
> index c574c9e..9a72870 100644
> --- a/target-alpha/Makefile
> +++ b/target-alpha/Makefile
> @@ -1 +1,2 @@
> -# still empty
> +obj-y += helper.o cpu.o
> +obj-y += int_helper.o fpu_helper.o sys_helper.o mem_helper.o
> diff --git a/target-arm/Makefile b/target-arm/Makefile
> index f5bb920..64b7830 100644
> --- a/target-arm/Makefile
> +++ b/target-arm/Makefile
> @@ -1 +1,3 @@
>  obj-y += arm-semi.o
> +obj-y += op_helper.o helper.o cpu.o
> +obj-y += neon_helper.o iwmmxt_helper.o
> diff --git a/target-cris/Makefile b/target-cris/Makefile
> index c574c9e..8fc92b4 100644
> --- a/target-cris/Makefile
> +++ b/target-cris/Makefile
> @@ -1 +1,2 @@
> -# still empty
> +obj-y += op_helper.o helper.o cpu.o
> +obj-$(CONFIG_SOFTMMU) += mmu.o
> diff --git a/target-i386/Makefile b/target-i386/Makefile
> index 2422fc3..c64b207 100644
> --- a/target-i386/Makefile
> +++ b/target-i386/Makefile
> @@ -1,4 +1,4 @@
> +obj-y += op_helper.o helper.o cpu.o
>  obj-$(CONFIG_KVM) += hyperv.o
>  obj-$(CONFIG_LINUX_USER) += ioport-user.o
>  obj-$(CONFIG_BSD_USER) += ioport-user.o
> -
> diff --git a/target-lm32/Makefile b/target-lm32/Makefile
> index c574c9e..15826d1 100644
> --- a/target-lm32/Makefile
> +++ b/target-lm32/Makefile
> @@ -1 +1 @@
> -# still empty
> +obj-y += op_helper.o helper.o cpu.o
> diff --git a/target-m68k/Makefile b/target-m68k/Makefile
> index e73a5ba..e43774f 100644
> --- a/target-m68k/Makefile
> +++ b/target-m68k/Makefile
> @@ -1 +1,2 @@
>  obj-y += m68k-semi.o
> +obj-y += op_helper.o helper.o cpu.o
> diff --git a/target-microblaze/Makefile b/target-microblaze/Makefile
> index c574c9e..8fc92b4 100644
> --- a/target-microblaze/Makefile
> +++ b/target-microblaze/Makefile
> @@ -1 +1,2 @@
> -# still empty
> +obj-y += op_helper.o helper.o cpu.o
> +obj-$(CONFIG_SOFTMMU) += mmu.o
> diff --git a/target-mips/Makefile b/target-mips/Makefile
> index c574c9e..15826d1 100644
> --- a/target-mips/Makefile
> +++ b/target-mips/Makefile
> @@ -1 +1 @@
> -# still empty
> +obj-y += op_helper.o helper.o cpu.o
> diff --git a/target-ppc/Makefile b/target-ppc/Makefile
> index c574c9e..8413532 100644
> --- a/target-ppc/Makefile
> +++ b/target-ppc/Makefile
> @@ -1 +1 @@
> -# still empty
> +obj-y += op_helper.o helper.o
> diff --git a/target-s390x/Makefile b/target-s390x/Makefile
> index c574c9e..15826d1 100644
> --- a/target-s390x/Makefile
> +++ b/target-s390x/Makefile
> @@ -1 +1 @@
> -# still empty
> +obj-y += op_helper.o helper.o cpu.o
> diff --git a/target-sh4/Makefile b/target-sh4/Makefile
> index c574c9e..15826d1 100644
> --- a/target-sh4/Makefile
> +++ b/target-sh4/Makefile
> @@ -1 +1 @@
> -# still empty
> +obj-y += op_helper.o helper.o cpu.o
> diff --git a/target-sparc/Makefile b/target-sparc/Makefile
> index c574c9e..4bd1a4c 100644
> --- a/target-sparc/Makefile
> +++ b/target-sparc/Makefile
> @@ -1 +1,5 @@
> -# still empty
> +obj-y += helper.o cpu.o
> +obj-y += fop_helper.o cc_helper.o win_helper.o mmu_helper.o ldst_helper.o
> +obj-$(TARGET_SPARC) += int32_helper.o
> +obj-$(TARGET_SPARC64) += int64_helper.o
> +obj-$(TARGET_SPARC64) += vis_helper.o
> diff --git a/target-unicore32/Makefile b/target-unicore32/Makefile
> index c574c9e..15826d1 100644
> --- a/target-unicore32/Makefile
> +++ b/target-unicore32/Makefile
> @@ -1 +1 @@
> -# still empty
> +obj-y += op_helper.o helper.o cpu.o
> diff --git a/target-xtensa/Makefile b/target-xtensa/Makefile
> index a49ca8d..7644065 100644
> --- a/target-xtensa/Makefile
> +++ b/target-xtensa/Makefile
> @@ -2,3 +2,4 @@ obj-y += xtensa-semi.o
>  obj-y += core-dc232b.o
>  obj-y += core-dc233c.o
>  obj-y += core-fsf.o
> +obj-y += op_helper.o helper.o cpu.o
> --
> 1.7.10.1
>
>
>
Paolo Bonzini - June 3, 2012, 5:32 p.m.
Il 03/06/2012 15:42, Blue Swirl ha scritto:
>> >  # HELPER_CFLAGS is used for all the legacy code compiled with static register
>> >  # variables
>> > -ifneq ($(TARGET_BASE_ARCH), sparc)
>> > -op_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
>> > -endif
>> > +%/op_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
> This should be target specific.
> 
> Overall, the target-* changes will conflict with AREG0 conversion,
> perhaps those  patches should be postponed.

It's difficult to convert Makefile.objs without doing Makefile.target
first.  Not a big deal though, the conflicts are easy for me to resolve.

Paolo

Patch

diff --git a/Makefile.target b/Makefile.target
index f64419d..f323ed2 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -76,41 +76,20 @@  all: $(PROGS) stap
 
 #########################################################
 # cpu emulator library
-libobj-y = exec.o translate-all.o cpu-exec.o translate.o
-libobj-y += tcg/tcg.o tcg/optimize.o
-libobj-$(CONFIG_TCG_INTERPRETER) += tci.o
-libobj-y += fpu/softfloat.o
-ifneq ($(TARGET_BASE_ARCH), sparc)
-ifneq ($(TARGET_BASE_ARCH), alpha)
-libobj-y += op_helper.o
-endif
-endif
-libobj-y += helper.o
-ifneq ($(TARGET_BASE_ARCH), ppc)
-libobj-y += cpu.o
-endif
-libobj-$(TARGET_SPARC64) += vis_helper.o
-libobj-$(CONFIG_NEED_MMU) += mmu.o
-libobj-$(TARGET_ARM) += neon_helper.o iwmmxt_helper.o
-ifeq ($(TARGET_BASE_ARCH), sparc)
-libobj-y += fop_helper.o cc_helper.o win_helper.o mmu_helper.o ldst_helper.o
-endif
-libobj-$(TARGET_SPARC) += int32_helper.o
-libobj-$(TARGET_SPARC64) += int64_helper.o
-libobj-$(TARGET_ALPHA) += int_helper.o fpu_helper.o sys_helper.o mem_helper.o
-
-libobj-y += disas.o
-libobj-$(CONFIG_TCI_DIS) += tci-dis.o
-
+obj-y = exec.o translate-all.o cpu-exec.o translate.o
+obj-y += tcg/tcg.o tcg/optimize.o
+obj-$(CONFIG_TCG_INTERPRETER) += tci.o
+obj-y += fpu/softfloat.o
+obj-y += disas.o
+obj-$(CONFIG_TCI_DIS) += tci-dis.o
 obj-y += target-$(TARGET_BASE_ARCH)/
+obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
 
 tci-dis.o: QEMU_CFLAGS += -I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/tci
 
 # HELPER_CFLAGS is used for all the legacy code compiled with static register
 # variables
-ifneq ($(TARGET_BASE_ARCH), sparc)
-op_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
-endif
+%/op_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
 user-exec.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
 
 # Note: this is a workaround. The real fix is to avoid compiling
@@ -130,7 +109,6 @@  obj-y += gdbstub.o thunk.o user-exec.o $(oslib-obj-y)
 obj-y += $(addprefix ../, $(universal-obj-y))
 obj-y += $(addprefix ../libuser/, $(user-obj-y))
 obj-y += $(addprefix ../libdis-user/, $(libdis-y))
-obj-y += $(libobj-y)
 
 endif #CONFIG_LINUX_USER
 
@@ -147,7 +125,6 @@  obj-y += gdbstub.o user-exec.o
 obj-y += $(addprefix ../, $(universal-obj-y))
 obj-y += $(addprefix ../libuser/, $(user-obj-y))
 obj-y += $(addprefix ../libdis-user/, $(libdis-y))
-obj-y += $(libobj-y)
 
 endif #CONFIG_BSD_USER
 
@@ -212,7 +189,6 @@  GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
 obj-y += $(addprefix ../, $(universal-obj-y))
 obj-y += $(addprefix ../, $(common-obj-y))
 obj-y += $(addprefix ../libdis/, $(libdis-y))
-obj-y += $(libobj-y)
 obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y))
 obj-y += $(addprefix ../, $(trace-obj-y))
 
@@ -226,8 +202,6 @@  obj-$(CONFIG_SMARTCARD_NSS) += $(addprefix ../libcacard/, $(libcacard-y))
 endif # CONFIG_BSD_USER
 endif # CONFIG_LINUX_USER
 
-obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
-
 nested-vars = obj-y
 dummy := $(foreach var, $(nested-vars), $(call unnest-var,$(var)))
 
diff --git a/configure b/configure
index 48d78e1..082f0e1 100755
--- a/configure
+++ b/configure
@@ -3884,12 +3884,6 @@  if test "$target_softmmu" = "yes" ; then
   esac
 fi
 
-if test "$target_softmmu" = "yes" -a \( \
-        "$TARGET_ARCH" = "microblaze" -o \
-        "$TARGET_ARCH" = "cris" \) ; then
-  echo "CONFIG_NEED_MMU=y" >> $config_target_mak
-fi
-
 if test "$gprof" = "yes" ; then
   echo "TARGET_GPROF=yes" >> $config_target_mak
   if test "$target_linux_user" = "yes" ; then
diff --git a/target-alpha/Makefile b/target-alpha/Makefile
index c574c9e..9a72870 100644
--- a/target-alpha/Makefile
+++ b/target-alpha/Makefile
@@ -1 +1,2 @@ 
-# still empty
+obj-y += helper.o cpu.o
+obj-y += int_helper.o fpu_helper.o sys_helper.o mem_helper.o
diff --git a/target-arm/Makefile b/target-arm/Makefile
index f5bb920..64b7830 100644
--- a/target-arm/Makefile
+++ b/target-arm/Makefile
@@ -1 +1,3 @@ 
 obj-y += arm-semi.o
+obj-y += op_helper.o helper.o cpu.o
+obj-y += neon_helper.o iwmmxt_helper.o
diff --git a/target-cris/Makefile b/target-cris/Makefile
index c574c9e..8fc92b4 100644
--- a/target-cris/Makefile
+++ b/target-cris/Makefile
@@ -1 +1,2 @@ 
-# still empty
+obj-y += op_helper.o helper.o cpu.o
+obj-$(CONFIG_SOFTMMU) += mmu.o
diff --git a/target-i386/Makefile b/target-i386/Makefile
index 2422fc3..c64b207 100644
--- a/target-i386/Makefile
+++ b/target-i386/Makefile
@@ -1,4 +1,4 @@ 
+obj-y += op_helper.o helper.o cpu.o
 obj-$(CONFIG_KVM) += hyperv.o
 obj-$(CONFIG_LINUX_USER) += ioport-user.o
 obj-$(CONFIG_BSD_USER) += ioport-user.o
-
diff --git a/target-lm32/Makefile b/target-lm32/Makefile
index c574c9e..15826d1 100644
--- a/target-lm32/Makefile
+++ b/target-lm32/Makefile
@@ -1 +1 @@ 
-# still empty
+obj-y += op_helper.o helper.o cpu.o
diff --git a/target-m68k/Makefile b/target-m68k/Makefile
index e73a5ba..e43774f 100644
--- a/target-m68k/Makefile
+++ b/target-m68k/Makefile
@@ -1 +1,2 @@ 
 obj-y += m68k-semi.o
+obj-y += op_helper.o helper.o cpu.o
diff --git a/target-microblaze/Makefile b/target-microblaze/Makefile
index c574c9e..8fc92b4 100644
--- a/target-microblaze/Makefile
+++ b/target-microblaze/Makefile
@@ -1 +1,2 @@ 
-# still empty
+obj-y += op_helper.o helper.o cpu.o
+obj-$(CONFIG_SOFTMMU) += mmu.o
diff --git a/target-mips/Makefile b/target-mips/Makefile
index c574c9e..15826d1 100644
--- a/target-mips/Makefile
+++ b/target-mips/Makefile
@@ -1 +1 @@ 
-# still empty
+obj-y += op_helper.o helper.o cpu.o
diff --git a/target-ppc/Makefile b/target-ppc/Makefile
index c574c9e..8413532 100644
--- a/target-ppc/Makefile
+++ b/target-ppc/Makefile
@@ -1 +1 @@ 
-# still empty
+obj-y += op_helper.o helper.o
diff --git a/target-s390x/Makefile b/target-s390x/Makefile
index c574c9e..15826d1 100644
--- a/target-s390x/Makefile
+++ b/target-s390x/Makefile
@@ -1 +1 @@ 
-# still empty
+obj-y += op_helper.o helper.o cpu.o
diff --git a/target-sh4/Makefile b/target-sh4/Makefile
index c574c9e..15826d1 100644
--- a/target-sh4/Makefile
+++ b/target-sh4/Makefile
@@ -1 +1 @@ 
-# still empty
+obj-y += op_helper.o helper.o cpu.o
diff --git a/target-sparc/Makefile b/target-sparc/Makefile
index c574c9e..4bd1a4c 100644
--- a/target-sparc/Makefile
+++ b/target-sparc/Makefile
@@ -1 +1,5 @@ 
-# still empty
+obj-y += helper.o cpu.o
+obj-y += fop_helper.o cc_helper.o win_helper.o mmu_helper.o ldst_helper.o
+obj-$(TARGET_SPARC) += int32_helper.o
+obj-$(TARGET_SPARC64) += int64_helper.o
+obj-$(TARGET_SPARC64) += vis_helper.o
diff --git a/target-unicore32/Makefile b/target-unicore32/Makefile
index c574c9e..15826d1 100644
--- a/target-unicore32/Makefile
+++ b/target-unicore32/Makefile
@@ -1 +1 @@ 
-# still empty
+obj-y += op_helper.o helper.o cpu.o
diff --git a/target-xtensa/Makefile b/target-xtensa/Makefile
index a49ca8d..7644065 100644
--- a/target-xtensa/Makefile
+++ b/target-xtensa/Makefile
@@ -2,3 +2,4 @@  obj-y += xtensa-semi.o
 obj-y += core-dc232b.o
 obj-y += core-dc233c.o
 obj-y += core-fsf.o
+obj-y += op_helper.o helper.o cpu.o