aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2022-11-06 21:24:24 +0700
committerMike Frysinger <vapier@gentoo.org>2022-12-21 22:21:25 -0500
commitd47ea1b9c1fb6d57271697f186f7141ef4aa41c4 (patch)
treea2fd66fc1178b3085f1033f790bfcb38ec43cc4d /sim/common
parente9c4e2d24f944f30114445189d970f14889789fd (diff)
downloadgdb-d47ea1b9c1fb6d57271697f186f7141ef4aa41c4.zip
gdb-d47ea1b9c1fb6d57271697f186f7141ef4aa41c4.tar.gz
gdb-d47ea1b9c1fb6d57271697f186f7141ef4aa41c4.tar.bz2
sim: build: hoist lists of common objects up
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.
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/Make-common.in47
-rw-r--r--sim/common/local.mk54
2 files changed, 56 insertions, 45 deletions
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 8e27795..684d7d8 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -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
diff --git a/sim/common/local.mk b/sim/common/local.mk
index c45af29..bf9b97d 100644
--- a/sim/common/local.mk
+++ b/sim/common/local.mk
@@ -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