public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/3] sim: build: hoist lists of common objects up
@ 2022-12-21  5:33 Mike Frysinger
  2022-12-21  5:33 ` [PATCH 2/3] sim: build: hoist lists of hw devices up Mike Frysinger
  2022-12-21  5:33 ` [PATCH 3/3] sim: hw-config.h: move generation to top-level Mike Frysinger
  0 siblings, 2 replies; 3+ messages in thread
From: Mike Frysinger @ 2022-12-21  5:33 UTC (permalink / raw)
  To: gdb-patches

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/Makefile.in           | 194 +++++++++++++++++++++-----------------
 sim/arch-subdir.mk.in     |   3 +-
 sim/common/Make-common.in |  47 +--------
 sim/common/local.mk       |  54 +++++++++++
 4 files changed, 167 insertions(+), 131 deletions(-)

diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in
index 251a9b684d93..cfde3f3fb785 100644
--- a/sim/arch-subdir.mk.in
+++ b/sim/arch-subdir.mk.in
@@ -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 =
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 8e27795438a9..684d7d847ab0 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 c45af29d8c71..bf9b97d04d71 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
-- 
2.39.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-21  5:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-21  5:33 [PATCH 1/3] sim: build: hoist lists of common objects up Mike Frysinger
2022-12-21  5:33 ` [PATCH 2/3] sim: build: hoist lists of hw devices up Mike Frysinger
2022-12-21  5:33 ` [PATCH 3/3] sim: hw-config.h: move generation to top-level Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).