]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: build: hoist lists of common objects up
authorMike Frysinger <vapier@gentoo.org>
Sun, 6 Nov 2022 14:24:24 +0000 (21:24 +0700)
committerMike Frysinger <vapier@gentoo.org>
Thu, 10 Nov 2022 18:44:16 +0000 (01:44 +0700)
In order to create libsim.a in the common dir, we need the list of
objects for each target.  To avoid duplicating the list with the
recursive make in each port, pass it down as a variable.  This is
a temporary hack until the top-level creates libsim.a for ports.

sim/arch-subdir.mk.in
sim/common/Make-common.in
sim/common/local.mk

index 251a9b684d936ef8fc1286063586f85200e1fc3c..cfde3f3fb785d3ced05e5f94c80eca97a55bf1b9 100644 (file)
@@ -71,6 +71,5 @@ CGENDIR = @cgendir@
 SIM_INLINE = @SIM_INLINE@
 
 SIM_HW_CFLAGS = @SIM_HW_CFLAGS@
-SIM_HW_SOCKSER = @SIM_HW_SOCKSER@
-SIM_HW_OBJS = $(SIM_COMMON_HW_OBJS) $(SIM_HW_DEVICES:%=dv-%.o) $(SIM_HW_SOCKSER)
+SIM_HW_OBJS = $(SIM_HW_DEVICES:%=dv-%.o)
 @SIM_ENABLE_HW_FALSE@SIM_HW_OBJS =
index 8e27795438a932c3ea5f7b7716507d923693001d..684d7d847ab07e4c9f2eec65114f1c0cb998f336 100644 (file)
@@ -114,50 +114,6 @@ SIM_EXTRA_DISTCLEAN =
 # here.  Some files are used by all simulators (e.g. callback.o).
 # Those files are specified in LIB_OBJS below.
 
-SIM_COMMON_HW_OBJS = \
-       hw-alloc.o \
-       hw-base.o \
-       hw-device.o \
-       hw-events.o \
-       hw-handles.o \
-       hw-instances.o \
-       hw-ports.o \
-       hw-properties.o \
-       hw-tree.o \
-       sim-hw.o \
-
-SIM_NEW_COMMON_OBJS = \
-       sim-arange.o \
-       sim-bits.o \
-       sim-close.o \
-       sim-command.o \
-       sim-config.o \
-       sim-core.o \
-       sim-cpu.o \
-       sim-endian.o \
-       sim-engine.o \
-       sim-events.o \
-       sim-fpu.o \
-       sim-hload.o \
-       sim-hrw.o \
-       sim-io.o \
-       sim-info.o \
-       sim-memopt.o \
-       sim-model.o \
-       sim-module.o \
-       sim-options.o \
-       sim-profile.o \
-       sim-reason.o \
-       sim-reg.o \
-       sim-signal.o \
-       sim-stop.o \
-       sim-syscall.o \
-       sim-trace.o \
-       sim-utils.o \
-       sim-watch.o \
-       \
-       $(SIM_HW_OBJS) \
-
 ## End COMMON_PRE_CONFIG_FRAG
 
 ## COMMON_POST_CONFIG_FRAG
@@ -180,7 +136,8 @@ BUILD_CFLAGS = $(CFLAGS_FOR_BUILD) $(CSEARCH)
 
 COMMON_DEP_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(SIM_EXTRA_CFLAGS)
 
-SIM_HW_DEVICES = cfi core pal glue $(SIM_EXTRA_HW_DEVICES)
+SIM_HW_DEVICES = $(SIM_HW_DEVICES_) $(SIM_EXTRA_HW_DEVICES)
+SIM_NEW_COMMON_OBJS = $(SIM_NEW_COMMON_OBJS_) $(SIM_HW_OBJS)
 
 LIBIBERTY_LIB = ../../libiberty/libiberty.a
 BFD_LIB = ../../bfd/libbfd.la
index c45af29d8c713a8ddd5aec7603bdd7658c0c2981..bf9b97d04d71cfb4245f86bc17dd4ad291fe4e7c 100644 (file)
@@ -56,6 +56,60 @@ CLEANFILES += \
 ## For subdirs.
 ##
 
+SIM_COMMON_HW_OBJS = \
+       hw-alloc.o \
+       hw-base.o \
+       hw-device.o \
+       hw-events.o \
+       hw-handles.o \
+       hw-instances.o \
+       hw-ports.o \
+       hw-properties.o \
+       hw-tree.o \
+       sim-hw.o
+
+SIM_NEW_COMMON_OBJS = \
+       sim-arange.o \
+       sim-bits.o \
+       sim-close.o \
+       sim-command.o \
+       sim-config.o \
+       sim-core.o \
+       sim-cpu.o \
+       sim-endian.o \
+       sim-engine.o \
+       sim-events.o \
+       sim-fpu.o \
+       sim-hload.o \
+       sim-hrw.o \
+       sim-io.o \
+       sim-info.o \
+       sim-memopt.o \
+       sim-model.o \
+       sim-module.o \
+       sim-options.o \
+       sim-profile.o \
+       sim-reason.o \
+       sim-reg.o \
+       sim-signal.o \
+       sim-stop.o \
+       sim-syscall.o \
+       sim-trace.o \
+       sim-utils.o \
+       sim-watch.o
+
+AM_MAKEFLAGS += SIM_NEW_COMMON_OBJS_="$(SIM_NEW_COMMON_OBJS)"
+
+SIM_HW_DEVICES = cfi core pal glue
+
+if SIM_ENABLE_HW
+SIM_NEW_COMMON_OBJS += \
+       $(SIM_COMMON_HW_OBJS) \
+       $(SIM_HW_SOCKSER)
+
+AM_MAKEFLAGS += SIM_HW_DEVICES_="$(SIM_HW_DEVICES)"
+endif
+
 LIBIBERTY_LIB = ../libiberty/libiberty.a
 BFD_LIB = ../bfd/libbfd.la
 OPCODES_LIB = ../opcodes/libopcodes.la