public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/3] sim: build: hoist lists of common objects up
Date: Wed, 21 Dec 2022 00:33:19 -0500	[thread overview]
Message-ID: <20221221053321.18033-1-vapier@gentoo.org> (raw)

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


             reply	other threads:[~2022-12-21  5:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21  5:33 Mike Frysinger [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221221053321.18033-1-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).