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 2/3] sim: build: hoist lists of hw devices up
Date: Wed, 21 Dec 2022 00:33:20 -0500	[thread overview]
Message-ID: <20221221053321.18033-2-vapier@gentoo.org> (raw)
In-Reply-To: <20221221053321.18033-1-vapier@gentoo.org>

We need these in the top-level to generate libsim.a, but also in the
subdirs to generate hw-config.h.  Move it to the local.mk, and pass
it down when running recursive make.  This avoids duplication, and
makes it available to both.  We can simplify this once we move the
various steps up to the top-level too.
---
 sim/Makefile.in           | 198 +++++++++++++++++++++++---------------
 sim/bfin/Makefile.in      |  35 +------
 sim/bfin/local.mk         |  34 +++++++
 sim/common/Make-common.in |   2 +-
 sim/cris/Makefile.in      |   6 +-
 sim/cris/local.mk         |   3 +
 sim/lm32/Makefile.in      |   6 +-
 sim/lm32/local.mk         |   3 +
 sim/m32r/Makefile.in      |   6 +-
 sim/m32r/local.mk         |   3 +
 sim/m68hc11/Makefile.in   |   4 +-
 sim/m68hc11/local.mk      |   3 +
 sim/mips/Makefile.in      |   4 +-
 sim/mips/local.mk         |   3 +
 sim/mn10300/Makefile.in   |   4 +-
 sim/mn10300/local.mk      |   3 +
 16 files changed, 190 insertions(+), 127 deletions(-)

diff --git a/sim/bfin/Makefile.in b/sim/bfin/Makefile.in
index 0655a06d5f2a..5d8a8a6386c5 100644
--- a/sim/bfin/Makefile.in
+++ b/sim/bfin/Makefile.in
@@ -17,6 +17,8 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
+arch = bfin
+
 SIM_OBJS = \
 	$(SIM_NEW_COMMON_OBJS) \
 	bfin-sim.o \
@@ -26,39 +28,6 @@ SIM_OBJS = \
 	machs.o \
 	sim-resume.o
 
-SIM_EXTRA_HW_DEVICES = \
-	bfin_cec \
-	bfin_ctimer \
-	bfin_dma \
-	bfin_dmac \
-	bfin_ebiu_amc \
-	bfin_ebiu_ddrc \
-	bfin_ebiu_sdc \
-	bfin_emac \
-	bfin_eppi \
-	bfin_evt \
-	bfin_gpio \
-	bfin_gpio2 \
-	bfin_gptimer \
-	bfin_jtag \
-	bfin_mmu \
-	bfin_nfc \
-	bfin_otp \
-	bfin_pfmon \
-	bfin_pint \
-	bfin_pll \
-	bfin_ppi \
-	bfin_rtc \
-	bfin_sic \
-	bfin_spi \
-	bfin_trace \
-	bfin_twi \
-	bfin_uart \
-	bfin_uart2 \
-	bfin_wdog \
-	bfin_wp \
-	eth_phy
-
 SIM_EXTRA_CFLAGS = $(SDL_CFLAGS)
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/bfin/local.mk b/sim/bfin/local.mk
index 956b3aec30da..cab9e7966986 100644
--- a/sim/bfin/local.mk
+++ b/sim/bfin/local.mk
@@ -24,6 +24,40 @@
 
 noinst_PROGRAMS += %D%/run
 
+%C%_SIM_EXTRA_HW_DEVICES = \
+	bfin_cec \
+	bfin_ctimer \
+	bfin_dma \
+	bfin_dmac \
+	bfin_ebiu_amc \
+	bfin_ebiu_ddrc \
+	bfin_ebiu_sdc \
+	bfin_emac \
+	bfin_eppi \
+	bfin_evt \
+	bfin_gpio \
+	bfin_gpio2 \
+	bfin_gptimer \
+	bfin_jtag \
+	bfin_mmu \
+	bfin_nfc \
+	bfin_otp \
+	bfin_pfmon \
+	bfin_pint \
+	bfin_pll \
+	bfin_ppi \
+	bfin_rtc \
+	bfin_sic \
+	bfin_spi \
+	bfin_trace \
+	bfin_twi \
+	bfin_uart \
+	bfin_uart2 \
+	bfin_wdog \
+	bfin_wp \
+	eth_phy
+AM_MAKEFLAGS += %C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"
+
 %D%/linux-fixed-code.h: @MAINT@ $(srcdir)/%D%/linux-fixed-code.s %D%/local.mk %D%/$(am__dirstamp)
 	$(AM_V_GEN)$(AS_FOR_TARGET_BFIN) $(srcdir)/%D%/linux-fixed-code.s -o %D%/linux-fixed-code.o
 	$(AM_V_at)(\
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 684d7d847ab0..ff4e17102024 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -136,7 +136,7 @@ BUILD_CFLAGS = $(CFLAGS_FOR_BUILD) $(CSEARCH)
 
 COMMON_DEP_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(SIM_EXTRA_CFLAGS)
 
-SIM_HW_DEVICES = $(SIM_HW_DEVICES_) $(SIM_EXTRA_HW_DEVICES)
+SIM_HW_DEVICES = $(SIM_HW_DEVICES_) $($(arch)_SIM_EXTRA_HW_DEVICES)
 SIM_NEW_COMMON_OBJS = $(SIM_NEW_COMMON_OBJS_) $(SIM_HW_OBJS)
 
 LIBIBERTY_LIB = ../../libiberty/libiberty.a
diff --git a/sim/cris/Makefile.in b/sim/cris/Makefile.in
index 3474eb9a827b..4242b17c756e 100644
--- a/sim/cris/Makefile.in
+++ b/sim/cris/Makefile.in
@@ -19,6 +19,8 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
+arch = cris
+
 CRISV10F_OBJS = crisv10f.o cpuv10.o decodev10.o modelv10.o mloopv10f.o
 CRISV32F_OBJS = crisv32f.o cpuv32.o decodev32.o modelv32.o mloopv32f.o
 
@@ -31,14 +33,10 @@ SIM_OBJS = \
 	$(CRISV32F_OBJS) \
 	traps.o
 
-SIM_EXTRA_HW_DEVICES = rv cris cris_900000xx
-
 SIM_EXTRA_CLEAN = cris-clean
 
 ## COMMON_POST_CONFIG_FRAG
 
-arch = cris
-
 cris-clean:
 	-rm -f stamp-arch
 	-rm -f tmp-*
diff --git a/sim/cris/local.mk b/sim/cris/local.mk
index 0a3423c33897..826d6de0be43 100644
--- a/sim/cris/local.mk
+++ b/sim/cris/local.mk
@@ -24,6 +24,9 @@
 
 noinst_PROGRAMS += %D%/run
 
+%C%_SIM_EXTRA_HW_DEVICES = rv cris cris_900000xx
+AM_MAKEFLAGS += %C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"
+
 ## rvdummy is just used for testing -- it runs on the same host as `run`.
 ## It does nothing if --enable-sim-hardware isn't active.
 %C%_rvdummy_SOURCES = %D%/rvdummy.c
diff --git a/sim/lm32/Makefile.in b/sim/lm32/Makefile.in
index 5d78e36bf6bb..ea6601fab067 100644
--- a/sim/lm32/Makefile.in
+++ b/sim/lm32/Makefile.in
@@ -3,6 +3,8 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
+arch = lm32
+
 # List of object files, less common parts.
 SIM_OBJS = \
 	$(SIM_NEW_COMMON_OBJS) \
@@ -12,14 +14,10 @@ SIM_OBJS = \
         cpu.o decode.o sem.o model.o mloop.o \
         lm32.o traps.o user.o 
 
-SIM_EXTRA_HW_DEVICES = lm32cpu lm32timer lm32uart
-
 SIM_EXTRA_CLEAN = lm32-clean
 
 ## COMMON_POST_CONFIG_FRAG
 
-arch = lm32 
-
 lm32-clean:
 	rm -f stamp-arch stamp-cpu 
 	rm -f tmp-*
diff --git a/sim/lm32/local.mk b/sim/lm32/local.mk
index 7add85ac98b7..437ec094e9c4 100644
--- a/sim/lm32/local.mk
+++ b/sim/lm32/local.mk
@@ -24,6 +24,9 @@
 
 noinst_PROGRAMS += %D%/run
 
+%C%_SIM_EXTRA_HW_DEVICES = lm32cpu lm32timer lm32uart
+AM_MAKEFLAGS += %C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"
+
 %C%_BUILD_OUTPUTS = \
 	%D%/eng.h \
 	%D%/mloop.c \
diff --git a/sim/m32r/Makefile.in b/sim/m32r/Makefile.in
index 6a0e2e5fcf5e..97afd6e03a37 100644
--- a/sim/m32r/Makefile.in
+++ b/sim/m32r/Makefile.in
@@ -19,6 +19,8 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
+arch = m32r
+
 M32R_OBJS = m32r.o cpu.o decode.o sem.o model.o mloop.o
 M32RX_OBJS = m32rx.o cpux.o decodex.o modelx.o mloopx.o
 M32R2_OBJS = m32r2.o cpu2.o decode2.o model2.o mloop2.o
@@ -33,8 +35,6 @@ SIM_OBJS = \
 	$(M32R2_OBJS) \
 	traps.o
 
-SIM_EXTRA_HW_DEVICES = m32r_cache m32r_uart
-
 SIM_EXTRA_CLEAN = m32r-clean
 
 # Some modules don't build cleanly yet.
@@ -42,8 +42,6 @@ cpu.o cpu2.o cpux.o m32r.o m32r2.o m32rx.o mloop.o mloop2.o mloopx.o sem.o sim-i
 
 ## COMMON_POST_CONFIG_FRAG
 
-arch = m32r
-
 m32r-clean:
 	rm -f stamp-arch stamp-cpu stamp-xcpu stamp-2cpu
 	rm -f tmp-*
diff --git a/sim/m32r/local.mk b/sim/m32r/local.mk
index 51d9d3413d6c..dff09fbf15cd 100644
--- a/sim/m32r/local.mk
+++ b/sim/m32r/local.mk
@@ -24,6 +24,9 @@
 
 noinst_PROGRAMS += %D%/run
 
+%C%_SIM_EXTRA_HW_DEVICES = m32r_cache m32r_uart
+AM_MAKEFLAGS += %C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"
+
 %C%_BUILD_OUTPUTS = \
 	%D%/eng.h \
 	%D%/mloop.c \
diff --git a/sim/m68hc11/Makefile.in b/sim/m68hc11/Makefile.in
index 6b7fcfffb188..c16f5fce2856 100644
--- a/sim/m68hc11/Makefile.in
+++ b/sim/m68hc11/Makefile.in
@@ -17,6 +17,8 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
+arch = m68hc11
+
 M68HC11_OBJS = interp.o m68hc11int.o m68hc12int.o \
 		emulos.o interrupts.o m68hc11_sim.o
 
@@ -24,8 +26,6 @@ SIM_OBJS = $(M68HC11_OBJS) \
 	$(SIM_NEW_COMMON_OBJS) \
 	sim-resume.o
 
-SIM_EXTRA_HW_DEVICES = m68hc11 m68hc11sio m68hc11eepr m68hc11tim m68hc11spi nvram
-
 # We must use 32-bit addresses to support memory bank switching.
 # The WORD_BITSIZE is normally 16 but must be switched (temporarily)
 # to 32 to avoid a bug in the sim-common which uses 'unsigned_word'
diff --git a/sim/m68hc11/local.mk b/sim/m68hc11/local.mk
index 3cc980bf036a..35555ed9868e 100644
--- a/sim/m68hc11/local.mk
+++ b/sim/m68hc11/local.mk
@@ -24,6 +24,9 @@
 
 noinst_PROGRAMS += %D%/run
 
+%C%_SIM_EXTRA_HW_DEVICES = m68hc11 m68hc11sio m68hc11eepr m68hc11tim m68hc11spi nvram
+AM_MAKEFLAGS += %C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"
+
 %C%_BUILD_OUTPUTS = \
 	%D%/gencode$(EXEEXT) \
 	%D%/m68hc11int.c \
diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in
index 75438be5a183..eadb34697c89 100644
--- a/sim/mips/Makefile.in
+++ b/sim/mips/Makefile.in
@@ -3,6 +3,8 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
+arch = mips
+
 # Object files created by various simulator generators.
 
 
@@ -64,8 +66,6 @@ SIM_OBJS = \
 	sim-main.o \
 	sim-resume.o \
 
-SIM_EXTRA_HW_DEVICES = tx3904cpu tx3904irc tx3904tmr tx3904sio
-
 # List of flags to always pass to $(CC).
 SIM_SUBTARGET=@SIM_SUBTARGET@
 SIM_EXTRA_CFLAGS = $(SIM_SUBTARGET)
diff --git a/sim/mips/local.mk b/sim/mips/local.mk
index 8e266e77b36f..159fd2947d47 100644
--- a/sim/mips/local.mk
+++ b/sim/mips/local.mk
@@ -23,3 +23,6 @@
 	$(SIM_COMMON_LIBS)
 
 noinst_PROGRAMS += %D%/run
+
+%C%_SIM_EXTRA_HW_DEVICES = tx3904cpu tx3904irc tx3904tmr tx3904sio
+AM_MAKEFLAGS += %C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"
diff --git a/sim/mn10300/Makefile.in b/sim/mn10300/Makefile.in
index 521f86c644be..0b3ebd5b74e4 100644
--- a/sim/mn10300/Makefile.in
+++ b/sim/mn10300/Makefile.in
@@ -17,6 +17,8 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
+arch = mn10300
+
 MN10300_OBJS = \
 	itable.o semantics.o idecode.o icache.o engine.o irun.o support.o \
 	$(SIM_NEW_COMMON_OBJS) \
@@ -25,8 +27,6 @@ MN10300_OBJS = \
 
 SIM_OBJS = $(MN10300_OBJS) interp.o
 
-SIM_EXTRA_HW_DEVICES = mn103cpu mn103int mn103tim mn103ser mn103iop
-
 # List of extra flags to always pass to $(CC).
 SIM_EXTRA_CFLAGS = \
 	-DPOLL_QUIT_INTERVAL=0x20 \
diff --git a/sim/mn10300/local.mk b/sim/mn10300/local.mk
index 08a3d4dedc47..70b442fe1a0d 100644
--- a/sim/mn10300/local.mk
+++ b/sim/mn10300/local.mk
@@ -24,6 +24,9 @@
 
 noinst_PROGRAMS += %D%/run
 
+%C%_SIM_EXTRA_HW_DEVICES = mn103cpu mn103int mn103tim mn103ser mn103iop
+AM_MAKEFLAGS += %C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"
+
 %C%_BUILT_SRC_FROM_IGEN = \
 	%D%/icache.h \
 	%D%/icache.c \
-- 
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 [PATCH 1/3] sim: build: hoist lists of common objects up Mike Frysinger
2022-12-21  5:33 ` Mike Frysinger [this message]
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-2-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).