public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/83] sim: merge subdir makefiles into top-level
@ 2023-01-03  7:54 Mike Frysinger
  2023-01-03  7:54 ` [PATCH 01/83] sim: mips: add multi source to built sources Mike Frysinger
                   ` (82 more replies)
  0 siblings, 83 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:54 UTC (permalink / raw)
  To: gdb-patches

A series of patches to move all the subdir compilation into the
top-level (other than ppc).  This allows us to leverage Automake
in more places and kill off many of our handwritten makefiles.

The practical result is we get a slightly faster build, and it
makes it a bit easier to share common/ objects between ports,
and maybe one day merge them into a single run program.

Some of these changes have been split up into smaller patches
for the sake of review & bisection.  If a regression is added
somewhere along the line, hopefully it'll be easier to track
down, especially with the patches being reduced to a minimum.

Along those lines, this series should be fully bisectable.

Mike Frysinger (83):
  sim: mips: add multi source to built sources
  sim: modules: trigger generation from top-level
  sim: build: drop support for subdir extra deps
  sim: aarch64: move libsim.a creation to top-level
  sim: arm: move libsim.a creation to top-level
  sim: avr: move libsim.a creation to top-level
  sim: bfin: move libsim.a creation to top-level
  sim: bpf: move libsim.a creation to top-level
  sim: cr16: move libsim.a creation to top-level
  sim: cris: move libsim.a creation to top-level
  sim: d10v: move libsim.a creation to top-level
  sim: erc32: move libsim.a creation to top-level
  sim: example-synacor: move libsim.a creation to top-level
  sim: frv: move libsim.a creation to top-level
  sim: ft32: move libsim.a creation to top-level
  sim: h8300: move libsim.a creation to top-level
  sim: iq2000: move libsim.a creation to top-level
  sim: lm32: move libsim.a creation to top-level
  sim: m32c: move libsim.a creation to top-level
  sim: m32r: move libsim.a creation to top-level
  sim: m68hc11: move libsim.a creation to top-level
  sim: mcore: move libsim.a creation to top-level
  sim: microblaze: move libsim.a creation to top-level
  sim: mips: move libsim.a creation to top-level
  sim: mn10300: move libsim.a creation to top-level
  sim: moxie: move libsim.a creation to top-level
  sim: msp430: move libsim.a creation to top-level
  sim: or1k: move libsim.a creation to top-level
  sim: pru: move libsim.a creation to top-level
  sim: riscv: move libsim.a creation to top-level
  sim: rl78: move libsim.a creation to top-level
  sim: rx: move libsim.a creation to top-level
  sim: sh: move libsim.a creation to top-level
  sim: v850: move libsim.a creation to top-level
  sim: build: drop support for creating libsim.a in subdirs
  sim: build: drop common/nrun.o subdir hack
  sim: modules.c: move generation to top-level
  sim: build: add basic framework for compiling arch objects in
    top-level
  sim: aarch64: move arch-specific file compilation to top-level
  sim: arm: move arch-specific file compilation to top-level
  sim: avr: move arch-specific file compilation to top-level
  sim: bpf: move arch-specific file compilation to top-level
  sim: bfin: move arch-specific file compilation to top-level
  sim: cr16: move arch-specific file compilation to top-level
  sim: cris: move arch-specific file compilation to top-level
  sim: d10v: move arch-specific file compilation to top-level
  sim: erc32: move arch-specific file compilation to top-level
  sim: example-synacor: move arch-specific file compilation to top-level
  sim: frv: move arch-specific file compilation to top-level
  sim: ft32: move arch-specific file compilation to top-level
  sim: h8300: move arch-specific file compilation to top-level
  sim: iq2000: move arch-specific file compilation to top-level
  sim: lm32: move arch-specific file compilation to top-level
  sim: m32c: move arch-specific file compilation to top-level
  sim: m32r: move arch-specific file compilation to top-level
  sim: m68hc11: move arch-specific file compilation to top-level
  sim: mcore: move arch-specific file compilation to top-level
  sim: microblaze: move arch-specific file compilation to top-level
  sim: mips: move arch-specific file compilation to top-level
  sim: mn10300: move arch-specific file compilation to top-level
  sim: moxie: move arch-specific file compilation to top-level
  sim: msp430: move arch-specific file compilation to top-level
  sim: or1k: move arch-specific file compilation to top-level
  sim: pru: move arch-specific file compilation to top-level
  sim: riscv: move arch-specific file compilation to top-level
  sim: rl78: move arch-specific file compilation to top-level
  sim: rx: move arch-specific file compilation to top-level
  sim: sh: move arch-specific file compilation to top-level
  sim: v850: move arch-specific file compilation to top-level
  sim: move arch-specific file compilation of common/ files to top-level
  sim: common: move test-hw-events to top-level build
  sim: disable recursive make in (most) subdirs
  sim: build: drop subdir Makefile.in files
  sim: build: delete Make-common.in logic
  sim: build: drop AM_MAKEFLAGS settings
  sim: common: simplify hw-config.h deps
  sim: igen: simplify build dep
  sim: common: move libcommon.a objects to sources
  sim: build: drop most recursive build deps
  sim: common: move libcommon.a dep to ppc code
  sim: common: move modules.c to source tracking
  sim: common: simplify modules.c deps
  sim: build: drop depdir subdir hack

 sim/Makefile.am                 |   34 +-
 sim/Makefile.in                 | 2450 ++++++++++++++++++++++++++-----
 sim/README-HACKING              |   52 +-
 sim/aarch64/Makefile.in         |   33 -
 sim/aarch64/local.mk            |   19 +
 sim/arch-subdir.mk.in           |    3 -
 sim/arm/Makefile.in             |   29 -
 sim/arm/local.mk                |   21 +
 sim/avr/Makefile.in             |   24 -
 sim/avr/local.mk                |   16 +
 sim/bfin/Makefile.in            |   33 -
 sim/bfin/local.mk               |   24 +-
 sim/bpf/Makefile.in             |   61 -
 sim/bpf/local.mk                |   45 +-
 sim/common/Make-common.in       |  286 ----
 sim/common/defs.h               |    2 +-
 sim/common/hw-events.c          |    2 +
 sim/common/local.mk             |   62 +-
 sim/configure                   |  792 +---------
 sim/configure.ac                |   38 -
 sim/cr16/Makefile.in            |   27 -
 sim/cr16/local.mk               |   22 +-
 sim/cris/Makefile.in            |   36 -
 sim/cris/local.mk               |   40 +-
 sim/d10v/Makefile.in            |   28 -
 sim/d10v/local.mk               |   23 +-
 sim/erc32/Makefile.in           |   32 -
 sim/erc32/local.mk              |   30 +-
 sim/example-synacor/Makefile.in |   26 -
 sim/example-synacor/local.mk    |   17 +
 sim/frv/Makefile.in             |   39 -
 sim/frv/local.mk                |   55 +-
 sim/ft32/Makefile.in            |   26 -
 sim/ft32/local.mk               |   16 +
 sim/h8300/Makefile.in           |   24 -
 sim/h8300/local.mk              |   16 +
 sim/igen/local.mk               |    4 -
 sim/iq2000/Makefile.in          |   31 -
 sim/iq2000/local.mk             |   33 +-
 sim/lm32/Makefile.in            |   17 -
 sim/lm32/local.mk               |   37 +-
 sim/m32c/Makefile.in            |   40 -
 sim/m32c/local.mk               |   33 +-
 sim/m32r/Makefile.in            |   41 -
 sim/m32r/local.mk               |   63 +-
 sim/m68hc11/Makefile.in         |   39 -
 sim/m68hc11/local.mk            |   38 +-
 sim/mcore/Makefile.in           |   25 -
 sim/mcore/local.mk              |   16 +
 sim/microblaze/Makefile.in      |   25 -
 sim/microblaze/local.mk         |   16 +
 sim/mips/Makefile.in            |   58 -
 sim/mips/acinclude.m4           |   20 +-
 sim/mips/local.mk               |   71 +-
 sim/mn10300/Makefile.in         |   35 -
 sim/mn10300/local.mk            |   34 +-
 sim/moxie/Makefile.in           |   27 -
 sim/moxie/local.mk              |   18 +
 sim/msp430/Makefile.in          |   26 -
 sim/msp430/local.mk             |   16 +
 sim/or1k/Makefile.in            |   47 -
 sim/or1k/local.mk               |   38 +-
 sim/ppc/local.mk                |    6 +
 sim/pru/Makefile.in             |   27 -
 sim/pru/local.mk                |   16 +
 sim/riscv/Makefile.in           |   29 -
 sim/riscv/local.mk              |   20 +
 sim/rl78/Makefile.in            |   34 -
 sim/rl78/local.mk               |   22 +-
 sim/rx/Makefile.in              |   39 -
 sim/rx/local.mk                 |   28 +-
 sim/sh/Makefile.in              |   25 -
 sim/sh/local.mk                 |   20 +-
 sim/v850/Makefile.in            |   28 -
 sim/v850/local.mk               |   30 +-
 75 files changed, 3001 insertions(+), 2654 deletions(-)
 delete mode 100644 sim/aarch64/Makefile.in
 delete mode 100644 sim/arm/Makefile.in
 delete mode 100644 sim/avr/Makefile.in
 delete mode 100644 sim/bfin/Makefile.in
 delete mode 100644 sim/bpf/Makefile.in
 delete mode 100644 sim/common/Make-common.in
 delete mode 100644 sim/cr16/Makefile.in
 delete mode 100644 sim/cris/Makefile.in
 delete mode 100644 sim/d10v/Makefile.in
 delete mode 100644 sim/erc32/Makefile.in
 delete mode 100644 sim/example-synacor/Makefile.in
 delete mode 100644 sim/frv/Makefile.in
 delete mode 100644 sim/ft32/Makefile.in
 delete mode 100644 sim/h8300/Makefile.in
 delete mode 100644 sim/iq2000/Makefile.in
 delete mode 100644 sim/lm32/Makefile.in
 delete mode 100644 sim/m32c/Makefile.in
 delete mode 100644 sim/m32r/Makefile.in
 delete mode 100644 sim/m68hc11/Makefile.in
 delete mode 100644 sim/mcore/Makefile.in
 delete mode 100644 sim/microblaze/Makefile.in
 delete mode 100644 sim/mips/Makefile.in
 delete mode 100644 sim/mn10300/Makefile.in
 delete mode 100644 sim/moxie/Makefile.in
 delete mode 100644 sim/msp430/Makefile.in
 delete mode 100644 sim/or1k/Makefile.in
 delete mode 100644 sim/pru/Makefile.in
 delete mode 100644 sim/riscv/Makefile.in
 delete mode 100644 sim/rl78/Makefile.in
 delete mode 100644 sim/rx/Makefile.in
 delete mode 100644 sim/sh/Makefile.in
 delete mode 100644 sim/v850/Makefile.in

-- 
2.39.0


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

* [PATCH 01/83] sim: mips: add multi source to built sources
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
@ 2023-01-03  7:54 ` Mike Frysinger
  2023-01-03  7:54 ` [PATCH 02/83] sim: modules: trigger generation from top-level Mike Frysinger
                   ` (81 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:54 UTC (permalink / raw)
  To: gdb-patches

The multirun generation mode is a bit of a mess as generated run files
depend on generate igen files, all with unknown names ahead of time.
In the multirun mode, be lazy and declare all of these generated source
files as built sources so they'll be created early on.
---
 sim/Makefile.in   | 3 ++-
 sim/mips/local.mk | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/sim/mips/local.mk b/sim/mips/local.mk
index fa70edde35b6..9db960ca4beb 100644
--- a/sim/mips/local.mk
+++ b/sim/mips/local.mk
@@ -29,6 +29,10 @@ AM_MAKEFLAGS += %C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"
 
 ## List all generated headers to help Automake dependency tracking.
 BUILT_SOURCES += %D%/itable.h
+## The multi files are a bit of a mess with generated multirun files depending
+## on generated igen files.  Be lazy for now and declare them all built so they
+## are generated early on.
+BUILT_SOURCES += $(SIM_MIPS_MULTI_SRC)
 %C%_BUILT_SRC_FROM_IGEN_ITABLE = \
 	%D%/itable.h \
 	%D%/itable.c
-- 
2.39.0


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

* [PATCH 02/83] sim: modules: trigger generation from top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
  2023-01-03  7:54 ` [PATCH 01/83] sim: mips: add multi source to built sources Mike Frysinger
@ 2023-01-03  7:54 ` Mike Frysinger
  2023-01-03  7:54 ` [PATCH 03/83] sim: build: drop support for subdir extra deps Mike Frysinger
                   ` (80 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:54 UTC (permalink / raw)
  To: gdb-patches

Add rules for tracking generated subdir modules.c files.  This doesn't
actually generate the file from the top-level, but allows us to add
rules that need to be ordered wrt it.  Once those changes land, we can
rework this to actually generate from the top-level.

This currently builds off of the objects that go into the libsim.a as
we don't build those from the top-level either.  Once we migrate that
up, we can switch this to the source files directly.  It's a bit hacky
overall, but makes it easier to migrate things in smaller chunks, and
we aren't going to keep this logic long term.
---
 sim/Makefile.in           | 41 ++++++++++++++++++++++++++++++++-------
 sim/bpf/local.mk          |  1 +
 sim/common/Make-common.in |  5 ++---
 sim/common/local.mk       | 16 +++++++++++++++
 sim/cr16/local.mk         |  1 +
 sim/cris/local.mk         |  1 +
 sim/d10v/local.mk         |  1 +
 sim/frv/local.mk          |  1 +
 sim/iq2000/local.mk       |  1 +
 sim/lm32/local.mk         |  1 +
 sim/m32c/local.mk         |  1 +
 sim/m32r/local.mk         |  1 +
 sim/m68hc11/local.mk      |  1 +
 sim/mips/local.mk         |  1 +
 sim/mn10300/local.mk      |  1 +
 sim/or1k/local.mk         |  1 +
 sim/sh/local.mk           |  1 +
 sim/v850/local.mk         |  1 +
 18 files changed, 67 insertions(+), 10 deletions(-)

diff --git a/sim/bpf/local.mk b/sim/bpf/local.mk
index 4ba1f461303c..f86f3306a8a9 100644
--- a/sim/bpf/local.mk
+++ b/sim/bpf/local.mk
@@ -35,6 +35,7 @@ BUILT_SOURCES += \
 
 ## This makes sure build tools are available before building the arch-subdirs.
 SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+%D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 %D%/mloop-le.c %D%/eng-le.h: %D%/stamp-mloop-le ; @true
 %D%/stamp-mloop-le: $(srccom)/genmloop.sh %D%/mloop.in
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 35477d94bb8e..b56a49a0051f 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -186,8 +186,7 @@ endif
 
 all_object_files = $(LIB_OBJS) $(SIM_RUN_OBJS)
 generated_files = \
-	$(SIM_EXTRA_DEPS) \
-	modules.c
+	$(SIM_EXTRA_DEPS)
 
 # Ensure that generated files are created early.  Use order-only
 # dependencies if available.  They require GNU make 3.80 or newer,
@@ -212,7 +211,7 @@ stamp-modules: Makefile $(SIM_OBJS:.o=.c)
 	$(ECHO_STAMP) modules.c
 	$(SILENCE) LANG=C ; export LANG ; \
 	LC_ALL=C ; export LC_ALL ; \
-	sed -n -e '/^sim_install_/{s/^\(sim_install_[a-z_0-9A-Z]*\).*/\1/;p}' $^ | sort >$@.l-tmp
+	sed -n -e '/^sim_install_/{s/^\(sim_install_[a-z_0-9A-Z]*\).*/\1/;p}' $^ $(GEN_MODULES_C_SRCS) | sort >$@.l-tmp
 	@set -e; (\
 	echo '/* Do not modify this file.  */'; \
 	echo '/* It is created automatically by the Makefile.  */'; \
diff --git a/sim/common/local.mk b/sim/common/local.mk
index dd6ed5fec83c..128b770dbe10 100644
--- a/sim/common/local.mk
+++ b/sim/common/local.mk
@@ -130,6 +130,22 @@ endif
 MOSTLYCLEANFILES += $(%C%_HW_CONFIG_H_TARGETS) $(patsubst %,%/stamp-hw,$(SIM_ENABLED_ARCHES))
 SIM_ALL_RECURSIVE_DEPS += $(%C%_HW_CONFIG_H_TARGETS)
 
+## See sim_pre_argv_init and sim_module_install in sim-module.c for more details.
+## TODO: Switch this to xxx_SOURCES once projects build objects in local.mk.
+am_arch_d = $(subst -,_,$(@D))
+GEN_MODULES_C_SRCS = \
+	$(wildcard \
+		$(patsubst %.o,$(abs_srcdir)/%.c,$($(am_arch_d)_libsim_a_OBJECTS) $($(am_arch_d)_libsim_a_LIBADD)) \
+		$(filter-out %.o,$(patsubst $(@D)/%.o,$(abs_srcdir)/common/%.c,$($(am_arch_d)_libsim_a_LIBADD))))
+%/modules.c:
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) GEN_MODULES_C_SRCS="$(GEN_MODULES_C_SRCS)" -C $(@D) $(@F)
+
+## NB: The ppc port doesn't currently utilize the modules API, so skip it.
+%C%_GEN_MODULES_C_TARGETS = $(patsubst %,%/modules.c,$(filter-out ppc,$(SIM_ENABLED_ARCHES)))
+MOSTLYCLEANFILES += $(%C%_GEN_MODULES_C_TARGETS) $(patsubst %,%/stamp-modules,$(SIM_ENABLED_ARCHES))
+## TODO: Drop this once each port's local.mk:libsim.a depends on it themself.
+SIM_ALL_RECURSIVE_DEPS += $(%C%_GEN_MODULES_C_TARGETS)
+
 LIBIBERTY_LIB = ../libiberty/libiberty.a
 BFD_LIB = ../bfd/libbfd.la
 OPCODES_LIB = ../opcodes/libopcodes.la
diff --git a/sim/cr16/local.mk b/sim/cr16/local.mk
index f5401f6d5f93..8e28cc356f58 100644
--- a/sim/cr16/local.mk
+++ b/sim/cr16/local.mk
@@ -32,6 +32,7 @@ BUILT_SOURCES += %D%/simops.h
 
 ## This makes sure build tools are available before building the arch-subdirs.
 SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+%D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 %C%_gencode_SOURCES = %D%/gencode.c
 %C%_gencode_LDADD = %D%/cr16-opc.o
diff --git a/sim/cris/local.mk b/sim/cris/local.mk
index 0e56fefa960c..d55e7b84e25b 100644
--- a/sim/cris/local.mk
+++ b/sim/cris/local.mk
@@ -46,6 +46,7 @@ BUILT_SOURCES += \
 
 ## This makes sure build tools are available before building the arch-subdirs.
 SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+%D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 ## FIXME: What is mono and what does "Use of `mono' is wip" mean (other
 ## than the apparent; some "mono" feature is work in progress)?
diff --git a/sim/d10v/local.mk b/sim/d10v/local.mk
index 38a3c9263d62..2556845ed1d1 100644
--- a/sim/d10v/local.mk
+++ b/sim/d10v/local.mk
@@ -32,6 +32,7 @@ BUILT_SOURCES += %D%/simops.h
 
 ## This makes sure build tools are available before building the arch-subdirs.
 SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+%D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 %C%_gencode_SOURCES = %D%/gencode.c
 %C%_gencode_LDADD = %D%/d10v-opc.o
diff --git a/sim/frv/local.mk b/sim/frv/local.mk
index 11db636a7159..471b0adc6533 100644
--- a/sim/frv/local.mk
+++ b/sim/frv/local.mk
@@ -35,6 +35,7 @@ BUILT_SOURCES += %D%/eng.h
 
 ## This makes sure build tools are available before building the arch-subdirs.
 SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+%D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 ## FIXME: Use of `mono' is wip.
 %D%/mloop.c %D%/eng.h: %D%/stamp-mloop ; @true
diff --git a/sim/iq2000/local.mk b/sim/iq2000/local.mk
index 881cf2c55dcd..4113b4bc2f39 100644
--- a/sim/iq2000/local.mk
+++ b/sim/iq2000/local.mk
@@ -32,6 +32,7 @@ BUILT_SOURCES += %D%/eng.h
 
 ## This makes sure build tools are available before building the arch-subdirs.
 SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+%D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 ## FIXME: Use of `mono' is wip.
 %D%/mloop.c %D%/eng.h: %D%/stamp-mloop ; @true
diff --git a/sim/lm32/local.mk b/sim/lm32/local.mk
index 3f9606410d62..311de7df47e8 100644
--- a/sim/lm32/local.mk
+++ b/sim/lm32/local.mk
@@ -35,6 +35,7 @@ BUILT_SOURCES += %D%/eng.h
 
 ## This makes sure build tools are available before building the arch-subdirs.
 SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+%D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 ## FIXME: Use of `mono' is wip.
 %D%/mloop.c %D%/eng.h: %D%/stamp-mloop ; @true
diff --git a/sim/m32c/local.mk b/sim/m32c/local.mk
index 1a542f186553..75909075a1e3 100644
--- a/sim/m32c/local.mk
+++ b/sim/m32c/local.mk
@@ -35,6 +35,7 @@ noinst_PROGRAMS += %D%/run
 
 ## This makes sure build tools are available before building the arch-subdirs.
 SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+%D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 %C%_opc2c_SOURCES = %D%/opc2c.c
 
diff --git a/sim/m32r/local.mk b/sim/m32r/local.mk
index 4f9f2bc257dc..9814ae5c6c16 100644
--- a/sim/m32r/local.mk
+++ b/sim/m32r/local.mk
@@ -42,6 +42,7 @@ BUILT_SOURCES += \
 
 ## This makes sure build tools are available before building the arch-subdirs.
 SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+%D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 ## FIXME: Use of `mono' is wip.
 %D%/mloop.c %D%/eng.h: %D%/stamp-mloop ; @true
diff --git a/sim/m68hc11/local.mk b/sim/m68hc11/local.mk
index 187bd389cefe..d2e04576a771 100644
--- a/sim/m68hc11/local.mk
+++ b/sim/m68hc11/local.mk
@@ -34,6 +34,7 @@ AM_MAKEFLAGS += %C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"
 
 ## This makes sure build tools are available before building the arch-subdirs.
 SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+%D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 %C%_gencode_SOURCES = %D%/gencode.c
 
diff --git a/sim/mips/local.mk b/sim/mips/local.mk
index 9db960ca4beb..5a7b12c29a1e 100644
--- a/sim/mips/local.mk
+++ b/sim/mips/local.mk
@@ -96,6 +96,7 @@ endif
 
 ## This makes sure build tools are available before building the arch-subdirs.
 SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+%D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 $(%C%_BUILT_SRC_FROM_IGEN_ITABLE): %D%/stamp-igen-itable
 $(%C%_BUILT_SRC_FROM_GEN_MODE_SINGLE): %D%/stamp-gen-mode-single
diff --git a/sim/mn10300/local.mk b/sim/mn10300/local.mk
index afb1df75f2ef..d24e6b8d0405 100644
--- a/sim/mn10300/local.mk
+++ b/sim/mn10300/local.mk
@@ -58,6 +58,7 @@ BUILT_SOURCES += \
 
 ## This makes sure build tools are available before building the arch-subdirs.
 SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+%D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 $(%C%_BUILT_SRC_FROM_IGEN): %D%/stamp-igen
 
diff --git a/sim/or1k/local.mk b/sim/or1k/local.mk
index ef8ae2a6abcb..7d999f6f3aa4 100644
--- a/sim/or1k/local.mk
+++ b/sim/or1k/local.mk
@@ -34,6 +34,7 @@ BUILT_SOURCES += %D%/eng.h
 
 ## This makes sure build tools are available before building the arch-subdirs.
 SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+%D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 ## FIXME: Use of `mono' is wip.
 %D%/mloop.c %D%/eng.h: %D%/stamp-mloop ; @true
diff --git a/sim/sh/local.mk b/sim/sh/local.mk
index 8c2ce0da1499..c25ab536c681 100644
--- a/sim/sh/local.mk
+++ b/sim/sh/local.mk
@@ -36,6 +36,7 @@ BUILT_SOURCES += \
 
 ## This makes sure build tools are available before building the arch-subdirs.
 SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+%D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 %C%_gencode_SOURCES = %D%/gencode.c
 
diff --git a/sim/v850/local.mk b/sim/v850/local.mk
index 4741e070a300..2c27d0c6d7ea 100644
--- a/sim/v850/local.mk
+++ b/sim/v850/local.mk
@@ -55,6 +55,7 @@ BUILT_SOURCES += \
 
 ## This makes sure build tools are available before building the arch-subdirs.
 SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+%D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 $(%C%_BUILT_SRC_FROM_IGEN): %D%/stamp-igen
 
-- 
2.39.0


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

* [PATCH 03/83] sim: build: drop support for subdir extra deps
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
  2023-01-03  7:54 ` [PATCH 01/83] sim: mips: add multi source to built sources Mike Frysinger
  2023-01-03  7:54 ` [PATCH 02/83] sim: modules: trigger generation from top-level Mike Frysinger
@ 2023-01-03  7:54 ` Mike Frysinger
  2023-01-03  7:54 ` [PATCH 04/83] sim: aarch64: move libsim.a creation to top-level Mike Frysinger
                   ` (79 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:54 UTC (permalink / raw)
  To: gdb-patches

Nothing uses this hook anymore, so punt it.  It was largely used to
track generated files (which we do in the top-level now) and extra
header files (which we use automake depgen for now).
---
 sim/README-HACKING        |  3 ---
 sim/common/Make-common.in | 14 --------------
 2 files changed, 17 deletions(-)

diff --git a/sim/README-HACKING b/sim/README-HACKING
index c47eef8ce73b..38d871b15141 100644
--- a/sim/README-HACKING
+++ b/sim/README-HACKING
@@ -46,9 +46,6 @@ The Makefile.in of a simulator using the common framework should look like:
 
 # List of object files, less common parts.
 SIM_OBJS =
-# List of extra dependencies.
-# Generally this consists of simulator specific files included by sim-main.h.
-SIM_EXTRA_DEPS =
 # List of flags to always pass to $(CC).
 SIM_EXTRA_CFLAGS =
 # Dependency of `clean' to clean any extra files.
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index b56a49a0051f..ab26c4943592 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -85,9 +85,6 @@ POSTCOMPILE = @true
 
 # List of object files, less common parts.
 SIM_OBJS =
-# List of extra dependencies.
-# Generally this consists of simulator specific files included by sim-main.h.
-SIM_EXTRA_DEPS =
 # List of flags to always pass to $(CC).
 SIM_EXTRA_CFLAGS =
 # List of main object files for `run'.
@@ -185,17 +182,6 @@ override POSTCOMPILE =
 endif
 
 all_object_files = $(LIB_OBJS) $(SIM_RUN_OBJS)
-generated_files = \
-	$(SIM_EXTRA_DEPS)
-
-# Ensure that generated files are created early.  Use order-only
-# dependencies if available.  They require GNU make 3.80 or newer,
-# and the .VARIABLES variable was introduced at the same time.
-ifdef .VARIABLES
-$(all_object_files): | $(generated_files)
-else
-$(all_object_files) : $(generated_files)
-endif
 
 # Dependencies.
 -include $(patsubst %.o, $(DEPDIR)/%.Po, $(all_object_files))
-- 
2.39.0


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

* [PATCH 04/83] sim: aarch64: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (2 preceding siblings ...)
  2023-01-03  7:54 ` [PATCH 03/83] sim: build: drop support for subdir extra deps Mike Frysinger
@ 2023-01-03  7:54 ` Mike Frysinger
  2023-01-03  7:54 ` [PATCH 05/83] sim: arm: " Mike Frysinger
                   ` (78 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:54 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in           | 280 ++++++++++++++++++++++----------------
 sim/aarch64/Makefile.in   |   9 +-
 sim/aarch64/local.mk      |  21 +++
 sim/common/Make-common.in |   3 +-
 4 files changed, 184 insertions(+), 129 deletions(-)

diff --git a/sim/aarch64/Makefile.in b/sim/aarch64/Makefile.in
index 0c959d15aaec..94c624291575 100644
--- a/sim/aarch64/Makefile.in
+++ b/sim/aarch64/Makefile.in
@@ -21,13 +21,6 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_OBJS = \
-	$(SIM_NEW_COMMON_OBJS) \
-	interp.o \
-	cpustate.o \
-	simulator.o \
-	memory.o \
-	sim-resume.o \
+SIM_LIBSIM =
 
 ## COMMON_POST_CONFIG_FRAG
-
diff --git a/sim/aarch64/local.mk b/sim/aarch64/local.mk
index 9eed54950933..c986602449a5 100644
--- a/sim/aarch64/local.mk
+++ b/sim/aarch64/local.mk
@@ -16,6 +16,27 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/cpustate.o \
+	%D%/interp.o \
+	%D%/memory.o \
+	%D%/modules.o \
+	%D%/sim-resume.o \
+	%D%/simulator.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index ab26c4943592..e14997ae1363 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -89,6 +89,7 @@ SIM_OBJS =
 SIM_EXTRA_CFLAGS =
 # List of main object files for `run'.
 SIM_RUN_OBJS = nrun.o
+SIM_LIBSIM = libsim.a
 # Dependency of `clean' to clean any extra files.
 SIM_EXTRA_CLEAN =
 
@@ -152,7 +153,7 @@ LINK_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(LDFLAGS_FOR_BUILD) -o $@
 
 RUNTESTFLAGS =
 
-all: libsim.a $(SIM_RUN_OBJS)
+all: $(SIM_LIBSIM) $(LIB_OBJS) $(SIM_RUN_OBJS)
 
 libsim.a: $(LIB_OBJS)
 	$(SILENCE) rm -f libsim.a
-- 
2.39.0


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

* [PATCH 05/83] sim: arm: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (3 preceding siblings ...)
  2023-01-03  7:54 ` [PATCH 04/83] sim: aarch64: move libsim.a creation to top-level Mike Frysinger
@ 2023-01-03  7:54 ` Mike Frysinger
  2023-01-03  7:54 ` [PATCH 06/83] sim: avr: " Mike Frysinger
                   ` (77 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:54 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in     | 278 +++++++++++++++++++++++++-------------------
 sim/arm/Makefile.in |   7 +-
 sim/arm/local.mk    |  21 ++++
 3 files changed, 181 insertions(+), 125 deletions(-)

diff --git a/sim/arm/Makefile.in b/sim/arm/Makefile.in
index 9dda82be86f1..cdf371d844c7 100644
--- a/sim/arm/Makefile.in
+++ b/sim/arm/Makefile.in
@@ -19,11 +19,6 @@
 
 SIM_EXTRA_CFLAGS = -DMODET
 
-SIM_OBJS = \
-	wrapper.o \
-	$(SIM_NEW_COMMON_OBJS) \
-	armemu.o armemu32.o arminit.o armos.o armsupp.o \
-	armvirt.o thumbemu.o \
-	armcopro.o maverick.o iwmmxt.o
+SIM_LIBSIM =
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/arm/local.mk b/sim/arm/local.mk
index 4bbbf92cc741..e3ce50fc81ab 100644
--- a/sim/arm/local.mk
+++ b/sim/arm/local.mk
@@ -16,6 +16,27 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	%D%/wrapper.o \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/armemu.o \
+	%D%/armemu32.o %D%/arminit.o %D%/armos.o %D%/armsupp.o \
+	%D%/armvirt.o %D%/thumbemu.o \
+	%D%/armcopro.o %D%/maverick.o %D%/iwmmxt.o \
+	%D%/modules.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 06/83] sim: avr: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (4 preceding siblings ...)
  2023-01-03  7:54 ` [PATCH 05/83] sim: arm: " Mike Frysinger
@ 2023-01-03  7:54 ` Mike Frysinger
  2023-01-03  7:54 ` [PATCH 07/83] sim: bfin: " Mike Frysinger
                   ` (76 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:54 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in     | 266 +++++++++++++++++++++++++-------------------
 sim/avr/Makefile.in |   5 +-
 sim/avr/local.mk    |  18 +++
 3 files changed, 168 insertions(+), 121 deletions(-)

diff --git a/sim/avr/Makefile.in b/sim/avr/Makefile.in
index 579c2322c5ba..eaf6c4b6a977 100644
--- a/sim/avr/Makefile.in
+++ b/sim/avr/Makefile.in
@@ -16,9 +16,6 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_OBJS = \
-	interp.o \
-	$(SIM_NEW_COMMON_OBJS) \
-	sim-resume.o
+SIM_LIBSIM =
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/avr/local.mk b/sim/avr/local.mk
index a667abd839f4..84ba9d6f6e4f 100644
--- a/sim/avr/local.mk
+++ b/sim/avr/local.mk
@@ -15,6 +15,24 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	%D%/interp.o \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/modules.o \
+	%D%/sim-resume.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 07/83] sim: bfin: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (5 preceding siblings ...)
  2023-01-03  7:54 ` [PATCH 06/83] sim: avr: " Mike Frysinger
@ 2023-01-03  7:54 ` Mike Frysinger
  2023-01-03  7:54 ` [PATCH 08/83] sim: bpf: " Mike Frysinger
                   ` (75 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:54 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in      | 274 +++++++++++++++++++++++++------------------
 sim/bfin/Makefile.in |   9 +-
 sim/bfin/local.mk    |  23 ++++
 3 files changed, 181 insertions(+), 125 deletions(-)

diff --git a/sim/bfin/Makefile.in b/sim/bfin/Makefile.in
index 2ecad1d8af7b..700e641d149c 100644
--- a/sim/bfin/Makefile.in
+++ b/sim/bfin/Makefile.in
@@ -19,14 +19,7 @@
 
 arch = bfin
 
-SIM_OBJS = \
-	$(SIM_NEW_COMMON_OBJS) \
-	bfin-sim.o \
-	devices.o \
-	gui.o \
-	interp.o \
-	machs.o \
-	sim-resume.o
+SIM_LIBSIM =
 
 SIM_EXTRA_CFLAGS = $(SDL_CFLAGS)
 
diff --git a/sim/bfin/local.mk b/sim/bfin/local.mk
index 80df254c786f..95bc73000cb8 100644
--- a/sim/bfin/local.mk
+++ b/sim/bfin/local.mk
@@ -16,6 +16,29 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
+	%D%/bfin-sim.o \
+	%D%/devices.o \
+	%D%/gui.o \
+	%D%/interp.o \
+	%D%/machs.o \
+	%D%/modules.o \
+	%D%/sim-resume.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 08/83] sim: bpf: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (6 preceding siblings ...)
  2023-01-03  7:54 ` [PATCH 07/83] sim: bfin: " Mike Frysinger
@ 2023-01-03  7:54 ` Mike Frysinger
  2023-01-03  7:54 ` [PATCH 09/83] sim: cr16: " Mike Frysinger
                   ` (74 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:54 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in     | 285 ++++++++++++++++++++++++++------------------
 sim/bpf/Makefile.in |  13 +-
 sim/bpf/local.mk    |  35 ++++++
 3 files changed, 207 insertions(+), 126 deletions(-)

diff --git a/sim/bpf/Makefile.in b/sim/bpf/Makefile.in
index 2732a0e6071e..1fc98a68cbe5 100644
--- a/sim/bpf/Makefile.in
+++ b/sim/bpf/Makefile.in
@@ -18,18 +18,7 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-CGEN_STD_OBJS = cgen-run.o cgen-scache.o cgen-trace.o cgen-utils.o
-BPF_GEN_OBJS = arch.o cpu.o \
-               decode-le.o decode-be.o \
-               sem-le.o sem-be.o \
-               mloop-le.o mloop-be.o
-BPF_HAND_OBJS = bpf.o sim-if.o traps.o bpf-helpers.o
-
-SIM_OBJS = \
-	$(SIM_NEW_COMMON_OBJS) \
-	$(CGEN_STD_OBJS) \
-	$(BPF_GEN_OBJS) \
-	$(BPF_HAND_OBJS)
+SIM_LIBSIM =
 
 SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=64
 
diff --git a/sim/bpf/local.mk b/sim/bpf/local.mk
index f86f3306a8a9..19dcc25736c1 100644
--- a/sim/bpf/local.mk
+++ b/sim/bpf/local.mk
@@ -15,6 +15,41 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/modules.o \
+	\
+	%D%/cgen-run.o \
+	%D%/cgen-scache.o \
+	%D%/cgen-trace.o \
+	%D%/cgen-utils.o \
+	\
+	%D%/arch.o \
+	%D%/cpu.o \
+	%D%/decode-le.o \
+	%D%/decode-be.o \
+	%D%/sem-le.o \
+	%D%/sem-be.o \
+	%D%/mloop-le.o \
+	%D%/mloop-be.o \
+	\
+	%D%/bpf.o \
+	%D%/bpf-helpers.o \
+	%D%/sim-if.o \
+	%D%/traps.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 09/83] sim: cr16: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (7 preceding siblings ...)
  2023-01-03  7:54 ` [PATCH 08/83] sim: bpf: " Mike Frysinger
@ 2023-01-03  7:54 ` Mike Frysinger
  2023-01-03  7:54 ` [PATCH 10/83] sim: cris: " Mike Frysinger
                   ` (73 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:54 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in      | 256 ++++++++++++++++++++++++-------------------
 sim/cr16/Makefile.in |   7 +-
 sim/cr16/local.mk    |  20 ++++
 3 files changed, 167 insertions(+), 116 deletions(-)

diff --git a/sim/cr16/Makefile.in b/sim/cr16/Makefile.in
index 0f30bc9623db..da5062dc39ce 100644
--- a/sim/cr16/Makefile.in
+++ b/sim/cr16/Makefile.in
@@ -17,11 +17,6 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_OBJS = \
-	$(SIM_NEW_COMMON_OBJS) \
-	sim-resume.o \
-	interp.o \
-	table.o \
-	simops.o
+SIM_LIBSIM =
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/cr16/local.mk b/sim/cr16/local.mk
index 8e28cc356f58..b0d7ad7cad7a 100644
--- a/sim/cr16/local.mk
+++ b/sim/cr16/local.mk
@@ -16,6 +16,26 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/interp.o \
+	%D%/modules.o \
+	%D%/sim-resume.o \
+	%D%/simops.o \
+	%D%/table.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 10/83] sim: cris: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (8 preceding siblings ...)
  2023-01-03  7:54 ` [PATCH 09/83] sim: cr16: " Mike Frysinger
@ 2023-01-03  7:54 ` Mike Frysinger
  2023-01-03  7:54 ` [PATCH 11/83] sim: d10v: " Mike Frysinger
                   ` (72 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:54 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in      | 271 ++++++++++++++++++++++++++-----------------
 sim/cris/Makefile.in |  12 +-
 sim/cris/local.mk    |  37 ++++++
 3 files changed, 205 insertions(+), 115 deletions(-)

diff --git a/sim/cris/Makefile.in b/sim/cris/Makefile.in
index 0a045ca06778..142825fa26d3 100644
--- a/sim/cris/Makefile.in
+++ b/sim/cris/Makefile.in
@@ -21,16 +21,6 @@
 
 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
-
-SIM_OBJS = \
-	$(SIM_NEW_COMMON_OBJS) \
-	cgen-utils.o cgen-trace.o cgen-scache.o \
-	cgen-run.o \
-	sim-if.o arch.o \
-	$(CRISV10F_OBJS) \
-	$(CRISV32F_OBJS) \
-	traps.o
+SIM_LIBSIM =
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/cris/local.mk b/sim/cris/local.mk
index d55e7b84e25b..912ca12a32f4 100644
--- a/sim/cris/local.mk
+++ b/sim/cris/local.mk
@@ -16,6 +16,43 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
+	%D%/modules.o \
+	\
+	%D%/cgen-run.o \
+	%D%/cgen-scache.o \
+	%D%/cgen-trace.o \
+	%D%/cgen-utils.o \
+	\
+	%D%/arch.o \
+	%D%/crisv10f.o \
+	%D%/cpuv10.o \
+	%D%/decodev10.o \
+	%D%/modelv10.o \
+	%D%/mloopv10f.o \
+	%D%/crisv32f.o \
+	%D%/cpuv32.o \
+	%D%/decodev32.o \
+	%D%/modelv32.o \
+	%D%/mloopv32f.o \
+	\
+	%D%/sim-if.o \
+	%D%/traps.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 11/83] sim: d10v: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (9 preceding siblings ...)
  2023-01-03  7:54 ` [PATCH 10/83] sim: cris: " Mike Frysinger
@ 2023-01-03  7:54 ` Mike Frysinger
  2023-01-03  7:54 ` [PATCH 12/83] sim: erc32: " Mike Frysinger
                   ` (71 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:54 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in      | 232 +++++++++++++++++++++++++------------------
 sim/d10v/Makefile.in |   8 +-
 sim/d10v/local.mk    |  21 ++++
 3 files changed, 157 insertions(+), 104 deletions(-)

diff --git a/sim/d10v/Makefile.in b/sim/d10v/Makefile.in
index a2ccd4e1b773..6f209a2db1f7 100644
--- a/sim/d10v/Makefile.in
+++ b/sim/d10v/Makefile.in
@@ -17,12 +17,6 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_OBJS = \
-	interp.o \
-	$(SIM_NEW_COMMON_OBJS) \
-	sim-resume.o \
-	table.o \
-	simops.o \
-	endian.o
+SIM_LIBSIM =
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/d10v/local.mk b/sim/d10v/local.mk
index 2556845ed1d1..c9ca13f720c1 100644
--- a/sim/d10v/local.mk
+++ b/sim/d10v/local.mk
@@ -16,6 +16,27 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	%D%/interp.o \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/endian.o \
+	%D%/modules.o \
+	%D%/sim-resume.o \
+	%D%/simops.o \
+	%D%/table.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 12/83] sim: erc32: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (10 preceding siblings ...)
  2023-01-03  7:54 ` [PATCH 11/83] sim: d10v: " Mike Frysinger
@ 2023-01-03  7:54 ` Mike Frysinger
  2023-01-03  7:54 ` [PATCH 13/83] sim: example-synacor: " Mike Frysinger
                   ` (70 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:54 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in       | 219 ++++++++++++++++++++++++------------------
 sim/erc32/Makefile.in |   5 +-
 sim/erc32/local.mk    |  24 ++++-
 3 files changed, 148 insertions(+), 100 deletions(-)

diff --git a/sim/erc32/Makefile.in b/sim/erc32/Makefile.in
index d10eb0eb1a4c..252427d4a388 100644
--- a/sim/erc32/Makefile.in
+++ b/sim/erc32/Makefile.in
@@ -18,10 +18,11 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
+SIM_LIBSIM =
+SIM_RUN_OBJS =
+
 READLINE_SRC = $(srcroot)/readline/readline
 
-SIM_OBJS = exec.o erc32.o func.o help.o float.o interf.o
-SIM_RUN_OBJS = sis.o
 SIM_EXTRA_CFLAGS = $(READLINE_CFLAGS)
 
 # UARTS run at about 115200 baud (simulator time). Add -DFAST_UART to
diff --git a/sim/erc32/local.mk b/sim/erc32/local.mk
index 65935fe082f0..7c95128a1668 100644
--- a/sim/erc32/local.mk
+++ b/sim/erc32/local.mk
@@ -17,6 +17,26 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	%D%/erc32.o \
+	%D%/exec.o \
+	%D%/float.o \
+	%D%/func.o \
+	%D%/help.o \
+	%D%/interf.o \
+	%D%/modules.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/sis.o \
@@ -26,10 +46,6 @@
 %D%/sis$(EXEEXT): %D%/run$(EXEEXT)
 	$(AM_V_GEN)ln $< $@ 2>/dev/null || $(LN_S) $< $@ 2>/dev/null || cp -p $< $@
 
-## Helper targets for running make from the top-level due to run's sis.o.
-%D%/%.o: %D%/%.c | %D%/libsim.a $(SIM_ALL_RECURSIVE_DEPS)
-	$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 noinst_PROGRAMS += %D%/run %D%/sis
 
 %C%docdir = $(docdir)/%C%
-- 
2.39.0


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

* [PATCH 13/83] sim: example-synacor: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (11 preceding siblings ...)
  2023-01-03  7:54 ` [PATCH 12/83] sim: erc32: " Mike Frysinger
@ 2023-01-03  7:54 ` Mike Frysinger
  2023-01-03  7:54 ` [PATCH 14/83] sim: frv: " Mike Frysinger
                   ` (69 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:54 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in                 | 209 +++++++++++++++++++-------------
 sim/example-synacor/Makefile.in |   6 +-
 sim/example-synacor/local.mk    |  19 +++
 3 files changed, 143 insertions(+), 91 deletions(-)

diff --git a/sim/example-synacor/Makefile.in b/sim/example-synacor/Makefile.in
index 48713d2c4aaa..cece1e543ca7 100644
--- a/sim/example-synacor/Makefile.in
+++ b/sim/example-synacor/Makefile.in
@@ -17,10 +17,6 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_OBJS = \
-	$(SIM_NEW_COMMON_OBJS) \
-	sim-resume.o \
-	interp.o \
-	sim-main.o
+SIM_LIBSIM =
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/example-synacor/local.mk b/sim/example-synacor/local.mk
index 0ca2d1378f6e..9f00eebc26e5 100644
--- a/sim/example-synacor/local.mk
+++ b/sim/example-synacor/local.mk
@@ -16,6 +16,25 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/interp.o \
+	%D%/modules.o \
+	%D%/sim-main.o \
+	%D%/sim-resume.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 14/83] sim: frv: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (12 preceding siblings ...)
  2023-01-03  7:54 ` [PATCH 13/83] sim: example-synacor: " Mike Frysinger
@ 2023-01-03  7:54 ` Mike Frysinger
  2023-01-03  7:54 ` [PATCH 15/83] sim: ft32: " Mike Frysinger
                   ` (68 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:54 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in     | 246 +++++++++++++++++++++++++++++---------------
 sim/frv/Makefile.in |  12 +--
 sim/frv/local.mk    |  47 +++++++++
 3 files changed, 209 insertions(+), 96 deletions(-)

diff --git a/sim/frv/Makefile.in b/sim/frv/Makefile.in
index a13765589da9..12af397f4c1e 100644
--- a/sim/frv/Makefile.in
+++ b/sim/frv/Makefile.in
@@ -17,17 +17,7 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-FRV_OBJS = frv.o cpu.o decode.o sem.o model.o mloop.o cgen-par.o
-
-SIM_OBJS = \
-	$(SIM_NEW_COMMON_OBJS) \
-	cgen-utils.o cgen-trace.o cgen-scache.o cgen-fpu.o cgen-accfp.o \
-	cgen-run.o \
-	sim-if.o arch.o \
-	$(FRV_OBJS) \
-	traps.o interrupts.o memory.o cache.o pipeline.o \
-	profile.o profile-fr400.o profile-fr450.o profile-fr500.o profile-fr550.o options.o \
-	reset.o registers.o
+SIM_LIBSIM =
 
 SIM_EXTRA_CFLAGS = @SIM_FRV_TRAPDUMP_FLAGS@
 
diff --git a/sim/frv/local.mk b/sim/frv/local.mk
index 471b0adc6533..2451235d2385 100644
--- a/sim/frv/local.mk
+++ b/sim/frv/local.mk
@@ -16,6 +16,53 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/modules.o \
+	\
+	%D%/cgen-accfp.o \
+	%D%/cgen-fpu.o \
+	%D%/cgen-run.o \
+	%D%/cgen-scache.o \
+	%D%/cgen-trace.o \
+	%D%/cgen-utils.o \
+	\
+	%D%/arch.o \
+	%D%/cgen-par.o \
+	%D%/cpu.o \
+	%D%/decode.o \
+	%D%/frv.o \
+	%D%/mloop.o \
+	%D%/model.o \
+	%D%/sem.o \
+	\
+	%D%/cache.o \
+	%D%/interrupts.o \
+	%D%/memory.o \
+	%D%/options.o \
+	%D%/pipeline.o \
+	%D%/profile.o \
+	%D%/profile-fr400.o \
+	%D%/profile-fr450.o \
+	%D%/profile-fr500.o \
+	%D%/profile-fr550.o \
+	%D%/registers.o \
+	%D%/reset.o \
+	%D%/sim-if.o \
+	%D%/traps.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 15/83] sim: ft32: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (13 preceding siblings ...)
  2023-01-03  7:54 ` [PATCH 14/83] sim: frv: " Mike Frysinger
@ 2023-01-03  7:54 ` Mike Frysinger
  2023-01-03  7:54 ` [PATCH 16/83] sim: h8300: " Mike Frysinger
                   ` (67 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:54 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in      | 195 +++++++++++++++++++++++++------------------
 sim/ft32/Makefile.in |   6 +-
 sim/ft32/local.mk    |  18 ++++
 3 files changed, 133 insertions(+), 86 deletions(-)

diff --git a/sim/ft32/Makefile.in b/sim/ft32/Makefile.in
index 8a324afc0e30..a84512eaac46 100644
--- a/sim/ft32/Makefile.in
+++ b/sim/ft32/Makefile.in
@@ -17,10 +17,6 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-
-SIM_OBJS = \
-	$(SIM_NEW_COMMON_OBJS) \
-	interp.o	\
-	sim-resume.o
+SIM_LIBSIM =
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/ft32/local.mk b/sim/ft32/local.mk
index 65a6817c102b..2752f268e046 100644
--- a/sim/ft32/local.mk
+++ b/sim/ft32/local.mk
@@ -16,6 +16,24 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/interp.o \
+	%D%/modules.o \
+	%D%/sim-resume.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 16/83] sim: h8300: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (14 preceding siblings ...)
  2023-01-03  7:54 ` [PATCH 15/83] sim: ft32: " Mike Frysinger
@ 2023-01-03  7:54 ` Mike Frysinger
  2023-01-03  7:54 ` [PATCH 17/83] sim: iq2000: " Mike Frysinger
                   ` (66 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:54 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in       | 193 +++++++++++++++++++++++++-----------------
 sim/h8300/Makefile.in |   4 +-
 sim/h8300/local.mk    |  18 ++++
 3 files changed, 132 insertions(+), 83 deletions(-)

diff --git a/sim/h8300/Makefile.in b/sim/h8300/Makefile.in
index 14d7c2aca637..6843a400826a 100644
--- a/sim/h8300/Makefile.in
+++ b/sim/h8300/Makefile.in
@@ -17,8 +17,6 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_OBJS = compile.o \
-	$(SIM_NEW_COMMON_OBJS) \
-	sim-resume.o
+SIM_LIBSIM =
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/h8300/local.mk b/sim/h8300/local.mk
index b2d212c9967a..65aa081a1ca9 100644
--- a/sim/h8300/local.mk
+++ b/sim/h8300/local.mk
@@ -16,6 +16,24 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	%D%/compile.o \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/modules.o \
+	%D%/sim-resume.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 17/83] sim: iq2000: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (15 preceding siblings ...)
  2023-01-03  7:54 ` [PATCH 16/83] sim: h8300: " Mike Frysinger
@ 2023-01-03  7:54 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 18/83] sim: lm32: " Mike Frysinger
                   ` (65 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:54 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in        | 212 ++++++++++++++++++++++++++---------------
 sim/iq2000/Makefile.in |   9 +-
 sim/iq2000/local.mk    |  31 ++++++
 3 files changed, 165 insertions(+), 87 deletions(-)

diff --git a/sim/iq2000/Makefile.in b/sim/iq2000/Makefile.in
index c0fb6507ca69..b4679a484391 100644
--- a/sim/iq2000/Makefile.in
+++ b/sim/iq2000/Makefile.in
@@ -17,14 +17,7 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-IQ2000_OBJS = iq2000.o cpu.o decode.o sem.o model.o mloop.o
-
-SIM_OBJS = \
-	$(SIM_NEW_COMMON_OBJS) \
-	cgen-utils.o cgen-trace.o cgen-scache.o \
-	cgen-run.o \
-	sim-if.o arch.o \
-	$(IQ2000_OBJS)
+SIM_LIBSIM =
 
 ## COMMON_POST_CONFIG_FRAG
 
diff --git a/sim/iq2000/local.mk b/sim/iq2000/local.mk
index 4113b4bc2f39..98385a07f580 100644
--- a/sim/iq2000/local.mk
+++ b/sim/iq2000/local.mk
@@ -16,6 +16,37 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/modules.o \
+	\
+	%D%/cgen-run.o \
+	%D%/cgen-scache.o \
+	%D%/cgen-trace.o \
+	%D%/cgen-utils.o \
+	\
+	%D%/arch.o \
+	%D%/cpu.o \
+	%D%/decode.o \
+	%D%/iq2000.o \
+	%D%/sem.o \
+	%D%/mloop.o \
+	%D%/model.o \
+	\
+	%D%/sim-if.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 18/83] sim: lm32: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (16 preceding siblings ...)
  2023-01-03  7:54 ` [PATCH 17/83] sim: iq2000: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 19/83] sim: m32c: " Mike Frysinger
                   ` (64 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in      | 206 +++++++++++++++++++++++++++----------------
 sim/lm32/Makefile.in |   9 +-
 sim/lm32/local.mk    |  34 +++++++
 3 files changed, 167 insertions(+), 82 deletions(-)

diff --git a/sim/lm32/Makefile.in b/sim/lm32/Makefile.in
index a39420f59270..cee1935ba341 100644
--- a/sim/lm32/Makefile.in
+++ b/sim/lm32/Makefile.in
@@ -5,13 +5,6 @@
 
 arch = lm32
 
-# List of object files, less common parts.
-SIM_OBJS = \
-	$(SIM_NEW_COMMON_OBJS) \
-        cgen-utils.o cgen-trace.o cgen-scache.o \
-        cgen-run.o \
-        sim-if.o arch.o \
-        cpu.o decode.o sem.o model.o mloop.o \
-        lm32.o traps.o user.o 
+SIM_LIBSIM =
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/lm32/local.mk b/sim/lm32/local.mk
index 311de7df47e8..987f2ac25b83 100644
--- a/sim/lm32/local.mk
+++ b/sim/lm32/local.mk
@@ -16,6 +16,40 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
+	%D%/modules.o \
+	\
+	%D%/cgen-run.o \
+	%D%/cgen-scache.o \
+	%D%/cgen-trace.o \
+	%D%/cgen-utils.o \
+	\
+	%D%/arch.o \
+	%D%/cpu.o \
+	%D%/decode.o \
+	%D%/sem.o \
+	%D%/mloop.o \
+	%D%/model.o \
+	\
+	%D%/lm32.o \
+	%D%/sim-if.o \
+	%D%/traps.o \
+	%D%/user.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 19/83] sim: m32c: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (17 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 18/83] sim: lm32: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 20/83] sim: m32r: " Mike Frysinger
                   ` (63 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in      | 181 ++++++++++++++++++++++++++-----------------
 sim/m32c/Makefile.in |  16 +---
 sim/m32c/local.mk    |  29 ++++++-
 3 files changed, 136 insertions(+), 90 deletions(-)

diff --git a/sim/m32c/Makefile.in b/sim/m32c/Makefile.in
index 36ca59e195ac..cbe0c916e485 100644
--- a/sim/m32c/Makefile.in
+++ b/sim/m32c/Makefile.in
@@ -22,19 +22,7 @@
 
 SIM_EXTRA_CFLAGS = -DTIMER_A
 
-SIM_RUN_OBJS = main.o
-
-SIM_OBJS = \
-	gdb-if.o \
-	int.o \
-	load.o \
-	mem.o \
-	misc.o \
-	reg.o \
-	r8c.o \
-	m32c.o \
-	srcdest.o \
-	syscalls.o \
-	trace.o
+SIM_LIBSIM =
+SIM_RUN_OBJS =
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/m32c/local.mk b/sim/m32c/local.mk
index 75909075a1e3..56332402f329 100644
--- a/sim/m32c/local.mk
+++ b/sim/m32c/local.mk
@@ -16,6 +16,31 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	%D%/gdb-if.o \
+	%D%/int.o \
+	%D%/load.o \
+	%D%/m32c.o \
+	%D%/mem.o \
+	%D%/misc.o \
+	%D%/modules.o \
+	%D%/r8c.o \
+	%D%/reg.o \
+	%D%/srcdest.o \
+	%D%/syscalls.o \
+	%D%/trace.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/main.o \
@@ -24,10 +49,6 @@
 
 noinst_PROGRAMS += %D%/run
 
-## Helper targets for running make from the top-level due to run's main.o.
-%D%/%.o: %D%/%.c | %D%/libsim.a $(SIM_ALL_RECURSIVE_DEPS)
-	$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %C%_BUILD_OUTPUTS = \
 	%D%/opc2c$(EXEEXT) \
 	%D%/m32c.c \
-- 
2.39.0


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

* [PATCH 20/83] sim: m32r: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (18 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 19/83] sim: m32c: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 21/83] sim: m68hc11: " Mike Frysinger
                   ` (62 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in      | 203 +++++++++++++++++++++++++++++--------------
 sim/m32r/Makefile.in |  14 +--
 sim/m32r/local.mk    |  46 ++++++++++
 3 files changed, 186 insertions(+), 77 deletions(-)

diff --git a/sim/m32r/Makefile.in b/sim/m32r/Makefile.in
index 644d8de7dd1d..08cda449ca16 100644
--- a/sim/m32r/Makefile.in
+++ b/sim/m32r/Makefile.in
@@ -21,19 +21,7 @@
 
 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
-
-SIM_OBJS = \
-	$(SIM_NEW_COMMON_OBJS) \
-	cgen-utils.o cgen-trace.o cgen-scache.o \
-	cgen-run.o \
-	sim-if.o arch.o \
-	$(M32R_OBJS) \
-	$(M32RX_OBJS) \
-	$(M32R2_OBJS) \
-	traps.o
+SIM_LIBSIM =
 
 # Some modules don't build cleanly yet.
 cpu.o cpu2.o cpux.o m32r.o m32r2.o m32rx.o mloop.o mloop2.o mloopx.o sem.o sim-if.o traps.o: SIM_WERROR_CFLAGS =
diff --git a/sim/m32r/local.mk b/sim/m32r/local.mk
index 9814ae5c6c16..afecaf6c8bce 100644
--- a/sim/m32r/local.mk
+++ b/sim/m32r/local.mk
@@ -16,6 +16,52 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
+	%D%/modules.o \
+	\
+	%D%/cgen-run.o \
+	%D%/cgen-scache.o \
+	%D%/cgen-trace.o \
+	%D%/cgen-utils.o \
+	\
+	%D%/arch.o \
+	\
+	%D%/m32r.o \
+	%D%/cpu.o \
+	%D%/decode.o \
+	%D%/sem.o \
+	%D%/model.o \
+	%D%/mloop.o \
+	\
+	%D%/m32rx.o \
+	%D%/cpux.o \
+	%D%/decodex.o \
+	%D%/modelx.o \
+	%D%/mloopx.o \
+	\
+	%D%/m32r2.o \
+	%D%/cpu2.o \
+	%D%/decode2.o \
+	%D%/model2.o \
+	%D%/mloop2.o \
+	\
+	%D%/sim-if.o \
+	%D%/traps.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 21/83] sim: m68hc11: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (19 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 20/83] sim: m32r: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 22/83] sim: mcore: " Mike Frysinger
                   ` (61 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in         | 168 +++++++++++++++++++++++++---------------
 sim/m68hc11/Makefile.in |   7 +-
 sim/m68hc11/local.mk    |  24 ++++++
 3 files changed, 132 insertions(+), 67 deletions(-)

diff --git a/sim/m68hc11/Makefile.in b/sim/m68hc11/Makefile.in
index 04b926c48c2c..f67a94cf9401 100644
--- a/sim/m68hc11/Makefile.in
+++ b/sim/m68hc11/Makefile.in
@@ -19,12 +19,7 @@
 
 arch = m68hc11
 
-M68HC11_OBJS = interp.o m68hc11int.o m68hc12int.o \
-		emulos.o interrupts.o m68hc11_sim.o
-
-SIM_OBJS = $(M68HC11_OBJS) \
-	$(SIM_NEW_COMMON_OBJS) \
-	sim-resume.o
+SIM_LIBSIM =
 
 # We must use 32-bit addresses to support memory bank switching.
 # The WORD_BITSIZE is normally 16 but must be switched (temporarily)
diff --git a/sim/m68hc11/local.mk b/sim/m68hc11/local.mk
index d2e04576a771..9b52df6b533c 100644
--- a/sim/m68hc11/local.mk
+++ b/sim/m68hc11/local.mk
@@ -16,6 +16,30 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	%D%/interp.o \
+	%D%/m68hc11int.o \
+	%D%/m68hc12int.o \
+	%D%/emulos.o \
+	%D%/interrupts.o \
+	%D%/m68hc11_sim.o \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
+	%D%/modules.o \
+	%D%/sim-resume.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 22/83] sim: mcore: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (20 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 21/83] sim: m68hc11: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 23/83] sim: microblaze: " Mike Frysinger
                   ` (60 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in       | 139 ++++++++++++++++++++++++++----------------
 sim/mcore/Makefile.in |   5 +-
 sim/mcore/local.mk    |  18 ++++++
 3 files changed, 105 insertions(+), 57 deletions(-)

diff --git a/sim/mcore/Makefile.in b/sim/mcore/Makefile.in
index 4f9272a554bf..502e8a44a73c 100644
--- a/sim/mcore/Makefile.in
+++ b/sim/mcore/Makefile.in
@@ -17,9 +17,6 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_OBJS = \
-	interp.o \
-	$(SIM_NEW_COMMON_OBJS) \
-	sim-resume.o
+SIM_LIBSIM =
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/mcore/local.mk b/sim/mcore/local.mk
index c9fc789113e6..94abebc1dbbc 100644
--- a/sim/mcore/local.mk
+++ b/sim/mcore/local.mk
@@ -16,6 +16,24 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	%D%/interp.o \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/modules.o \
+	%D%/sim-resume.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 23/83] sim: microblaze: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (21 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 22/83] sim: mcore: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 24/83] sim: mips: " Mike Frysinger
                   ` (59 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in            | 140 +++++++++++++++++++++++--------------
 sim/microblaze/Makefile.in |   5 +-
 sim/microblaze/local.mk    |  18 +++++
 3 files changed, 106 insertions(+), 57 deletions(-)

diff --git a/sim/microblaze/Makefile.in b/sim/microblaze/Makefile.in
index 4f9272a554bf..502e8a44a73c 100644
--- a/sim/microblaze/Makefile.in
+++ b/sim/microblaze/Makefile.in
@@ -17,9 +17,6 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_OBJS = \
-	interp.o \
-	$(SIM_NEW_COMMON_OBJS) \
-	sim-resume.o
+SIM_LIBSIM =
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/microblaze/local.mk b/sim/microblaze/local.mk
index c9fc789113e6..94abebc1dbbc 100644
--- a/sim/microblaze/local.mk
+++ b/sim/microblaze/local.mk
@@ -16,6 +16,24 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	%D%/interp.o \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/modules.o \
+	%D%/sim-resume.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 24/83] sim: mips: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (22 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 23/83] sim: microblaze: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 25/83] sim: mn10300: " Mike Frysinger
                   ` (58 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.

The mips code is a little more tricky than others because, for multi-run
targets, it generates the list of sources & objects on the fly in the
configure script.
---
 sim/Makefile.in       | 261 +++++++++++++++++++++++++++---------------
 sim/configure         |  20 ++--
 sim/mips/Makefile.in  |  44 +------
 sim/mips/acinclude.m4 |  20 ++--
 sim/mips/local.mk     |  59 ++++++++++
 5 files changed, 251 insertions(+), 153 deletions(-)

diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in
index eb20977c5cc6..c79a831dd782 100644
--- a/sim/mips/Makefile.in
+++ b/sim/mips/Makefile.in
@@ -3,51 +3,9 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_MIPS_GEN = @SIM_MIPS_GEN@
-SIM_MIPS_MULTI_OBJ = @SIM_MIPS_MULTI_OBJ@
-
 arch = mips
 
-# Object files created by various simulator generators.
-
-
-SIM_SINGLE_OBJ = \
-	support.o \
-	itable.o \
-	semantics.o \
-	idecode.o \
-	icache.o \
-	engine.o \
-	irun.o \
-
-
-SIM_M16_OBJ = \
-	m16_support.o \
-	m16_semantics.o \
-	m16_idecode.o \
-	m16_icache.o \
-	\
-	m32_support.o \
-	m32_semantics.o \
-	m32_idecode.o \
-	m32_icache.o \
-	\
-	itable.o \
-	m16run.o \
-
-SIM_MULTI_OBJ = $(SIM_MIPS_MULTI_OBJ) \
-		itable.o \
-		multi-run.o \
-
-SIM_OBJS = \
-	interp.o \
-	$(SIM_$(SIM_MIPS_GEN)_OBJ) \
-	$(SIM_NEW_COMMON_OBJS) \
-	cp1.o \
-	mdmx.o \
-	dsp.o \
-	sim-main.o \
-	sim-resume.o \
+SIM_LIBSIM =
 
 # List of flags to always pass to $(CC).
 SIM_EXTRA_CFLAGS = @SIM_MIPS_SUBTARGET@
diff --git a/sim/mips/acinclude.m4 b/sim/mips/acinclude.m4
index f2dd97f3dc44..58b55a2782b6 100644
--- a/sim/mips/acinclude.m4
+++ b/sim/mips/acinclude.m4
@@ -252,8 +252,8 @@ __EOF__
 	dnl The top-level function for the mips16 simulator is
 	dnl in a file m16${name}_run.c, generated by the
 	dnl tmp-run-multi Makefile rule.
-	AS_VAR_APPEND([SIM_MIPS_MULTI_SRC], [" m16${name}_run.c"])
-	AS_VAR_APPEND([SIM_MIPS_MULTI_OBJ], [" m16${name}_run.o"])
+	AS_VAR_APPEND([SIM_MIPS_MULTI_SRC], [" mips/m16${name}_run.c"])
+	AS_VAR_APPEND([SIM_MIPS_MULTI_OBJ], [" mips/m16${name}_run.o"])
 	AS_VAR_APPEND([SIM_MIPS_IGEN_ITABLE_FLAGS], [" -F 16"])
 	],
       [*:*micromips32*:*], [dnl
@@ -264,8 +264,8 @@ __EOF__
 	dnl The top-level function for the micromips simulator is
 	dnl in a file micromips${name}_run.c, generated by the
 	dnl tmp-run-multi Makefile rule.
-	AS_VAR_APPEND([SIM_MIPS_MULTI_SRC], [" micromips${name}_run.c"])
-	AS_VAR_APPEND([SIM_MIPS_MULTI_OBJ], [" micromips${name}_run.o"])
+	AS_VAR_APPEND([SIM_MIPS_MULTI_SRC], [" mips/micromips${name}_run.c"])
+	AS_VAR_APPEND([SIM_MIPS_MULTI_OBJ], [" mips/micromips${name}_run.o"])
 	AS_VAR_APPEND([SIM_MIPS_IGEN_ITABLE_FLAGS], [" -F 16,32"])
 	],
       [*:*micromips64*:*], [dnl
@@ -276,8 +276,8 @@ __EOF__
 	dnl The top-level function for the micromips simulator is
 	dnl in a file micromips${name}_run.c, generated by the
 	dnl tmp-run-multi Makefile rule.
-	AS_VAR_APPEND([SIM_MIPS_MULTI_SRC], [" micromips${name}_run.c"])
-	AS_VAR_APPEND([SIM_MIPS_MULTI_OBJ], [" micromips${name}_run.o"])
+	AS_VAR_APPEND([SIM_MIPS_MULTI_SRC], [" mips/micromips${name}_run.c"])
+	AS_VAR_APPEND([SIM_MIPS_MULTI_OBJ], [" mips/micromips${name}_run.o"])
 	AS_VAR_APPEND([SIM_MIPS_IGEN_ITABLE_FLAGS], [" -F 16,32,64"])
 	],
       [ws=m32])
@@ -286,9 +286,9 @@ __EOF__
     dnl and ${SIM_MIPS_MULTI_OBJ}.
     for w in ${ws}; do
       for base in engine icache idecode model semantics support; do
-	AS_VAR_APPEND([SIM_MIPS_MULTI_SRC], [" ${w}${name}_${base}.c"])
-	AS_VAR_APPEND([SIM_MIPS_MULTI_SRC], [" ${w}${name}_${base}.h"])
-	AS_VAR_APPEND([SIM_MIPS_MULTI_OBJ], [" ${w}${name}_${base}.o"])
+	AS_VAR_APPEND([SIM_MIPS_MULTI_SRC], [" mips/${w}${name}_${base}.c"])
+	AS_VAR_APPEND([SIM_MIPS_MULTI_SRC], [" mips/${w}${name}_${base}.h"])
+	AS_VAR_APPEND([SIM_MIPS_MULTI_OBJ], [" mips/${w}${name}_${base}.o"])
       done
       AS_VAR_APPEND([SIM_MIPS_MULTI_IGEN_CONFIGS], [" ${w}${c}"])
     done
@@ -320,7 +320,7 @@ __EOF__
 __EOF__
 ], [dnl
   dnl For clean-extra target.
-  SIM_MIPS_MULTI_SRC=doesnt-exist.c
+  SIM_MIPS_MULTI_SRC=mips/doesnt-exist.c
   SIM_MIPS_IGEN_ITABLE_FLAGS='$(SIM_MIPS_SINGLE_FLAGS)'
   AS_VAR_IF([SIM_MIPS_GEN], ["M16"], [AS_VAR_APPEND([SIM_MIPS_IGEN_ITABLE_FLAGS], [' $(SIM_MIPS_M16_FLAGS)'])])
 ])
diff --git a/sim/mips/local.mk b/sim/mips/local.mk
index 5a7b12c29a1e..f255ffca611f 100644
--- a/sim/mips/local.mk
+++ b/sim/mips/local.mk
@@ -16,6 +16,65 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_GEN_OBJ =
+if SIM_MIPS_GEN_MODE_SINGLE
+%C%_GEN_OBJ += \
+	%D%/support.o \
+	%D%/itable.o \
+	%D%/semantics.o \
+	%D%/idecode.o \
+	%D%/icache.o \
+	%D%/engine.o \
+	%D%/irun.o
+endif
+if SIM_MIPS_GEN_MODE_M16
+%C%_GEN_OBJ += \
+	%D%/m16_support.o \
+	%D%/m16_semantics.o \
+	%D%/m16_idecode.o \
+	%D%/m16_icache.o \
+	\
+	%D%/m32_support.o \
+	%D%/m32_semantics.o \
+	%D%/m32_idecode.o \
+	%D%/m32_icache.o \
+	\
+	%D%/itable.o \
+	%D%/m16run.o
+endif
+if SIM_MIPS_GEN_MODE_MULTI
+%C%_GEN_OBJ += \
+	$(SIM_MIPS_MULTI_OBJ) \
+	%D%/itable.o \
+	%D%/multi-run.o
+endif
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	%D%/interp.o \
+	$(%C%_GEN_OBJ) \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
+	%D%/cp1.o \
+	%D%/dsp.o \
+	%D%/mdmx.o \
+	%D%/modules.o \
+	%D%/sim-main.o \
+	%D%/sim-resume.o
+## Workaround Automake bug where $(SIM_MIPS_MULTI_OBJ) isn't copied from LIBADD
+## to DEPENDENCIES automatically.
+EXTRA_mips_libsim_a_DEPENDENCIES = $(SIM_MIPS_MULTI_OBJ)
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 25/83] sim: mn10300: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (23 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 24/83] sim: mips: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 26/83] sim: moxie: " Mike Frysinger
                   ` (57 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in         | 129 ++++++++++++++++++++++++++++------------
 sim/mn10300/Makefile.in |   8 +--
 sim/mn10300/local.mk    |  27 +++++++++
 3 files changed, 118 insertions(+), 46 deletions(-)

diff --git a/sim/mn10300/Makefile.in b/sim/mn10300/Makefile.in
index a96cb56a50d2..511d6b5824b7 100644
--- a/sim/mn10300/Makefile.in
+++ b/sim/mn10300/Makefile.in
@@ -19,13 +19,7 @@
 
 arch = mn10300
 
-MN10300_OBJS = \
-	itable.o semantics.o idecode.o icache.o engine.o irun.o support.o \
-	$(SIM_NEW_COMMON_OBJS) \
-	op_utils.o \
-	sim-resume.o
-
-SIM_OBJS = $(MN10300_OBJS) interp.o
+SIM_LIBSIM =
 
 # List of extra flags to always pass to $(CC).
 SIM_EXTRA_CFLAGS = \
diff --git a/sim/mn10300/local.mk b/sim/mn10300/local.mk
index d24e6b8d0405..06b42087699a 100644
--- a/sim/mn10300/local.mk
+++ b/sim/mn10300/local.mk
@@ -16,6 +16,33 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	%D%/itable.o \
+	%D%/semantics.o \
+	%D%/idecode.o \
+	%D%/icache.o \
+	%D%/engine.o \
+	%D%/irun.o \
+	%D%/support.o \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
+	%D%/interp.o \
+	%D%/modules.o \
+	%D%/op_utils.o \
+	%D%/sim-resume.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 26/83] sim: moxie: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (24 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 25/83] sim: mn10300: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 27/83] sim: msp430: " Mike Frysinger
                   ` (56 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in       | 101 ++++++++++++++++++++++++++++--------------
 sim/moxie/Makefile.in |   5 +--
 sim/moxie/local.mk    |  18 ++++++++
 3 files changed, 87 insertions(+), 37 deletions(-)

diff --git a/sim/moxie/Makefile.in b/sim/moxie/Makefile.in
index dfc37c05427a..d79426631ac0 100644
--- a/sim/moxie/Makefile.in
+++ b/sim/moxie/Makefile.in
@@ -17,10 +17,7 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_OBJS = \
-	$(SIM_NEW_COMMON_OBJS) \
-	interp.o \
-	sim-resume.o
+SIM_LIBSIM =
 
 SIM_EXTRA_CFLAGS = -DDTB="\"$(dtbdir)/moxie-gdb.dtb\""
 
diff --git a/sim/moxie/local.mk b/sim/moxie/local.mk
index 2e0d586076e0..813bdc895339 100644
--- a/sim/moxie/local.mk
+++ b/sim/moxie/local.mk
@@ -16,6 +16,24 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/interp.o \
+	%D%/modules.o \
+	%D%/sim-resume.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 27/83] sim: msp430: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (25 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 26/83] sim: moxie: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 28/83] sim: or1k: " Mike Frysinger
                   ` (55 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in        | 100 +++++++++++++++++++++++++++--------------
 sim/msp430/Makefile.in |   5 +--
 sim/msp430/local.mk    |  18 ++++++++
 3 files changed, 86 insertions(+), 37 deletions(-)

diff --git a/sim/msp430/Makefile.in b/sim/msp430/Makefile.in
index 82c21a16fc98..5cdf3096a7a9 100644
--- a/sim/msp430/Makefile.in
+++ b/sim/msp430/Makefile.in
@@ -18,9 +18,6 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_OBJS = \
-	$(SIM_NEW_COMMON_OBJS) \
-	msp430-sim.o \
-	sim-resume.o
+SIM_LIBSIM =
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/msp430/local.mk b/sim/msp430/local.mk
index c9f4451943c1..772d12f0a17d 100644
--- a/sim/msp430/local.mk
+++ b/sim/msp430/local.mk
@@ -16,6 +16,24 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/msp430-sim.o \
+	%D%/modules.o \
+	%D%/sim-resume.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 28/83] sim: or1k: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (26 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 27/83] sim: msp430: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 29/83] sim: pru: " Mike Frysinger
                   ` (54 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in      | 118 +++++++++++++++++++++++++++++++------------
 sim/or1k/Makefile.in |  22 +-------
 sim/or1k/local.mk    |  34 +++++++++++++
 3 files changed, 122 insertions(+), 52 deletions(-)

diff --git a/sim/or1k/Makefile.in b/sim/or1k/Makefile.in
index ca5bf1ae4eee..19eed022932d 100644
--- a/sim/or1k/Makefile.in
+++ b/sim/or1k/Makefile.in
@@ -18,27 +18,7 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-OR1K_OBJS = \
-	or1k.o \
-	arch.o \
-	cpu.o \
-	decode.o \
-	model.o \
-	sem.o \
-	mloop.o \
-	sim-if.o \
-	traps.o
-
-SIM_OBJS = \
-	$(SIM_NEW_COMMON_OBJS) \
-	cgen-utils.o \
-	cgen-trace.o \
-	cgen-scache.o \
-	cgen-run.o \
-	cgen-fpu.o \
-	cgen-accfp.o
-
-SIM_OBJS += $(OR1K_OBJS)
+SIM_LIBSIM =
 
 SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
 
diff --git a/sim/or1k/local.mk b/sim/or1k/local.mk
index 7d999f6f3aa4..a7412bfa07ce 100644
--- a/sim/or1k/local.mk
+++ b/sim/or1k/local.mk
@@ -15,6 +15,40 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/modules.o \
+	\
+	%D%/cgen-accfp.o \
+	%D%/cgen-fpu.o \
+	%D%/cgen-run.o \
+	%D%/cgen-scache.o \
+	%D%/cgen-trace.o \
+	%D%/cgen-utils.o \
+	\
+	%D%/arch.o \
+	%D%/cpu.o \
+	%D%/decode.o \
+	%D%/mloop.o \
+	%D%/model.o \
+	%D%/sem.o \
+	\
+	%D%/or1k.o \
+	%D%/sim-if.o \
+	%D%/traps.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 29/83] sim: pru: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (27 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 28/83] sim: or1k: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 30/83] sim: riscv: " Mike Frysinger
                   ` (53 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in     | 88 +++++++++++++++++++++++++++++++--------------
 sim/pru/Makefile.in |  5 +--
 sim/pru/local.mk    | 18 ++++++++++
 3 files changed, 80 insertions(+), 31 deletions(-)

diff --git a/sim/pru/Makefile.in b/sim/pru/Makefile.in
index b81d0967e7a0..9b2f2f0498aa 100644
--- a/sim/pru/Makefile.in
+++ b/sim/pru/Makefile.in
@@ -19,9 +19,6 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_OBJS = \
-	$(SIM_NEW_COMMON_OBJS) \
-	interp.o \
-	sim-resume.o
+SIM_LIBSIM =
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/pru/local.mk b/sim/pru/local.mk
index 5992f0ce1613..0c3018cbeb2d 100644
--- a/sim/pru/local.mk
+++ b/sim/pru/local.mk
@@ -16,6 +16,24 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/interp.o \
+	%D%/modules.o \
+	%D%/sim-resume.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 30/83] sim: riscv: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (28 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 29/83] sim: pru: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 31/83] sim: rl78: " Mike Frysinger
                   ` (52 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in       | 87 ++++++++++++++++++++++++++++++-------------
 sim/riscv/Makefile.in |  7 +---
 sim/riscv/local.mk    | 20 ++++++++++
 3 files changed, 83 insertions(+), 31 deletions(-)

diff --git a/sim/riscv/Makefile.in b/sim/riscv/Makefile.in
index 357d2abf9401..d85f078f250b 100644
--- a/sim/riscv/Makefile.in
+++ b/sim/riscv/Makefile.in
@@ -17,12 +17,7 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_OBJS = \
-	$(SIM_NEW_COMMON_OBJS) \
-	sim-resume.o \
-	interp.o \
-	machs.o \
-	sim-main.o
+SIM_LIBSIM =
 
 SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=@SIM_RISCV_BITSIZE@
 
diff --git a/sim/riscv/local.mk b/sim/riscv/local.mk
index 1b44779cf272..6f03fc3d0346 100644
--- a/sim/riscv/local.mk
+++ b/sim/riscv/local.mk
@@ -16,6 +16,26 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/interp.o \
+	%D%/machs.o \
+	%D%/modules.o \
+	%D%/sim-main.o \
+	%D%/sim-resume.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 31/83] sim: rl78: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (29 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 30/83] sim: riscv: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 32/83] sim: rx: " Mike Frysinger
                   ` (51 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in      | 83 ++++++++++++++++++++++++++++++--------------
 sim/rl78/Makefile.in | 12 ++-----
 sim/rl78/local.mk    | 24 ++++++++++---
 3 files changed, 78 insertions(+), 41 deletions(-)

diff --git a/sim/rl78/Makefile.in b/sim/rl78/Makefile.in
index 9ca400efe283..0cc55baf3b5a 100644
--- a/sim/rl78/Makefile.in
+++ b/sim/rl78/Makefile.in
@@ -20,15 +20,7 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_RUN_OBJS = \
-	main.o
-
-SIM_OBJS = \
-	load.o \
-	mem.o \
-	cpu.o \
-	rl78.o \
-	gdb-if.o \
-	trace.o
+SIM_LIBSIM =
+SIM_RUN_OBJS =
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/rl78/local.mk b/sim/rl78/local.mk
index 07ff86711c16..935fbf1eea07 100644
--- a/sim/rl78/local.mk
+++ b/sim/rl78/local.mk
@@ -16,6 +16,26 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	%D%/load.o \
+	%D%/mem.o \
+	%D%/cpu.o \
+	%D%/rl78.o \
+	%D%/gdb-if.o \
+	%D%/modules.o \
+	%D%/trace.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/main.o \
@@ -23,7 +43,3 @@
 	$(SIM_COMMON_LIBS)
 
 noinst_PROGRAMS += %D%/run
-
-## Helper targets for running make from the top-level due to run's main.o.
-%D%/%.o: %D%/%.c | %D%/libsim.a $(SIM_ALL_RECURSIVE_DEPS)
-	$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-- 
2.39.0


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

* [PATCH 32/83] sim: rx: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (30 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 31/83] sim: rl78: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 33/83] sim: sh: " Mike Frysinger
                   ` (50 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in    | 86 ++++++++++++++++++++++++++++++++--------------
 sim/rx/Makefile.in | 15 ++------
 sim/rx/local.mk    | 28 ++++++++++++---
 3 files changed, 87 insertions(+), 42 deletions(-)

diff --git a/sim/rx/Makefile.in b/sim/rx/Makefile.in
index 28d13bed0abd..c418da28944a 100644
--- a/sim/rx/Makefile.in
+++ b/sim/rx/Makefile.in
@@ -22,18 +22,7 @@
 
 SIM_EXTRA_CFLAGS = @SIM_RX_CYCLE_ACCURATE_FLAGS@
 
-SIM_RUN_OBJS = main.o
-
-SIM_OBJS = \
-	fpu.o \
-	load.o \
-	mem.o \
-	misc.o \
-	reg.o \
-	rx.o \
-	syscalls.o \
-	trace.o \
-	gdb-if.o \
-	err.o
+SIM_LIBSIM =
+SIM_RUN_OBJS =
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/rx/local.mk b/sim/rx/local.mk
index 00978e9d0311..c23ac4f8035c 100644
--- a/sim/rx/local.mk
+++ b/sim/rx/local.mk
@@ -16,6 +16,30 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	%D%/fpu.o \
+	%D%/load.o \
+	%D%/mem.o \
+	%D%/misc.o \
+	%D%/reg.o \
+	%D%/rx.o \
+	%D%/syscalls.o \
+	%D%/trace.o \
+	%D%/gdb-if.o \
+	%D%/err.o \
+	%D%/modules.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/main.o \
@@ -24,9 +48,5 @@
 
 noinst_PROGRAMS += %D%/run
 
-## Helper targets for running make from the top-level due to run's main.o.
-%D%/%.o: %D%/%.c | %D%/libsim.a $(SIM_ALL_RECURSIVE_DEPS)
-	$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %C%docdir = $(docdir)/%C%
 %C%doc_DATA = %D%/README.txt
-- 
2.39.0


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

* [PATCH 33/83] sim: sh: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (31 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 32/83] sim: rx: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 34/83] sim: v850: " Mike Frysinger
                   ` (49 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in    | 78 ++++++++++++++++++++++++++++++++--------------
 sim/sh/Makefile.in |  5 +--
 sim/sh/local.mk    | 18 +++++++++++
 3 files changed, 74 insertions(+), 27 deletions(-)

diff --git a/sim/sh/Makefile.in b/sim/sh/Makefile.in
index fef187a07dd7..ceb4878d285c 100644
--- a/sim/sh/Makefile.in
+++ b/sim/sh/Makefile.in
@@ -17,9 +17,6 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_OBJS = \
-	interp.o \
-	$(SIM_NEW_COMMON_OBJS) \
-	table.o
+SIM_LIBSIM =
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/sh/local.mk b/sim/sh/local.mk
index c25ab536c681..b7c9e615725f 100644
--- a/sim/sh/local.mk
+++ b/sim/sh/local.mk
@@ -16,6 +16,24 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	%D%/interp.o \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/modules.o \
+	%D%/table.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 34/83] sim: v850: move libsim.a creation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (32 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 33/83] sim: sh: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 35/83] sim: build: drop support for creating libsim.a in subdirs Mike Frysinger
                   ` (48 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level.  This is a required step before we
can move compilation itself up, and makes it easier to review.

The downside is that each object compile is a recursive make instead of
a single one.  On my 4 core system, it adds ~100msec to the build per
port, so it's not great, but it shouldn't be a big deal.  This will go
away of course once the top-level compiles objects.
---
 sim/Makefile.in      | 76 +++++++++++++++++++++++++++++++++++---------
 sim/v850/Makefile.in |  6 +---
 sim/v850/local.mk    | 26 +++++++++++++++
 3 files changed, 88 insertions(+), 20 deletions(-)

diff --git a/sim/v850/Makefile.in b/sim/v850/Makefile.in
index e23e644aec57..61df283a31c2 100644
--- a/sim/v850/Makefile.in
+++ b/sim/v850/Makefile.in
@@ -17,11 +17,7 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_OBJS = \
-	$(SIM_NEW_COMMON_OBJS) \
-	simops.o interp.o \
-	itable.o semantics.o idecode.o icache.o engine.o irun.o support.o \
-	sim-resume.o
+SIM_LIBSIM =
 
 SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
 
diff --git a/sim/v850/local.mk b/sim/v850/local.mk
index 2c27d0c6d7ea..769c6030d6ef 100644
--- a/sim/v850/local.mk
+++ b/sim/v850/local.mk
@@ -16,6 +16,32 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+%C%_libsim_a_SOURCES =
+%C%_libsim_a_LIBADD = \
+	$(common_libcommon_a_OBJECTS) \
+	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
+	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
+	%D%/simops.o \
+	%D%/interp.o \
+	%D%/itable.o \
+	%D%/semantics.o \
+	%D%/idecode.o \
+	%D%/icache.o \
+	%D%/engine.o \
+	%D%/irun.o \
+	%D%/support.o \
+	%D%/modules.o \
+	%D%/sim-resume.o
+$(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
+
+noinst_LIBRARIES += %D%/libsim.a
+
+%D%/%.o: %D%/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 %C%_run_SOURCES =
 %C%_run_LDADD = \
 	%D%/nrun.o \
-- 
2.39.0


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

* [PATCH 35/83] sim: build: drop support for creating libsim.a in subdirs
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (33 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 34/83] sim: v850: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 36/83] sim: build: drop common/nrun.o subdir hack Mike Frysinger
                   ` (47 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

Now that all ports have moved to creating libsim.a in the top-level,
drop all the support code to create it in a subdir.
---
 sim/Makefile.am                 |  3 ---
 sim/Makefile.in                 |  3 ---
 sim/README-HACKING              |  4 ----
 sim/aarch64/Makefile.in         |  3 ---
 sim/arch-subdir.mk.in           |  3 ---
 sim/arm/Makefile.in             |  2 --
 sim/avr/Makefile.in             |  3 ---
 sim/bfin/Makefile.in            |  2 --
 sim/bpf/Makefile.in             |  2 --
 sim/common/Make-common.in       | 40 +++------------------------------
 sim/cr16/Makefile.in            |  3 ---
 sim/cris/Makefile.in            |  2 --
 sim/d10v/Makefile.in            |  3 ---
 sim/erc32/Makefile.in           |  3 ---
 sim/example-synacor/Makefile.in |  3 ---
 sim/frv/Makefile.in             |  2 --
 sim/ft32/Makefile.in            |  3 ---
 sim/h8300/Makefile.in           |  3 ---
 sim/iq2000/Makefile.in          |  3 ---
 sim/lm32/Makefile.in            |  2 --
 sim/m32c/Makefile.in            |  3 ---
 sim/m32r/Makefile.in            |  2 --
 sim/m68hc11/Makefile.in         |  2 --
 sim/mcore/Makefile.in           |  3 ---
 sim/microblaze/Makefile.in      |  3 ---
 sim/mips/Makefile.in            |  2 --
 sim/mn10300/Makefile.in         |  2 --
 sim/moxie/Makefile.in           |  2 --
 sim/msp430/Makefile.in          |  3 ---
 sim/or1k/Makefile.in            |  2 --
 sim/pru/Makefile.in             |  3 ---
 sim/riscv/Makefile.in           |  2 --
 sim/rl78/Makefile.in            |  4 ----
 sim/rx/Makefile.in              |  3 ---
 sim/sh/Makefile.in              |  3 ---
 sim/v850/Makefile.in            |  2 --
 36 files changed, 3 insertions(+), 130 deletions(-)

diff --git a/sim/Makefile.am b/sim/Makefile.am
index dd85297c83e5..8a4a160b30cd 100644
--- a/sim/Makefile.am
+++ b/sim/Makefile.am
@@ -188,9 +188,6 @@ endif
 ## Helper targets for running make from the top-level when some subdirs still
 ## have Makefiles in subdirs.
 
-%/libsim.a: | $(SIM_ALL_RECURSIVE_DEPS)
-	$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %/nrun.o: common/nrun.c | %/libsim.a $(SIM_ALL_RECURSIVE_DEPS)
 	$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
diff --git a/sim/README-HACKING b/sim/README-HACKING
index 38d871b15141..fd6461e5ae90 100644
--- a/sim/README-HACKING
+++ b/sim/README-HACKING
@@ -44,8 +44,6 @@ The Makefile.in of a simulator using the common framework should look like:
 # Not all of these need to be mentioned, only the necessary ones.
 # In fact it is better to *not* mention ones if the value is the default.
 
-# List of object files, less common parts.
-SIM_OBJS =
 # List of flags to always pass to $(CC).
 SIM_EXTRA_CFLAGS =
 # Dependency of `clean' to clean any extra files.
@@ -53,8 +51,6 @@ SIM_EXTRA_CLEAN =
 
 ## COMMON_POST_CONFIG_FRAG
 
-# Rules need to build $(SIM_OBJS), plus whatever else the target wants.
-
 ... target specific rules ...
 --- snip ---
 
diff --git a/sim/aarch64/Makefile.in b/sim/aarch64/Makefile.in
index 94c624291575..82224f06ccf0 100644
--- a/sim/aarch64/Makefile.in
+++ b/sim/aarch64/Makefile.in
@@ -20,7 +20,4 @@
 ### along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 ## COMMON_PRE_CONFIG_FRAG
-
-SIM_LIBSIM =
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in
index 85e1d84ede1d..afa1103a2f11 100644
--- a/sim/arch-subdir.mk.in
+++ b/sim/arch-subdir.mk.in
@@ -35,7 +35,6 @@ LDFLAGS = @LDFLAGS@
 AR = @AR@
 AR_FLAGS = rc
 RANLIB = @RANLIB@
-DTC = @DTC@
 
 LIBTOOL = @LIBTOOL@
 AM_V_lt = $(am__v_lt_@AM_V@)
@@ -65,5 +64,3 @@ MAINT = ; @true
 SIM_INLINE = @SIM_INLINE@
 
 SIM_HW_CFLAGS = @SIM_HW_CFLAGS@
-SIM_HW_OBJS = $(SIM_HW_DEVICES:%=dv-%.o)
-@SIM_ENABLE_HW_FALSE@SIM_HW_OBJS =
diff --git a/sim/arm/Makefile.in b/sim/arm/Makefile.in
index cdf371d844c7..24e1525d6696 100644
--- a/sim/arm/Makefile.in
+++ b/sim/arm/Makefile.in
@@ -19,6 +19,4 @@
 
 SIM_EXTRA_CFLAGS = -DMODET
 
-SIM_LIBSIM =
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/avr/Makefile.in b/sim/avr/Makefile.in
index eaf6c4b6a977..202bda36d2fd 100644
--- a/sim/avr/Makefile.in
+++ b/sim/avr/Makefile.in
@@ -15,7 +15,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ## COMMON_PRE_CONFIG_FRAG
-
-SIM_LIBSIM =
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/bfin/Makefile.in b/sim/bfin/Makefile.in
index 700e641d149c..569c64bb22f5 100644
--- a/sim/bfin/Makefile.in
+++ b/sim/bfin/Makefile.in
@@ -19,8 +19,6 @@
 
 arch = bfin
 
-SIM_LIBSIM =
-
 SIM_EXTRA_CFLAGS = $(SDL_CFLAGS)
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/bpf/Makefile.in b/sim/bpf/Makefile.in
index 1fc98a68cbe5..64ec667c12c7 100644
--- a/sim/bpf/Makefile.in
+++ b/sim/bpf/Makefile.in
@@ -18,8 +18,6 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_LIBSIM =
-
 SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=64
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index e14997ae1363..f9f6ed1984c4 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -83,24 +83,18 @@ POSTCOMPILE = @true
 # in the simulator's Makefile.in if one is using the default value.  In fact
 # it's preferable not to.
 
-# List of object files, less common parts.
-SIM_OBJS =
 # List of flags to always pass to $(CC).
 SIM_EXTRA_CFLAGS =
-# List of main object files for `run'.
-SIM_RUN_OBJS = nrun.o
-SIM_LIBSIM = libsim.a
 # Dependency of `clean' to clean any extra files.
 SIM_EXTRA_CLEAN =
 
 # Every time a new general purpose source file was added every target's
-# Makefile.in needed to be updated to include the file in SIM_OBJS.
+# Makefile.in needed to be updated to include the file.
 # This doesn't scale.
 # This variable specifies all the generic stuff common to the newer simulators.
 # Things like sim-reason.o can't go here as the cpu may provide its own
 # (though hopefully in time that won't be so).  Things like sim-bits.o can go
 # here.  Some files are used by all simulators (e.g. callback.o).
-# Those files are specified in LIB_OBJS below.
 
 ## End COMMON_PRE_CONFIG_FRAG
 
@@ -124,9 +118,6 @@ BUILD_CFLAGS = $(CFLAGS_FOR_BUILD) $(CSEARCH)
 
 COMMON_DEP_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(SIM_EXTRA_CFLAGS)
 
-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
 BFD_LIB = ../../bfd/libbfd.la
 OPCODES_LIB = ../../opcodes/libopcodes.la
@@ -134,31 +125,12 @@ LIBDEPS = $(BFD_LIB) $(OPCODES_LIB) $(LIBIBERTY_LIB)
 EXTRA_LIBS = $(BFD_LIB) $(OPCODES_LIB) $(LIBIBERTY_LIB) \
 	$(COMMON_LIBS) $(LIBGNU) $(LIBGNU_EXTRA_LIBS)
 
-COMMON_OBJS_NAMES = \
-	callback.o \
-	portability.o \
-	sim-load.o \
-	syscall.o \
-	target-newlib-errno.o \
-	target-newlib-open.o \
-	target-newlib-signal.o \
-	target-newlib-syscall.o \
-	version.o
-COMMON_OBJS = $(COMMON_OBJS_NAMES:%=../common/%)
-
-LIB_OBJS = modules.o $(COMMON_OBJS) $(SIM_OBJS)
-
 COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS)
 LINK_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(LDFLAGS_FOR_BUILD) -o $@
 
 RUNTESTFLAGS =
 
-all: $(SIM_LIBSIM) $(LIB_OBJS) $(SIM_RUN_OBJS)
-
-libsim.a: $(LIB_OBJS)
-	$(SILENCE) rm -f libsim.a
-	$(ECHO_AR) $(AR) $(AR_FLAGS) libsim.a $(LIB_OBJS)
-	$(ECHO_RANLIB) $(RANLIB) libsim.a
+all:
 
 #
 # Dependency tracking.  Most of this is conditional on GNU Make being
@@ -182,11 +154,6 @@ override COMPILE.pre = source='$<' object='$@' libtool=no \
 override POSTCOMPILE =
 endif
 
-all_object_files = $(LIB_OBJS) $(SIM_RUN_OBJS)
-
-# Dependencies.
--include $(patsubst %.o, $(DEPDIR)/%.Po, $(all_object_files))
-
 test-hw-events: $(srccom)/hw-events.c libsim.a
 	$(ECHO_CCLD) $(LIBTOOL) $(AM_V_lt) --tag=CC --mode=link \
 		$(CC) $(ALL_CFLAGS) -DMAIN -o test-hw-events$(EXEEXT) \
@@ -194,7 +161,7 @@ test-hw-events: $(srccom)/hw-events.c libsim.a
 
 # See sim_pre_argv_init and sim_module_install in sim-module.c for more details.
 modules.c: stamp-modules ; @true
-stamp-modules: Makefile $(SIM_OBJS:.o=.c)
+stamp-modules: Makefile
 	$(ECHO_STAMP) modules.c
 	$(SILENCE) LANG=C ; export LANG ; \
 	LC_ALL=C ; export LC_ALL ; \
@@ -248,7 +215,6 @@ TAGS: force
 
 mostlyclean clean: $(SIM_EXTRA_CLEAN)
 	rm -f *.[oa] *~ core \
-		run$(EXEEXT) libsim.a \
 		modules.c stamp-modules
 
 distclean maintainer-clean realclean: clean
diff --git a/sim/cr16/Makefile.in b/sim/cr16/Makefile.in
index da5062dc39ce..37a91c585313 100644
--- a/sim/cr16/Makefile.in
+++ b/sim/cr16/Makefile.in
@@ -16,7 +16,4 @@
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 ## COMMON_PRE_CONFIG_FRAG
-
-SIM_LIBSIM =
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/cris/Makefile.in b/sim/cris/Makefile.in
index 142825fa26d3..b1a2e83bad43 100644
--- a/sim/cris/Makefile.in
+++ b/sim/cris/Makefile.in
@@ -21,6 +21,4 @@
 
 arch = cris
 
-SIM_LIBSIM =
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/d10v/Makefile.in b/sim/d10v/Makefile.in
index 6f209a2db1f7..15cfc21807d2 100644
--- a/sim/d10v/Makefile.in
+++ b/sim/d10v/Makefile.in
@@ -16,7 +16,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ## COMMON_PRE_CONFIG_FRAG
-
-SIM_LIBSIM =
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/erc32/Makefile.in b/sim/erc32/Makefile.in
index 252427d4a388..58afbe1f7476 100644
--- a/sim/erc32/Makefile.in
+++ b/sim/erc32/Makefile.in
@@ -18,9 +18,6 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_LIBSIM =
-SIM_RUN_OBJS =
-
 READLINE_SRC = $(srcroot)/readline/readline
 
 SIM_EXTRA_CFLAGS = $(READLINE_CFLAGS)
diff --git a/sim/example-synacor/Makefile.in b/sim/example-synacor/Makefile.in
index cece1e543ca7..a8e8fc7d2d5b 100644
--- a/sim/example-synacor/Makefile.in
+++ b/sim/example-synacor/Makefile.in
@@ -16,7 +16,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ## COMMON_PRE_CONFIG_FRAG
-
-SIM_LIBSIM =
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/frv/Makefile.in b/sim/frv/Makefile.in
index 12af397f4c1e..f577873c057a 100644
--- a/sim/frv/Makefile.in
+++ b/sim/frv/Makefile.in
@@ -17,8 +17,6 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_LIBSIM =
-
 SIM_EXTRA_CFLAGS = @SIM_FRV_TRAPDUMP_FLAGS@
 
 # Some modules don't build cleanly yet.
diff --git a/sim/ft32/Makefile.in b/sim/ft32/Makefile.in
index a84512eaac46..50f497ebb9d7 100644
--- a/sim/ft32/Makefile.in
+++ b/sim/ft32/Makefile.in
@@ -16,7 +16,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ## COMMON_PRE_CONFIG_FRAG
-
-SIM_LIBSIM =
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/h8300/Makefile.in b/sim/h8300/Makefile.in
index 6843a400826a..7d378cb970f1 100644
--- a/sim/h8300/Makefile.in
+++ b/sim/h8300/Makefile.in
@@ -16,7 +16,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ## COMMON_PRE_CONFIG_FRAG
-
-SIM_LIBSIM =
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/iq2000/Makefile.in b/sim/iq2000/Makefile.in
index b4679a484391..6114d0e96f31 100644
--- a/sim/iq2000/Makefile.in
+++ b/sim/iq2000/Makefile.in
@@ -16,9 +16,6 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ## COMMON_PRE_CONFIG_FRAG
-
-SIM_LIBSIM =
-
 ## COMMON_POST_CONFIG_FRAG
 
 arch = iq2000
diff --git a/sim/lm32/Makefile.in b/sim/lm32/Makefile.in
index cee1935ba341..d34049a3682e 100644
--- a/sim/lm32/Makefile.in
+++ b/sim/lm32/Makefile.in
@@ -5,6 +5,4 @@
 
 arch = lm32
 
-SIM_LIBSIM =
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/m32c/Makefile.in b/sim/m32c/Makefile.in
index cbe0c916e485..4c91e57dd2d0 100644
--- a/sim/m32c/Makefile.in
+++ b/sim/m32c/Makefile.in
@@ -22,7 +22,4 @@
 
 SIM_EXTRA_CFLAGS = -DTIMER_A
 
-SIM_LIBSIM =
-SIM_RUN_OBJS =
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/m32r/Makefile.in b/sim/m32r/Makefile.in
index 08cda449ca16..bc7b85694792 100644
--- a/sim/m32r/Makefile.in
+++ b/sim/m32r/Makefile.in
@@ -21,8 +21,6 @@
 
 arch = m32r
 
-SIM_LIBSIM =
-
 # Some modules don't build cleanly yet.
 cpu.o cpu2.o cpux.o m32r.o m32r2.o m32rx.o mloop.o mloop2.o mloopx.o sem.o sim-if.o traps.o: SIM_WERROR_CFLAGS =
 
diff --git a/sim/m68hc11/Makefile.in b/sim/m68hc11/Makefile.in
index f67a94cf9401..5c8ee196a6c4 100644
--- a/sim/m68hc11/Makefile.in
+++ b/sim/m68hc11/Makefile.in
@@ -19,8 +19,6 @@
 
 arch = m68hc11
 
-SIM_LIBSIM =
-
 # 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/mcore/Makefile.in b/sim/mcore/Makefile.in
index 502e8a44a73c..a16303ca2595 100644
--- a/sim/mcore/Makefile.in
+++ b/sim/mcore/Makefile.in
@@ -16,7 +16,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ## COMMON_PRE_CONFIG_FRAG
-
-SIM_LIBSIM =
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/microblaze/Makefile.in b/sim/microblaze/Makefile.in
index 502e8a44a73c..a16303ca2595 100644
--- a/sim/microblaze/Makefile.in
+++ b/sim/microblaze/Makefile.in
@@ -16,7 +16,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ## COMMON_PRE_CONFIG_FRAG
-
-SIM_LIBSIM =
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in
index c79a831dd782..8829e3d9b0e2 100644
--- a/sim/mips/Makefile.in
+++ b/sim/mips/Makefile.in
@@ -5,8 +5,6 @@
 
 arch = mips
 
-SIM_LIBSIM =
-
 # List of flags to always pass to $(CC).
 SIM_EXTRA_CFLAGS = @SIM_MIPS_SUBTARGET@
 
diff --git a/sim/mn10300/Makefile.in b/sim/mn10300/Makefile.in
index 511d6b5824b7..a545450fdc81 100644
--- a/sim/mn10300/Makefile.in
+++ b/sim/mn10300/Makefile.in
@@ -19,8 +19,6 @@
 
 arch = mn10300
 
-SIM_LIBSIM =
-
 # List of extra flags to always pass to $(CC).
 SIM_EXTRA_CFLAGS = \
 	-DPOLL_QUIT_INTERVAL=0x20 \
diff --git a/sim/moxie/Makefile.in b/sim/moxie/Makefile.in
index d79426631ac0..fd9beedbf1d6 100644
--- a/sim/moxie/Makefile.in
+++ b/sim/moxie/Makefile.in
@@ -17,8 +17,6 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_LIBSIM =
-
 SIM_EXTRA_CFLAGS = -DDTB="\"$(dtbdir)/moxie-gdb.dtb\""
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/msp430/Makefile.in b/sim/msp430/Makefile.in
index 5cdf3096a7a9..7960d8639325 100644
--- a/sim/msp430/Makefile.in
+++ b/sim/msp430/Makefile.in
@@ -17,7 +17,4 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 ## COMMON_PRE_CONFIG_FRAG
-
-SIM_LIBSIM =
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/or1k/Makefile.in b/sim/or1k/Makefile.in
index 19eed022932d..9df0e6d4fa64 100644
--- a/sim/or1k/Makefile.in
+++ b/sim/or1k/Makefile.in
@@ -18,8 +18,6 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_LIBSIM =
-
 SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/pru/Makefile.in b/sim/pru/Makefile.in
index 9b2f2f0498aa..214d2eea478d 100644
--- a/sim/pru/Makefile.in
+++ b/sim/pru/Makefile.in
@@ -18,7 +18,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ## COMMON_PRE_CONFIG_FRAG
-
-SIM_LIBSIM =
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/riscv/Makefile.in b/sim/riscv/Makefile.in
index d85f078f250b..e4631052349b 100644
--- a/sim/riscv/Makefile.in
+++ b/sim/riscv/Makefile.in
@@ -17,8 +17,6 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_LIBSIM =
-
 SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=@SIM_RISCV_BITSIZE@
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/rl78/Makefile.in b/sim/rl78/Makefile.in
index 0cc55baf3b5a..f57356eb8077 100644
--- a/sim/rl78/Makefile.in
+++ b/sim/rl78/Makefile.in
@@ -19,8 +19,4 @@
 ### along with the GNU simulators; if not, see <http://www.gnu.org/licenses/>.
 
 ## COMMON_PRE_CONFIG_FRAG
-
-SIM_LIBSIM =
-SIM_RUN_OBJS =
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/rx/Makefile.in b/sim/rx/Makefile.in
index c418da28944a..0c4a1f6ab6b6 100644
--- a/sim/rx/Makefile.in
+++ b/sim/rx/Makefile.in
@@ -22,7 +22,4 @@
 
 SIM_EXTRA_CFLAGS = @SIM_RX_CYCLE_ACCURATE_FLAGS@
 
-SIM_LIBSIM =
-SIM_RUN_OBJS =
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/sh/Makefile.in b/sim/sh/Makefile.in
index ceb4878d285c..8abf705126b9 100644
--- a/sim/sh/Makefile.in
+++ b/sim/sh/Makefile.in
@@ -16,7 +16,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ## COMMON_PRE_CONFIG_FRAG
-
-SIM_LIBSIM =
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/v850/Makefile.in b/sim/v850/Makefile.in
index 61df283a31c2..dc319dca70aa 100644
--- a/sim/v850/Makefile.in
+++ b/sim/v850/Makefile.in
@@ -17,8 +17,6 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-SIM_LIBSIM =
-
 SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
 
 ## COMMON_POST_CONFIG_FRAG
-- 
2.39.0


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

* [PATCH 36/83] sim: build: drop common/nrun.o subdir hack
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (34 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 35/83] sim: build: drop support for creating libsim.a in subdirs Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 37/83] sim: modules.c: move generation to top-level Mike Frysinger
                   ` (46 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

Now that all the subdirs handle their own builds, we can drop this
common rule as it's unused, and we don't want to use it anymore.
---
 sim/Makefile.am | 3 ---
 sim/Makefile.in | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/sim/Makefile.am b/sim/Makefile.am
index 8a4a160b30cd..e47244d7b8dd 100644
--- a/sim/Makefile.am
+++ b/sim/Makefile.am
@@ -188,9 +188,6 @@ endif
 ## Helper targets for running make from the top-level when some subdirs still
 ## have Makefiles in subdirs.
 
-%/nrun.o: common/nrun.c | %/libsim.a $(SIM_ALL_RECURSIVE_DEPS)
-	$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 all-recursive: $(SIM_ALL_RECURSIVE_DEPS)
 
 install-data-local: installdirs $(SIM_INSTALL_DATA_LOCAL_DEPS)
-- 
2.39.0


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

* [PATCH 37/83] sim: modules.c: move generation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (35 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 36/83] sim: build: drop common/nrun.o subdir hack Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 38/83] sim: build: add basic framework for compiling arch objects in top-level Mike Frysinger
                   ` (45 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

Now that all arches create libsim.a from the top-level, we have full
access to their inputs, and can move the actual generation from the
subdir up to the top-level.  This avoids recursive makes and will
help simplify state passing between the two.
---
 sim/Makefile.in           | 28 ++++++++++++++++++++++++----
 sim/common/Make-common.in | 25 +------------------------
 sim/common/local.mk       | 28 ++++++++++++++++++++++++----
 3 files changed, 49 insertions(+), 32 deletions(-)

diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index f9f6ed1984c4..15242c612647 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -159,28 +159,6 @@ test-hw-events: $(srccom)/hw-events.c libsim.a
 		$(CC) $(ALL_CFLAGS) -DMAIN -o test-hw-events$(EXEEXT) \
 		$(srccom)/hw-events.c libsim.a $(EXTRA_LIBS)
 
-# See sim_pre_argv_init and sim_module_install in sim-module.c for more details.
-modules.c: stamp-modules ; @true
-stamp-modules: Makefile
-	$(ECHO_STAMP) modules.c
-	$(SILENCE) LANG=C ; export LANG ; \
-	LC_ALL=C ; export LC_ALL ; \
-	sed -n -e '/^sim_install_/{s/^\(sim_install_[a-z_0-9A-Z]*\).*/\1/;p}' $^ $(GEN_MODULES_C_SRCS) | sort >$@.l-tmp
-	@set -e; (\
-	echo '/* Do not modify this file.  */'; \
-	echo '/* It is created automatically by the Makefile.  */'; \
-	echo '#include "libiberty.h"'; \
-	echo '#include "sim-module.h"'; \
-	sed -e 's:\(.*\):extern MODULE_INIT_FN \1;:' $@.l-tmp; \
-	echo 'MODULE_INSTALL_FN * const sim_modules_detected[] = {'; \
-	sed -e 's:\(.*\):  \1,:' $@.l-tmp; \
-	echo '};'; \
-	echo 'const int sim_modules_detected_len = ARRAY_SIZE (sim_modules_detected);'; \
-	) >$@.tmp
-	$(SILENCE) $(SHELL) $(srcroot)/move-if-change $@.tmp modules.c
-	$(SILENCE) rm -f $@.l-tmp $@.tmp
-	$(SILENCE) touch $@
-
 # Support targets.
 
 install:
@@ -214,8 +192,7 @@ TAGS: force
 		*.[ch] ../common/*.[ch]
 
 mostlyclean clean: $(SIM_EXTRA_CLEAN)
-	rm -f *.[oa] *~ core \
-		modules.c stamp-modules
+	rm -f *.[oa] *~ core
 
 distclean maintainer-clean realclean: clean
 	rm -f TAGS Makefile
diff --git a/sim/common/local.mk b/sim/common/local.mk
index 128b770dbe10..debb55da933b 100644
--- a/sim/common/local.mk
+++ b/sim/common/local.mk
@@ -135,10 +135,30 @@ SIM_ALL_RECURSIVE_DEPS += $(%C%_HW_CONFIG_H_TARGETS)
 am_arch_d = $(subst -,_,$(@D))
 GEN_MODULES_C_SRCS = \
 	$(wildcard \
-		$(patsubst %.o,$(abs_srcdir)/%.c,$($(am_arch_d)_libsim_a_OBJECTS) $($(am_arch_d)_libsim_a_LIBADD)) \
-		$(filter-out %.o,$(patsubst $(@D)/%.o,$(abs_srcdir)/common/%.c,$($(am_arch_d)_libsim_a_LIBADD))))
-%/modules.c:
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) GEN_MODULES_C_SRCS="$(GEN_MODULES_C_SRCS)" -C $(@D) $(@F)
+		$(patsubst %,$(srcdir)/%,$($(am_arch_d)_libsim_a_SOURCES)) \
+		$(patsubst %.o,$(srcdir)/%.c,$($(am_arch_d)_libsim_a_OBJECTS) $($(am_arch_d)_libsim_a_LIBADD)) \
+		$(filter-out %.o,$(patsubst $(@D)/%.o,$(srcdir)/common/%.c,$($(am_arch_d)_libsim_a_LIBADD))))
+%/modules.c: %/stamp-modules ; @true
+%/stamp-modules: Makefile
+	$(AM_V_GEN)set -e; \
+	LANG=C ; export LANG; \
+	LC_ALL=C ; export LC_ALL; \
+	sed -n -e '/^sim_install_/{s/^\(sim_install_[a-z_0-9A-Z]*\).*/\1/;p}' $(GEN_MODULES_C_SRCS) | sort >$@.l-tmp; \
+	( \
+	echo '/* Do not modify this file.  */'; \
+	echo '/* It is created automatically by the Makefile.  */'; \
+	echo '#include "libiberty.h"'; \
+	echo '#include "sim-module.h"'; \
+	sed -e 's:\(.*\):extern MODULE_INIT_FN \1;:' $@.l-tmp; \
+	echo 'MODULE_INSTALL_FN * const sim_modules_detected[] = {'; \
+	sed -e 's:\(.*\):  \1,:' $@.l-tmp; \
+	echo '};'; \
+	echo 'const int sim_modules_detected_len = ARRAY_SIZE (sim_modules_detected);'; \
+	) >$@.tmp; \
+	$(SHELL) $(srcroot)/move-if-change $@.tmp $(@D)/modules.c; \
+	rm -f $@.l-tmp; \
+	touch $@
+.PRECIOUS: %/stamp-modules
 
 ## NB: The ppc port doesn't currently utilize the modules API, so skip it.
 %C%_GEN_MODULES_C_TARGETS = $(patsubst %,%/modules.c,$(filter-out ppc,$(SIM_ENABLED_ARCHES)))
-- 
2.39.0


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

* [PATCH 38/83] sim: build: add basic framework for compiling arch objects in top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (36 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 37/83] sim: modules.c: move generation to top-level Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 39/83] sim: aarch64: move arch-specific file compilation to top-level Mike Frysinger
                   ` (44 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The code so far has been assuming that we only compile common/ objects.
Now that we're ready to compile arch-specific objects, refactor some of
the flags & checks a bit to support both.
---
 sim/Makefile.am     | 18 +++++++++++++++---
 sim/Makefile.in     | 18 +++++++++++++-----
 sim/common/defs.h   |  2 +-
 sim/common/local.mk |  3 ++-
 4 files changed, 31 insertions(+), 10 deletions(-)

diff --git a/sim/Makefile.am b/sim/Makefile.am
index e47244d7b8dd..3c46925976f3 100644
--- a/sim/Makefile.am
+++ b/sim/Makefile.am
@@ -41,15 +41,27 @@ BUILT_SOURCES =
 CLEANFILES =
 DISTCLEANFILES =
 MOSTLYCLEANFILES = core
-
-AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS)
+## We build some objects ourselves directly that Automake doesn't track, so
+## make sure all objects in subdirs get cleaned up.
+MOSTLYCLEANFILES += $(SIM_ENABLED_ARCHES:%=%/*.o)
+
+AM_CFLAGS = \
+	$(WERROR_CFLAGS) \
+	$(WARN_CFLAGS) \
+	$(AM_CFLAGS_$(subst -,_,$(@D))) \
+	$(AM_CFLAGS_$(subst -,_,$(@D)_$(@F)))
 AM_CPPFLAGS = \
 	$(INCGNU) \
+	-I$(srcroot) \
 	-I$(srcroot)/include \
 	-I../bfd \
 	-I.. \
+	-I$(@D) \
+	-I$(srcdir)/$(@D) \
 	$(SIM_HW_CFLAGS) \
-	$(SIM_INLINE)
+	$(SIM_INLINE) \
+	$(AM_CPPFLAGS_$(subst -,_,$(@D))) \
+	$(AM_CPPFLAGS_$(subst -,_,$(@D)_$(@F)))
 
 AM_CPPFLAGS_FOR_BUILD = \
 	-I$(srcroot)/include \
diff --git a/sim/common/defs.h b/sim/common/defs.h
index bbaee4ebd0ce..0f4062c2031d 100644
--- a/sim/common/defs.h
+++ b/sim/common/defs.h
@@ -35,7 +35,7 @@
 #undef PACKAGE_VERSION
 
 /* Include common sim's various configure tests.  */
-#ifndef SIM_COMMON_BUILD
+#ifndef SIM_TOPDIR_BUILD
 #include "../config.h"
 #else
 #include "config.h"
diff --git a/sim/common/local.mk b/sim/common/local.mk
index debb55da933b..32b5db6a6eea 100644
--- a/sim/common/local.mk
+++ b/sim/common/local.mk
@@ -20,7 +20,8 @@
 
 AM_CPPFLAGS += \
 	-I$(srcdir)/%D% \
-	-DSIM_COMMON_BUILD
+	-DSIM_TOPDIR_BUILD
+AM_CPPFLAGS_%C% = -DSIM_COMMON_BUILD
 AM_CPPFLAGS_FOR_BUILD += -I$(srcdir)/%D%
 
 ## This makes sure common parts are available before building the arch-subdirs
-- 
2.39.0


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

* [PATCH 39/83] sim: aarch64: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (37 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 38/83] sim: build: add basic framework for compiling arch objects in top-level Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 40/83] sim: arm: " Mike Frysinger
                   ` (43 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

---
 sim/Makefile.in      | 3 ---
 sim/aarch64/local.mk | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/sim/aarch64/local.mk b/sim/aarch64/local.mk
index c986602449a5..bbd832de19d8 100644
--- a/sim/aarch64/local.mk
+++ b/sim/aarch64/local.mk
@@ -31,9 +31,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 40/83] sim: arm: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (38 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 39/83] sim: aarch64: move arch-specific file compilation to top-level Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 41/83] sim: avr: " Mike Frysinger
                   ` (42 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The arch-specific flags are only used by the arch-specific modules,
not the common/ files, so we can delete them too.
---
 sim/Makefile.in     | 4 +---
 sim/arm/Makefile.in | 3 ---
 sim/arm/local.mk    | 5 ++---
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/sim/arm/Makefile.in b/sim/arm/Makefile.in
index 24e1525d6696..43d124d0ca64 100644
--- a/sim/arm/Makefile.in
+++ b/sim/arm/Makefile.in
@@ -16,7 +16,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ## COMMON_PRE_CONFIG_FRAG
-
-SIM_EXTRA_CFLAGS = -DMODET
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/arm/local.mk b/sim/arm/local.mk
index e3ce50fc81ab..68a56e616920 100644
--- a/sim/arm/local.mk
+++ b/sim/arm/local.mk
@@ -16,6 +16,8 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+AM_CPPFLAGS_%C% = -DMODET
+
 %C%_libsim_a_SOURCES =
 %C%_libsim_a_LIBADD = \
 	$(common_libcommon_a_OBJECTS) \
@@ -31,9 +33,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 41/83] sim: avr: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (39 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 40/83] sim: arm: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 42/83] sim: bpf: " Mike Frysinger
                   ` (41 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

---
 sim/Makefile.in  | 3 ---
 sim/avr/local.mk | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/sim/avr/local.mk b/sim/avr/local.mk
index 84ba9d6f6e4f..327a87f0a762 100644
--- a/sim/avr/local.mk
+++ b/sim/avr/local.mk
@@ -27,9 +27,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 42/83] sim: bpf: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (40 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 41/83] sim: avr: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 43/83] sim: bfin: " Mike Frysinger
                   ` (40 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

We can drop the arch-specific rules from the subdir as they're no
longer used.
---
 sim/Makefile.in     | 10 +++++++---
 sim/bpf/Makefile.in | 23 -----------------------
 sim/bpf/local.mk    | 11 ++++++++---
 3 files changed, 15 insertions(+), 29 deletions(-)

diff --git a/sim/bpf/Makefile.in b/sim/bpf/Makefile.in
index 64ec667c12c7..2376b859dd81 100644
--- a/sim/bpf/Makefile.in
+++ b/sim/bpf/Makefile.in
@@ -22,27 +22,4 @@ SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=64
 
 ## COMMON_POST_CONFIG_FRAG
 
-# Dependencies for binaries from CGEN generated source
-
-mloop-le.o: mloop-le.c
-	$(COMPILE) -DWANT_ISA_EBPFLE mloop-le.c
-	$(POSTCOMPILE)
-mloop-be.o: mloop-be.c
-	$(COMPILE) -DWANT_ISA_EBPFBE mloop-be.c
-	$(POSTCOMPILE)
-
-decode-le.o: decode-le.c
-	$(COMPILE) -DWANT_ISA_EBPFLE $(srcdir)/decode-le.c
-	$(POSTCOMPILE)
-decode-be.o: decode-be.c
-	$(COMPILE) -DWANT_ISA_EBPFBE $(srcdir)/decode-be.c
-	$(POSTCOMPILE)
-
-sem-le.o: sem-le.c
-	$(COMPILE) -DWANT_ISA_EBPFLE $(srcdir)/sem-le.c
-	$(POSTCOMPILE)
-sem-be.o: sem-be.c
-	$(COMPILE) -DWANT_ISA_EBPFBE $(srcdir)/sem-be.c
-	$(POSTCOMPILE)
-
 arch = bpf
diff --git a/sim/bpf/local.mk b/sim/bpf/local.mk
index 19dcc25736c1..580f744520c8 100644
--- a/sim/bpf/local.mk
+++ b/sim/bpf/local.mk
@@ -15,6 +15,14 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+AM_CPPFLAGS_%C% = -DWITH_TARGET_WORD_BITSIZE=64
+AM_CPPFLAGS_%C%_mloop_le.o = -DWANT_ISA_EBPFLE
+AM_CPPFLAGS_%C%_mloop_be.o = -DWANT_ISA_EBPFBE
+AM_CPPFLAGS_%C%_decode_le.o = -DWANT_ISA_EBPFLE
+AM_CPPFLAGS_%C%_decode_be.o = -DWANT_ISA_EBPFBE
+AM_CPPFLAGS_%C%_sem_le.o = -DWANT_ISA_EBPFLE
+AM_CPPFLAGS_%C%_sem_be.o = -DWANT_ISA_EBPFBE
+
 %C%_libsim_a_SOURCES =
 %C%_libsim_a_LIBADD = \
 	$(common_libcommon_a_OBJECTS) \
@@ -44,9 +52,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 43/83] sim: bfin: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (41 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 42/83] sim: bpf: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 44/83] sim: cr16: " Mike Frysinger
                   ` (39 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The arch-specific flags are only used by the arch-specific modules,
not the common/ files, so we can delete them too.
---
 sim/Makefile.in      | 4 +---
 sim/bfin/Makefile.in | 2 --
 sim/bfin/local.mk    | 5 ++---
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/sim/bfin/Makefile.in b/sim/bfin/Makefile.in
index 569c64bb22f5..472bb48e6723 100644
--- a/sim/bfin/Makefile.in
+++ b/sim/bfin/Makefile.in
@@ -19,6 +19,4 @@
 
 arch = bfin
 
-SIM_EXTRA_CFLAGS = $(SDL_CFLAGS)
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/bfin/local.mk b/sim/bfin/local.mk
index 95bc73000cb8..d3c5b17a82b9 100644
--- a/sim/bfin/local.mk
+++ b/sim/bfin/local.mk
@@ -16,6 +16,8 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+AM_CPPFLAGS_%C% = $(SDL_CFLAGS)
+
 %C%_libsim_a_SOURCES =
 %C%_libsim_a_LIBADD = \
 	$(common_libcommon_a_OBJECTS) \
@@ -33,9 +35,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 44/83] sim: cr16: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (42 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 43/83] sim: bfin: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 45/83] sim: cris: " Mike Frysinger
                   ` (38 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

---
 sim/Makefile.in   | 3 ---
 sim/cr16/local.mk | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/sim/cr16/local.mk b/sim/cr16/local.mk
index b0d7ad7cad7a..7cdfc3fe67f1 100644
--- a/sim/cr16/local.mk
+++ b/sim/cr16/local.mk
@@ -30,9 +30,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 45/83] sim: cris: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (43 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 44/83] sim: cr16: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 46/83] sim: d10v: " Mike Frysinger
                   ` (37 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

---
 sim/Makefile.in   | 3 ---
 sim/cris/local.mk | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/sim/cris/local.mk b/sim/cris/local.mk
index 912ca12a32f4..3950baed7a10 100644
--- a/sim/cris/local.mk
+++ b/sim/cris/local.mk
@@ -47,9 +47,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 46/83] sim: d10v: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (44 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 45/83] sim: cris: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 47/83] sim: erc32: " Mike Frysinger
                   ` (36 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

---
 sim/Makefile.in   | 3 ---
 sim/d10v/local.mk | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/sim/d10v/local.mk b/sim/d10v/local.mk
index c9ca13f720c1..eb769bc0d9bf 100644
--- a/sim/d10v/local.mk
+++ b/sim/d10v/local.mk
@@ -31,9 +31,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 47/83] sim: erc32: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (45 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 46/83] sim: d10v: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 48/83] sim: example-synacor: " Mike Frysinger
                   ` (35 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The arch-specific flags are only used by the arch-specific modules,
not the common/ files, so we can delete them too.
---
 sim/Makefile.in       |  6 +++---
 sim/erc32/Makefile.in | 10 ----------
 sim/erc32/local.mk    | 11 ++++++++---
 3 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/sim/erc32/Makefile.in b/sim/erc32/Makefile.in
index 58afbe1f7476..adff308c23b3 100644
--- a/sim/erc32/Makefile.in
+++ b/sim/erc32/Makefile.in
@@ -17,14 +17,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ## COMMON_PRE_CONFIG_FRAG
-
-READLINE_SRC = $(srcroot)/readline/readline
-
-SIM_EXTRA_CFLAGS = $(READLINE_CFLAGS)
-
-# UARTS run at about 115200 baud (simulator time). Add -DFAST_UART to
-# CFLAGS if faster (infinite) UART speed is desired. Might affect the
-# behaviour of UART interrupt routines ...
-SIM_EXTRA_CFLAGS += -DFAST_UART
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/erc32/local.mk b/sim/erc32/local.mk
index 7c95128a1668..12aced4bafa4 100644
--- a/sim/erc32/local.mk
+++ b/sim/erc32/local.mk
@@ -17,6 +17,14 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+READLINE_SRC = $(srcroot)/readline/readline
+AM_CPPFLAGS_%C% = $(READLINE_CFLAGS)
+
+## UARTS run at about 115200 baud (simulator time). Add -DFAST_UART to
+## CFLAGS if faster (infinite) UART speed is desired. Might affect the
+## behaviour of UART interrupt routines ...
+AM_CPPFLAGS_%C% += -DFAST_UART
+
 %C%_libsim_a_SOURCES =
 %C%_libsim_a_LIBADD = \
 	$(common_libcommon_a_OBJECTS) \
@@ -31,9 +39,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 48/83] sim: example-synacor: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (46 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 47/83] sim: erc32: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 49/83] sim: frv: " Mike Frysinger
                   ` (34 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

---
 sim/Makefile.in              | 3 ---
 sim/example-synacor/local.mk | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/sim/example-synacor/local.mk b/sim/example-synacor/local.mk
index 9f00eebc26e5..f1d4974be2a2 100644
--- a/sim/example-synacor/local.mk
+++ b/sim/example-synacor/local.mk
@@ -29,9 +29,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 49/83] sim: frv: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (47 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 48/83] sim: example-synacor: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 50/83] sim: ft32: " Mike Frysinger
                   ` (33 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The arch-specific flags are only used by the arch-specific modules,
not the common/ files, so we can delete them too.
---
 sim/Makefile.in     | 6 +++---
 sim/frv/Makefile.in | 6 ------
 sim/frv/local.mk    | 9 ++++++---
 3 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/sim/frv/Makefile.in b/sim/frv/Makefile.in
index f577873c057a..d898bcbc2493 100644
--- a/sim/frv/Makefile.in
+++ b/sim/frv/Makefile.in
@@ -16,12 +16,6 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ## COMMON_PRE_CONFIG_FRAG
-
-SIM_EXTRA_CFLAGS = @SIM_FRV_TRAPDUMP_FLAGS@
-
-# Some modules don't build cleanly yet.
-memory.o sem.o: SIM_WERROR_CFLAGS =
-
 ## COMMON_POST_CONFIG_FRAG
 
 arch = frv
diff --git a/sim/frv/local.mk b/sim/frv/local.mk
index 2451235d2385..a060a46ffa8f 100644
--- a/sim/frv/local.mk
+++ b/sim/frv/local.mk
@@ -16,6 +16,12 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+AM_CPPFLAGS_%C% = $(SIM_FRV_TRAPDUMP_FLAGS)
+
+## Some modules don't build cleanly yet.
+AM_CFLAGS_%C%_memory.o = -Wno-error
+AM_CFLAGS_%C%_sem.o = -Wno-error
+
 %C%_libsim_a_SOURCES =
 %C%_libsim_a_LIBADD = \
 	$(common_libcommon_a_OBJECTS) \
@@ -57,9 +63,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 50/83] sim: ft32: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (48 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 49/83] sim: frv: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 51/83] sim: h8300: " Mike Frysinger
                   ` (32 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

---
 sim/Makefile.in   | 3 ---
 sim/ft32/local.mk | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/sim/ft32/local.mk b/sim/ft32/local.mk
index 2752f268e046..b3eca03be7b1 100644
--- a/sim/ft32/local.mk
+++ b/sim/ft32/local.mk
@@ -28,9 +28,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 51/83] sim: h8300: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (49 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 50/83] sim: ft32: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 52/83] sim: iq2000: " Mike Frysinger
                   ` (31 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

---
 sim/Makefile.in    | 3 ---
 sim/h8300/local.mk | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/sim/h8300/local.mk b/sim/h8300/local.mk
index 65aa081a1ca9..af4ecc197bf7 100644
--- a/sim/h8300/local.mk
+++ b/sim/h8300/local.mk
@@ -28,9 +28,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 52/83] sim: iq2000: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (50 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 51/83] sim: h8300: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 53/83] sim: lm32: " Mike Frysinger
                   ` (30 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

---
 sim/Makefile.in     | 3 ---
 sim/iq2000/local.mk | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/sim/iq2000/local.mk b/sim/iq2000/local.mk
index 98385a07f580..abc8b31a8ab5 100644
--- a/sim/iq2000/local.mk
+++ b/sim/iq2000/local.mk
@@ -41,9 +41,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 53/83] sim: lm32: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (51 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 52/83] sim: iq2000: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 54/83] sim: m32c: " Mike Frysinger
                   ` (29 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

---
 sim/Makefile.in   | 3 ---
 sim/lm32/local.mk | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/sim/lm32/local.mk b/sim/lm32/local.mk
index 987f2ac25b83..d61566ecb4e9 100644
--- a/sim/lm32/local.mk
+++ b/sim/lm32/local.mk
@@ -44,9 +44,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 54/83] sim: m32c: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (52 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 53/83] sim: lm32: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 55/83] sim: m32r: " Mike Frysinger
                   ` (28 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The arch-specific flags are only used by the arch-specific modules,
not the common/ files, so we can delete them too.
---
 sim/Makefile.in      | 4 +---
 sim/m32c/Makefile.in | 3 ---
 sim/m32c/local.mk    | 5 ++---
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/sim/m32c/Makefile.in b/sim/m32c/Makefile.in
index 4c91e57dd2d0..02d204366ac5 100644
--- a/sim/m32c/Makefile.in
+++ b/sim/m32c/Makefile.in
@@ -19,7 +19,4 @@
 ### along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ## COMMON_PRE_CONFIG_FRAG
-
-SIM_EXTRA_CFLAGS = -DTIMER_A
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/m32c/local.mk b/sim/m32c/local.mk
index 56332402f329..e992b01d3067 100644
--- a/sim/m32c/local.mk
+++ b/sim/m32c/local.mk
@@ -16,6 +16,8 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+AM_CPPFLAGS_%C% = -DTIMER_A
+
 %C%_libsim_a_SOURCES =
 %C%_libsim_a_LIBADD = \
 	$(common_libcommon_a_OBJECTS) \
@@ -35,9 +37,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 55/83] sim: m32r: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (53 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 54/83] sim: m32c: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 56/83] sim: m68hc11: " Mike Frysinger
                   ` (27 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

---
 sim/Makefile.in      | 15 ++++++++++++---
 sim/m32r/Makefile.in |  3 ---
 sim/m32r/local.mk    | 17 ++++++++++++++---
 3 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/sim/m32r/Makefile.in b/sim/m32r/Makefile.in
index bc7b85694792..43346b8b9849 100644
--- a/sim/m32r/Makefile.in
+++ b/sim/m32r/Makefile.in
@@ -21,7 +21,4 @@
 
 arch = m32r
 
-# Some modules don't build cleanly yet.
-cpu.o cpu2.o cpux.o m32r.o m32r2.o m32rx.o mloop.o mloop2.o mloopx.o sem.o sim-if.o traps.o: SIM_WERROR_CFLAGS =
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/m32r/local.mk b/sim/m32r/local.mk
index afecaf6c8bce..3ccfce79b095 100644
--- a/sim/m32r/local.mk
+++ b/sim/m32r/local.mk
@@ -16,6 +16,20 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+## Some modules don't build cleanly yet.
+AM_CFLAGS_%C%_cpu.o = -Wno-error
+AM_CFLAGS_%C%_cpu2.o = -Wno-error
+AM_CFLAGS_%C%_cpux.o = -Wno-error
+AM_CFLAGS_%C%_m32r.o = -Wno-error
+AM_CFLAGS_%C%_m32r2.o = -Wno-error
+AM_CFLAGS_%C%_m32rx.o = -Wno-error
+AM_CFLAGS_%C%_mloop.o = -Wno-error
+AM_CFLAGS_%C%_mloop2.o = -Wno-error
+AM_CFLAGS_%C%_mloopx.o = -Wno-error
+AM_CFLAGS_%C%_sem.o = -Wno-error
+AM_CFLAGS_%C%_sim_if.o = -Wno-error
+AM_CFLAGS_%C%_traps.o = -Wno-error
+
 %C%_libsim_a_SOURCES =
 %C%_libsim_a_LIBADD = \
 	$(common_libcommon_a_OBJECTS) \
@@ -56,9 +70,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 56/83] sim: m68hc11: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (54 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 55/83] sim: m32r: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 57/83] sim: mcore: " Mike Frysinger
                   ` (26 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The arch-specific compiler flags are duplicated, but they'll be cleaned
up once we move all subdir compiles to the top-level.
---
 sim/Makefile.in      |  9 ++++++---
 sim/m68hc11/local.mk | 14 +++++++++++---
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/sim/m68hc11/local.mk b/sim/m68hc11/local.mk
index 9b52df6b533c..79350c8fc270 100644
--- a/sim/m68hc11/local.mk
+++ b/sim/m68hc11/local.mk
@@ -16,6 +16,17 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+## 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'
+## instead of 'address_word' in some places (the result is a truncation
+## of the 32-bit address to 16-bit; and this breaks the simulator).
+AM_CPPFLAGS_%C% = \
+	-DWITH_TARGET_WORD_BITSIZE=32 \
+	-DWITH_TARGET_CELL_BITSIZE=32 \
+	-DWITH_TARGET_ADDRESS_BITSIZE=32 \
+	-DWITH_TARGET_WORD_MSB=31
+
 %C%_libsim_a_SOURCES =
 %C%_libsim_a_LIBADD = \
 	$(common_libcommon_a_OBJECTS) \
@@ -34,9 +45,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 57/83] sim: mcore: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (55 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 56/83] sim: m68hc11: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 58/83] sim: microblaze: " Mike Frysinger
                   ` (25 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

---
 sim/Makefile.in    | 3 ---
 sim/mcore/local.mk | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/sim/mcore/local.mk b/sim/mcore/local.mk
index 94abebc1dbbc..69cb043df967 100644
--- a/sim/mcore/local.mk
+++ b/sim/mcore/local.mk
@@ -28,9 +28,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 58/83] sim: microblaze: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (56 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 57/83] sim: mcore: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 59/83] sim: mips: " Mike Frysinger
                   ` (24 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

---
 sim/Makefile.in         | 3 ---
 sim/microblaze/local.mk | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/sim/microblaze/local.mk b/sim/microblaze/local.mk
index 94abebc1dbbc..69cb043df967 100644
--- a/sim/microblaze/local.mk
+++ b/sim/microblaze/local.mk
@@ -28,9 +28,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 59/83] sim: mips: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (57 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 58/83] sim: microblaze: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 60/83] sim: mn10300: " Mike Frysinger
                   ` (23 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The arch-specific compiler flags are duplicated, but they'll be cleaned
up once we move all subdir compiles to the top-level.
---
 sim/Makefile.in   | 8 +++++---
 sim/mips/local.mk | 8 +++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/sim/mips/local.mk b/sim/mips/local.mk
index f255ffca611f..c25e50b1d65f 100644
--- a/sim/mips/local.mk
+++ b/sim/mips/local.mk
@@ -16,6 +16,11 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+AM_CPPFLAGS_%C% = \
+	@SIM_MIPS_SUBTARGET@ \
+	-DWITH_TARGET_WORD_BITSIZE=@SIM_MIPS_BITSIZE@ -DWITH_TARGET_WORD_MSB=WITH_TARGET_WORD_BITSIZE-1 \
+	-DWITH_FLOATING_POINT=HARD_FLOATING_POINT -DWITH_TARGET_FLOATING_POINT_BITSIZE=@SIM_MIPS_FPU_BITSIZE@
+
 %C%_GEN_OBJ =
 if SIM_MIPS_GEN_MODE_SINGLE
 %C%_GEN_OBJ += \
@@ -69,9 +74,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 60/83] sim: mn10300: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (58 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 59/83] sim: mips: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 61/83] sim: moxie: " Mike Frysinger
                   ` (22 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The arch-specific compiler flags are duplicated, but they'll be cleaned
up once we move all subdir compiles to the top-level.
---
 sim/Makefile.in      | 7 ++++---
 sim/mn10300/local.mk | 7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/sim/mn10300/local.mk b/sim/mn10300/local.mk
index 06b42087699a..527d580804e7 100644
--- a/sim/mn10300/local.mk
+++ b/sim/mn10300/local.mk
@@ -16,6 +16,10 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+AM_CPPFLAGS_%C% = \
+	-DPOLL_QUIT_INTERVAL=0x20 \
+	-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
+
 %C%_libsim_a_SOURCES =
 %C%_libsim_a_LIBADD = \
 	$(common_libcommon_a_OBJECTS) \
@@ -37,9 +41,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 61/83] sim: moxie: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (59 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 60/83] sim: mn10300: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 62/83] sim: msp430: " Mike Frysinger
                   ` (21 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The arch-specific flags are only used by the arch-specific modules,
not the common/ files, so we can delete them too.
---
 sim/Makefile.in       | 4 +---
 sim/moxie/Makefile.in | 3 ---
 sim/moxie/local.mk    | 5 ++---
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/sim/moxie/Makefile.in b/sim/moxie/Makefile.in
index fd9beedbf1d6..0067fabbe5ca 100644
--- a/sim/moxie/Makefile.in
+++ b/sim/moxie/Makefile.in
@@ -16,7 +16,4 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ## COMMON_PRE_CONFIG_FRAG
-
-SIM_EXTRA_CFLAGS = -DDTB="\"$(dtbdir)/moxie-gdb.dtb\""
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/moxie/local.mk b/sim/moxie/local.mk
index 813bdc895339..b75f0a9a8e31 100644
--- a/sim/moxie/local.mk
+++ b/sim/moxie/local.mk
@@ -16,6 +16,8 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+AM_CPPFLAGS_%C% = -DDTB="\"$(dtbdir)/moxie-gdb.dtb\""
+
 %C%_libsim_a_SOURCES =
 %C%_libsim_a_LIBADD = \
 	$(common_libcommon_a_OBJECTS) \
@@ -28,9 +30,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 62/83] sim: msp430: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (60 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 61/83] sim: moxie: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 63/83] sim: or1k: " Mike Frysinger
                   ` (20 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

---
 sim/Makefile.in     | 3 ---
 sim/msp430/local.mk | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/sim/msp430/local.mk b/sim/msp430/local.mk
index 772d12f0a17d..0d9e8c2147f0 100644
--- a/sim/msp430/local.mk
+++ b/sim/msp430/local.mk
@@ -28,9 +28,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 63/83] sim: or1k: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (61 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 62/83] sim: msp430: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 64/83] sim: pru: " Mike Frysinger
                   ` (19 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The arch-specific compiler flags are duplicated, but they'll be cleaned
up once we move all subdir compiles to the top-level.
---
 sim/Makefile.in   | 4 +---
 sim/or1k/local.mk | 5 ++---
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/sim/or1k/local.mk b/sim/or1k/local.mk
index a7412bfa07ce..1294986a6d8b 100644
--- a/sim/or1k/local.mk
+++ b/sim/or1k/local.mk
@@ -15,6 +15,8 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+AM_CPPFLAGS_%C% = -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
+
 %C%_libsim_a_SOURCES =
 %C%_libsim_a_LIBADD = \
 	$(common_libcommon_a_OBJECTS) \
@@ -43,9 +45,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 64/83] sim: pru: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (62 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 63/83] sim: or1k: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 65/83] sim: riscv: " Mike Frysinger
                   ` (18 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

---
 sim/Makefile.in  | 3 ---
 sim/pru/local.mk | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/sim/pru/local.mk b/sim/pru/local.mk
index 0c3018cbeb2d..75f842a4689c 100644
--- a/sim/pru/local.mk
+++ b/sim/pru/local.mk
@@ -28,9 +28,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 65/83] sim: riscv: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (63 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 64/83] sim: pru: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 66/83] sim: rl78: " Mike Frysinger
                   ` (17 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The arch-specific compiler flags are duplicated, but they'll be cleaned
up once we move all subdir compiles to the top-level.
---
 sim/Makefile.in    | 4 +---
 sim/riscv/local.mk | 5 ++---
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/sim/riscv/local.mk b/sim/riscv/local.mk
index 6f03fc3d0346..a77f6f74317d 100644
--- a/sim/riscv/local.mk
+++ b/sim/riscv/local.mk
@@ -16,6 +16,8 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+AM_CPPFLAGS_%C% = -DWITH_TARGET_WORD_BITSIZE=$(SIM_RISCV_BITSIZE)
+
 %C%_libsim_a_SOURCES =
 %C%_libsim_a_LIBADD = \
 	$(common_libcommon_a_OBJECTS) \
@@ -30,9 +32,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 66/83] sim: rl78: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (64 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 65/83] sim: riscv: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 67/83] sim: rx: " Mike Frysinger
                   ` (16 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

---
 sim/Makefile.in   | 3 ---
 sim/rl78/local.mk | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/sim/rl78/local.mk b/sim/rl78/local.mk
index 935fbf1eea07..13962a9e3024 100644
--- a/sim/rl78/local.mk
+++ b/sim/rl78/local.mk
@@ -30,9 +30,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 67/83] sim: rx: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (65 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 66/83] sim: rl78: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 68/83] sim: sh: " Mike Frysinger
                   ` (15 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The arch-specific flags are only used by the arch-specific modules,
not the common/ files, so we can delete them too.
---
 sim/Makefile.in    | 4 +---
 sim/rx/Makefile.in | 3 ---
 sim/rx/local.mk    | 5 ++---
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/sim/rx/Makefile.in b/sim/rx/Makefile.in
index 0c4a1f6ab6b6..da241390ab1e 100644
--- a/sim/rx/Makefile.in
+++ b/sim/rx/Makefile.in
@@ -19,7 +19,4 @@
 ### along with the GNU simulators; if not, see <http://www.gnu.org/licenses/>.
 
 ## COMMON_PRE_CONFIG_FRAG
-
-SIM_EXTRA_CFLAGS = @SIM_RX_CYCLE_ACCURATE_FLAGS@
-
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/rx/local.mk b/sim/rx/local.mk
index c23ac4f8035c..7115286a9b50 100644
--- a/sim/rx/local.mk
+++ b/sim/rx/local.mk
@@ -16,6 +16,8 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+AM_CPPFLAGS_%C% = $(SIM_RX_CYCLE_ACCURATE_FLAGS)
+
 %C%_libsim_a_SOURCES =
 %C%_libsim_a_LIBADD = \
 	$(common_libcommon_a_OBJECTS) \
@@ -34,9 +36,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 68/83] sim: sh: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (66 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 67/83] sim: rx: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 69/83] sim: v850: " Mike Frysinger
                   ` (14 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

---
 sim/Makefile.in | 3 ---
 sim/sh/local.mk | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/sim/sh/local.mk b/sim/sh/local.mk
index b7c9e615725f..8bfbc0fa2835 100644
--- a/sim/sh/local.mk
+++ b/sim/sh/local.mk
@@ -28,9 +28,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 69/83] sim: v850: move arch-specific file compilation to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (67 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 68/83] sim: sh: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 70/83] sim: move arch-specific file compilation of common/ files " Mike Frysinger
                   ` (13 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

The arch-specific compiler flags are duplicated, but they'll be cleaned
up once we move all subdir compiles to the top-level.
---
 sim/Makefile.in   | 4 +---
 sim/v850/local.mk | 5 ++---
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/sim/v850/local.mk b/sim/v850/local.mk
index 769c6030d6ef..b044db1638f8 100644
--- a/sim/v850/local.mk
+++ b/sim/v850/local.mk
@@ -16,6 +16,8 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+AM_CPPFLAGS_%C% = -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
+
 %C%_libsim_a_SOURCES =
 %C%_libsim_a_LIBADD = \
 	$(common_libcommon_a_OBJECTS) \
@@ -36,9 +38,6 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: %D%/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
 %D%/%.o: common/%.c
 	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
 
-- 
2.39.0


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

* [PATCH 70/83] sim: move arch-specific file compilation of common/ files to top-level
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (68 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 69/83] sim: v850: " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 71/83] sim: common: move test-hw-events to top-level build Mike Frysinger
                   ` (12 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

---
 sim/Makefile.am              |   8 +++
 sim/Makefile.in              | 129 ++++++++++++++++++-----------------
 sim/aarch64/local.mk         |   4 +-
 sim/arm/local.mk             |   4 +-
 sim/avr/local.mk             |   4 +-
 sim/bfin/local.mk            |   4 +-
 sim/bpf/local.mk             |   4 +-
 sim/cr16/local.mk            |   4 +-
 sim/cris/local.mk            |   4 +-
 sim/d10v/local.mk            |   4 +-
 sim/erc32/local.mk           |   4 +-
 sim/example-synacor/local.mk |   4 +-
 sim/frv/local.mk             |   4 +-
 sim/ft32/local.mk            |   4 +-
 sim/h8300/local.mk           |   4 +-
 sim/iq2000/local.mk          |   4 +-
 sim/lm32/local.mk            |   4 +-
 sim/m32c/local.mk            |   4 +-
 sim/m32r/local.mk            |   4 +-
 sim/m68hc11/local.mk         |   4 +-
 sim/mcore/local.mk           |   4 +-
 sim/microblaze/local.mk      |   4 +-
 sim/mips/local.mk            |   4 +-
 sim/mn10300/local.mk         |   4 +-
 sim/moxie/local.mk           |   4 +-
 sim/msp430/local.mk          |   4 +-
 sim/or1k/local.mk            |   4 +-
 sim/pru/local.mk             |   4 +-
 sim/riscv/local.mk           |   4 +-
 sim/rl78/local.mk            |   4 +-
 sim/rx/local.mk              |   4 +-
 sim/sh/local.mk              |   4 +-
 sim/v850/local.mk            |   4 +-
 33 files changed, 137 insertions(+), 124 deletions(-)

diff --git a/sim/Makefile.am b/sim/Makefile.am
index 3c46925976f3..fa646ab1b051 100644
--- a/sim/Makefile.am
+++ b/sim/Makefile.am
@@ -93,6 +93,14 @@ pkginclude_HEADERS += \
 	$(srcroot)/include/sim/sim.h
 endif
 
+## Used for our custom rules to calculate the dependency output base name.
+## This form aligns with Automake's default rules.
+SIM_DEPBASE = $(@D)/$(DEPDIR)/$(@F:.o=)
+## Actual full compile command like Automake's default rules.
+SIM_COMPILE = \
+	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(SIM_DEPBASE).Tpo -c -o $@ $< && \
+	$(am__mv) $(SIM_DEPBASE).Tpo $(SIM_DEPBASE).Po
+
 include common/local.mk
 if SIM_ENABLE_IGEN
 include igen/local.mk
diff --git a/sim/aarch64/local.mk b/sim/aarch64/local.mk
index bbd832de19d8..10e814b49f90 100644
--- a/sim/aarch64/local.mk
+++ b/sim/aarch64/local.mk
@@ -31,8 +31,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/arm/local.mk b/sim/arm/local.mk
index 68a56e616920..c172b5f26824 100644
--- a/sim/arm/local.mk
+++ b/sim/arm/local.mk
@@ -33,8 +33,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/avr/local.mk b/sim/avr/local.mk
index 327a87f0a762..3cae5bf8483b 100644
--- a/sim/avr/local.mk
+++ b/sim/avr/local.mk
@@ -27,8 +27,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/bfin/local.mk b/sim/bfin/local.mk
index d3c5b17a82b9..90b697e9dcb0 100644
--- a/sim/bfin/local.mk
+++ b/sim/bfin/local.mk
@@ -35,8 +35,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/bpf/local.mk b/sim/bpf/local.mk
index 580f744520c8..5f559c93a02e 100644
--- a/sim/bpf/local.mk
+++ b/sim/bpf/local.mk
@@ -52,8 +52,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/cr16/local.mk b/sim/cr16/local.mk
index 7cdfc3fe67f1..8d8d27f82e67 100644
--- a/sim/cr16/local.mk
+++ b/sim/cr16/local.mk
@@ -30,8 +30,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/cris/local.mk b/sim/cris/local.mk
index 3950baed7a10..78f40e03ec49 100644
--- a/sim/cris/local.mk
+++ b/sim/cris/local.mk
@@ -47,8 +47,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/d10v/local.mk b/sim/d10v/local.mk
index eb769bc0d9bf..04dd763f57c0 100644
--- a/sim/d10v/local.mk
+++ b/sim/d10v/local.mk
@@ -31,8 +31,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/erc32/local.mk b/sim/erc32/local.mk
index 12aced4bafa4..2361cf2eafc8 100644
--- a/sim/erc32/local.mk
+++ b/sim/erc32/local.mk
@@ -39,8 +39,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/example-synacor/local.mk b/sim/example-synacor/local.mk
index f1d4974be2a2..37999807ba32 100644
--- a/sim/example-synacor/local.mk
+++ b/sim/example-synacor/local.mk
@@ -29,8 +29,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/frv/local.mk b/sim/frv/local.mk
index a060a46ffa8f..8c2a61588429 100644
--- a/sim/frv/local.mk
+++ b/sim/frv/local.mk
@@ -63,8 +63,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/ft32/local.mk b/sim/ft32/local.mk
index b3eca03be7b1..36081effabec 100644
--- a/sim/ft32/local.mk
+++ b/sim/ft32/local.mk
@@ -28,8 +28,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/h8300/local.mk b/sim/h8300/local.mk
index af4ecc197bf7..dca8084763d0 100644
--- a/sim/h8300/local.mk
+++ b/sim/h8300/local.mk
@@ -28,8 +28,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/iq2000/local.mk b/sim/iq2000/local.mk
index abc8b31a8ab5..34589dbad885 100644
--- a/sim/iq2000/local.mk
+++ b/sim/iq2000/local.mk
@@ -41,8 +41,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/lm32/local.mk b/sim/lm32/local.mk
index d61566ecb4e9..f3e0567d73bf 100644
--- a/sim/lm32/local.mk
+++ b/sim/lm32/local.mk
@@ -44,8 +44,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/m32c/local.mk b/sim/m32c/local.mk
index e992b01d3067..ad047f17b783 100644
--- a/sim/m32c/local.mk
+++ b/sim/m32c/local.mk
@@ -37,8 +37,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/m32r/local.mk b/sim/m32r/local.mk
index 3ccfce79b095..31178a3b034e 100644
--- a/sim/m32r/local.mk
+++ b/sim/m32r/local.mk
@@ -70,8 +70,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/m68hc11/local.mk b/sim/m68hc11/local.mk
index 79350c8fc270..da4c25913d8f 100644
--- a/sim/m68hc11/local.mk
+++ b/sim/m68hc11/local.mk
@@ -45,8 +45,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/mcore/local.mk b/sim/mcore/local.mk
index 69cb043df967..dff8a684ef44 100644
--- a/sim/mcore/local.mk
+++ b/sim/mcore/local.mk
@@ -28,8 +28,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/microblaze/local.mk b/sim/microblaze/local.mk
index 69cb043df967..dff8a684ef44 100644
--- a/sim/microblaze/local.mk
+++ b/sim/microblaze/local.mk
@@ -28,8 +28,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/mips/local.mk b/sim/mips/local.mk
index c25e50b1d65f..136eebaacafa 100644
--- a/sim/mips/local.mk
+++ b/sim/mips/local.mk
@@ -74,8 +74,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/mn10300/local.mk b/sim/mn10300/local.mk
index 527d580804e7..61c7f9188eaf 100644
--- a/sim/mn10300/local.mk
+++ b/sim/mn10300/local.mk
@@ -41,8 +41,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/moxie/local.mk b/sim/moxie/local.mk
index b75f0a9a8e31..4b7d2984f16e 100644
--- a/sim/moxie/local.mk
+++ b/sim/moxie/local.mk
@@ -30,8 +30,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/msp430/local.mk b/sim/msp430/local.mk
index 0d9e8c2147f0..bb7afd304705 100644
--- a/sim/msp430/local.mk
+++ b/sim/msp430/local.mk
@@ -28,8 +28,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/or1k/local.mk b/sim/or1k/local.mk
index 1294986a6d8b..2a3b129c9fb9 100644
--- a/sim/or1k/local.mk
+++ b/sim/or1k/local.mk
@@ -45,8 +45,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/pru/local.mk b/sim/pru/local.mk
index 75f842a4689c..0048199f6d3e 100644
--- a/sim/pru/local.mk
+++ b/sim/pru/local.mk
@@ -28,8 +28,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/riscv/local.mk b/sim/riscv/local.mk
index a77f6f74317d..a3f232eea5ec 100644
--- a/sim/riscv/local.mk
+++ b/sim/riscv/local.mk
@@ -32,8 +32,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/rl78/local.mk b/sim/rl78/local.mk
index 13962a9e3024..56161eae25a2 100644
--- a/sim/rl78/local.mk
+++ b/sim/rl78/local.mk
@@ -30,8 +30,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/rx/local.mk b/sim/rx/local.mk
index 7115286a9b50..3b1e199e68b8 100644
--- a/sim/rx/local.mk
+++ b/sim/rx/local.mk
@@ -36,8 +36,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/sh/local.mk b/sim/sh/local.mk
index 8bfbc0fa2835..558a747d2661 100644
--- a/sim/sh/local.mk
+++ b/sim/sh/local.mk
@@ -28,8 +28,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
diff --git a/sim/v850/local.mk b/sim/v850/local.mk
index b044db1638f8..62d3e82ff76a 100644
--- a/sim/v850/local.mk
+++ b/sim/v850/local.mk
@@ -38,8 +38,8 @@ $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
 
-%D%/%.o: common/%.c
-	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
 
 %C%_run_SOURCES =
 %C%_run_LDADD = \
-- 
2.39.0


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

* [PATCH 71/83] sim: common: move test-hw-events to top-level build
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (69 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 70/83] sim: move arch-specific file compilation of common/ files " Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 72/83] sim: disable recursive make in (most) subdirs Mike Frysinger
                   ` (11 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

This is an internal developer target that isn't normally compiled,
but it can still be occasionally useful.  Move it to the top-level
build so we can kill off common/Make-common.in.
---
 sim/Makefile.in           | 6 ++++++
 sim/common/Make-common.in | 5 -----
 sim/common/hw-events.c    | 2 ++
 sim/common/local.mk       | 9 +++++++++
 4 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 15242c612647..a081525c91ce 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -154,11 +154,6 @@ override COMPILE.pre = source='$<' object='$@' libtool=no \
 override POSTCOMPILE =
 endif
 
-test-hw-events: $(srccom)/hw-events.c libsim.a
-	$(ECHO_CCLD) $(LIBTOOL) $(AM_V_lt) --tag=CC --mode=link \
-		$(CC) $(ALL_CFLAGS) -DMAIN -o test-hw-events$(EXEEXT) \
-		$(srccom)/hw-events.c libsim.a $(EXTRA_LIBS)
-
 # Support targets.
 
 install:
diff --git a/sim/common/hw-events.c b/sim/common/hw-events.c
index 99e2f1a7fd8d..fc579a85706c 100644
--- a/sim/common/hw-events.c
+++ b/sim/common/hw-events.c
@@ -23,6 +23,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <stdarg.h>
 #include <string.h>
 
+#include "sim/callback.h"
+
 #include "hw-main.h"
 #include "hw-base.h"
 
diff --git a/sim/common/local.mk b/sim/common/local.mk
index 32b5db6a6eea..f79a30113740 100644
--- a/sim/common/local.mk
+++ b/sim/common/local.mk
@@ -52,6 +52,15 @@ noinst_LIBRARIES += %D%/libcommon.a
 CLEANFILES += \
 	%D%/version.c %D%/version.c-stamp
 
+## NB: This is a bit of a hack.  If we can generalize the common/ files, we can
+## turn this from an arch-specific %/test-hw-events into a common/test-hw-events
+## program.
+.PRECIOUS: %/test-hw-events.o
+%/test-hw-events.o: common/hw-events.c
+	$(AM_V_CC)$(COMPILE) -DMAIN -c -o $@ $<
+%/test-hw-events: %/test-hw-events.o %/libsim.a
+	$(AM_V_CCLD)$(LINK) -o $@ $^ $(SIM_COMMON_LIBS) $(LIBS)
+
 ##
 ## For subdirs.
 ##
-- 
2.39.0


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

* [PATCH 72/83] sim: disable recursive make in (most) subdirs
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (70 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 71/83] sim: common: move test-hw-events to top-level build Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 73/83] sim: build: drop subdir Makefile.in files Mike Frysinger
                   ` (10 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

Now that all (other than ppc) build in the top-level, we can disable
the recursive make calls to them.  This speeds things up nicely.
---
 sim/Makefile.am  |   2 +-
 sim/Makefile.in  |  97 +-------
 sim/configure    | 600 +----------------------------------------------
 sim/configure.ac |  21 --
 4 files changed, 13 insertions(+), 707 deletions(-)

diff --git a/sim/Makefile.am b/sim/Makefile.am
index fa646ab1b051..29086d22d682 100644
--- a/sim/Makefile.am
+++ b/sim/Makefile.am
@@ -24,7 +24,7 @@ GNULIB_PARENT_DIR = ..
 srccom = $(srcdir)/common
 srcroot = $(srcdir)/..
 
-SUBDIRS = @subdirs@ $(SIM_SUBDIRS)
+SUBDIRS = @subdirs@
 
 SIM_PRIMARY_TARGET = @SIM_PRIMARY_TARGET@
 AM_MAKEFLAGS =
diff --git a/sim/configure.ac b/sim/configure.ac
index 45a9e1303045..8198780c1eb1 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -48,10 +48,6 @@ dnl used when installing files to see if they need to be suffixed.
 SIM_PRIMARY_TARGET=
 AC_SUBST(SIM_PRIMARY_TARGET)
 
-dnl Directories that we need to recurse into (i.e. add to $SUBDIRS).
-SIM_SUBDIRS=
-AC_SUBST(SIM_SUBDIRS)
-
 dnl List of enabled arch backends.
 SIM_ENABLED_ARCHES=
 AC_SUBST(SIM_ENABLED_ARCHES)
@@ -62,7 +58,6 @@ SIM_COMMON_BUILD_FALSE='#'
 AC_SUBST(SIM_COMMON_BUILD_TRUE)
 AC_SUBST(SIM_COMMON_BUILD_FALSE)
 
-AC_CONFIG_FILES(Make-common.sim:common/Make-common.in)
 ENABLE_SIM=no
 dnl Build a particular arch subdir.
 dnl arg[1] is the arch subdir name.
@@ -72,22 +67,6 @@ m4_define([SIM_BUILD_TARGET], [dnl
   AS_VAR_APPEND([SIM_ENABLED_ARCHES], [" $1"])
   m4_if($2, [true], [dnl
     AC_CONFIG_SUBDIRS($1)
-  ], [dnl
-    AC_CONFIG_FILES($1/Makefile.sim:$1/Makefile.in)
-    AC_CONFIG_COMMANDS([$1/Makefile],
-[sed -n \
-	-e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ {
-		/^srcdir = / s:$:/$1:
-		p
-	}' \
-	<Make-common.sim >$1/Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >$1/Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r $1/Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r $1/Makesim2.tmp' \
-	<$1/Makefile.sim >$1/Makefile
- rm -f $1/Makesim1.tmp $1/Makesim2.tmp
-])
-    AS_VAR_APPEND([SIM_SUBDIRS], [" $1"])
   ])
   AC_CONFIG_FILES($1/.gdbinit:common/gdbinit.in)
   dnl Create the depdirs for ports until we can convert them to automake.
-- 
2.39.0


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

* [PATCH 73/83] sim: build: drop subdir Makefile.in files
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (71 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 72/83] sim: disable recursive make in (most) subdirs Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 74/83] sim: build: delete Make-common.in logic Mike Frysinger
                   ` (9 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

These aren't used anymore, so punt them all.
---
 sim/aarch64/Makefile.in         | 23 -----------------------
 sim/arm/Makefile.in             | 19 -------------------
 sim/avr/Makefile.in             | 18 ------------------
 sim/bfin/Makefile.in            | 22 ----------------------
 sim/bpf/Makefile.in             | 25 -------------------------
 sim/cr16/Makefile.in            | 19 -------------------
 sim/cris/Makefile.in            | 24 ------------------------
 sim/d10v/Makefile.in            | 19 -------------------
 sim/erc32/Makefile.in           | 20 --------------------
 sim/example-synacor/Makefile.in | 19 -------------------
 sim/frv/Makefile.in             | 21 ---------------------
 sim/ft32/Makefile.in            | 19 -------------------
 sim/h8300/Makefile.in           | 19 -------------------
 sim/iq2000/Makefile.in          | 21 ---------------------
 sim/lm32/Makefile.in            |  8 --------
 sim/m32c/Makefile.in            | 22 ----------------------
 sim/m32r/Makefile.in            | 24 ------------------------
 sim/m68hc11/Makefile.in         | 32 --------------------------------
 sim/mcore/Makefile.in           | 19 -------------------
 sim/microblaze/Makefile.in      | 19 -------------------
 sim/mips/Makefile.in            | 14 --------------
 sim/mn10300/Makefile.in         | 27 ---------------------------
 sim/moxie/Makefile.in           | 19 -------------------
 sim/msp430/Makefile.in          | 20 --------------------
 sim/or1k/Makefile.in            | 25 -------------------------
 sim/pru/Makefile.in             | 21 ---------------------
 sim/riscv/Makefile.in           | 22 ----------------------
 sim/rl78/Makefile.in            | 22 ----------------------
 sim/rx/Makefile.in              | 22 ----------------------
 sim/sh/Makefile.in              | 19 -------------------
 sim/v850/Makefile.in            | 22 ----------------------
 31 files changed, 645 deletions(-)
 delete mode 100644 sim/aarch64/Makefile.in
 delete mode 100644 sim/arm/Makefile.in
 delete mode 100644 sim/avr/Makefile.in
 delete mode 100644 sim/bfin/Makefile.in
 delete mode 100644 sim/bpf/Makefile.in
 delete mode 100644 sim/cr16/Makefile.in
 delete mode 100644 sim/cris/Makefile.in
 delete mode 100644 sim/d10v/Makefile.in
 delete mode 100644 sim/erc32/Makefile.in
 delete mode 100644 sim/example-synacor/Makefile.in
 delete mode 100644 sim/frv/Makefile.in
 delete mode 100644 sim/ft32/Makefile.in
 delete mode 100644 sim/h8300/Makefile.in
 delete mode 100644 sim/iq2000/Makefile.in
 delete mode 100644 sim/lm32/Makefile.in
 delete mode 100644 sim/m32c/Makefile.in
 delete mode 100644 sim/m32r/Makefile.in
 delete mode 100644 sim/m68hc11/Makefile.in
 delete mode 100644 sim/mcore/Makefile.in
 delete mode 100644 sim/microblaze/Makefile.in
 delete mode 100644 sim/mips/Makefile.in
 delete mode 100644 sim/mn10300/Makefile.in
 delete mode 100644 sim/moxie/Makefile.in
 delete mode 100644 sim/msp430/Makefile.in
 delete mode 100644 sim/or1k/Makefile.in
 delete mode 100644 sim/pru/Makefile.in
 delete mode 100644 sim/riscv/Makefile.in
 delete mode 100644 sim/rl78/Makefile.in
 delete mode 100644 sim/rx/Makefile.in
 delete mode 100644 sim/sh/Makefile.in
 delete mode 100644 sim/v850/Makefile.in

diff --git a/sim/aarch64/Makefile.in b/sim/aarch64/Makefile.in
deleted file mode 100644
index 82224f06ccf0..000000000000
--- a/sim/aarch64/Makefile.in
+++ /dev/null
@@ -1,23 +0,0 @@
-#### Makefile.in --- Makefile template for the AArch64 simulator
-
-### Copyright (C) 2015-2023 Free Software Foundation, Inc.
-
-### Contributed by Red Hat.
-
-### This file is part of GDB.
-
-### This program is free software; you can redistribute it and/or modify
-### it under the terms of the GNU General Public License as published by
-### the Free Software Foundation; either version 3 of the License, or
-### (at your option) any later version.
-###
-### This program is distributed in the hope that it will be useful,
-### but WITHOUT ANY WARRANTY; without even the implied warranty of
-### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-### GNU General Public License for more details.
-###
-### You should have received a copy of the GNU General Public License
-### along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/arm/Makefile.in b/sim/arm/Makefile.in
deleted file mode 100644
index 43d124d0ca64..000000000000
--- a/sim/arm/Makefile.in
+++ /dev/null
@@ -1,19 +0,0 @@
-#    Makefile template for Configure for the arm sim library.
-#    Copyright 1995-2023 Free Software Foundation, Inc.
-#    Written by Cygnus Support.
-# 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/avr/Makefile.in b/sim/avr/Makefile.in
deleted file mode 100644
index 202bda36d2fd..000000000000
--- a/sim/avr/Makefile.in
+++ /dev/null
@@ -1,18 +0,0 @@
-#    Makefile template for Configure for the AVR sim library.
-#    Copyright (C) 2009-2023 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/bfin/Makefile.in b/sim/bfin/Makefile.in
deleted file mode 100644
index 472bb48e6723..000000000000
--- a/sim/bfin/Makefile.in
+++ /dev/null
@@ -1,22 +0,0 @@
-#    Makefile template for Configure for the Blackfin simulator.
-#    Copyright (C) 2005-2023 Free Software Foundation, Inc.
-#    Written by Analog Devices, Inc.
-# 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-
-arch = bfin
-
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/bpf/Makefile.in b/sim/bpf/Makefile.in
deleted file mode 100644
index 2376b859dd81..000000000000
--- a/sim/bpf/Makefile.in
+++ /dev/null
@@ -1,25 +0,0 @@
-# Makefile template for configure for the eBPF simulator
-# Copyright (C) 2020-2023 Free Software Foundation, Inc.
-#
-# This file is part of GDB, the GNU debugger.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-
-SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=64
-
-## COMMON_POST_CONFIG_FRAG
-
-arch = bpf
diff --git a/sim/cr16/Makefile.in b/sim/cr16/Makefile.in
deleted file mode 100644
index 37a91c585313..000000000000
--- a/sim/cr16/Makefile.in
+++ /dev/null
@@ -1,19 +0,0 @@
-# Makefile template for Configure for the CR16 sim library.
-# Copyright (C) 2008-2023 Free Software Foundation, Inc.
-# Contributed by M Ranga Swami Reddy <MR.Swami.Reddy@nsc.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/cris/Makefile.in b/sim/cris/Makefile.in
deleted file mode 100644
index b1a2e83bad43..000000000000
--- a/sim/cris/Makefile.in
+++ /dev/null
@@ -1,24 +0,0 @@
-# Makefile template for Configure for the CRIS simulator, based on a mix
-# of the ones for m32r and i960.
-#
-# Copyright (C) 2004-2023 Free Software Foundation, Inc.
-# Contributed by Axis Communications.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-
-arch = cris
-
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/d10v/Makefile.in b/sim/d10v/Makefile.in
deleted file mode 100644
index 15cfc21807d2..000000000000
--- a/sim/d10v/Makefile.in
+++ /dev/null
@@ -1,19 +0,0 @@
-#    Makefile template for Configure for the D10v sim library.
-#    Copyright (C) 1996-2023 Free Software Foundation, Inc.
-#    Written by Cygnus Support.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/erc32/Makefile.in b/sim/erc32/Makefile.in
deleted file mode 100644
index adff308c23b3..000000000000
--- a/sim/erc32/Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
-#    Makefile template for Configure for the erc32sim library.
-#    Copyright (C) 1993-2023 Free Software Foundation, Inc.
-#    Written by Cygnus Support
-#    Modified by J.Gaisler ESA/ESTEC
-# 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/example-synacor/Makefile.in b/sim/example-synacor/Makefile.in
deleted file mode 100644
index a8e8fc7d2d5b..000000000000
--- a/sim/example-synacor/Makefile.in
+++ /dev/null
@@ -1,19 +0,0 @@
-#    Makefile template for Configure for the example synacor simulator.
-#    Copyright (C) 2005-2023 Free Software Foundation, Inc.
-#    Written by Mike Frysinger <vapier@gentoo.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/frv/Makefile.in b/sim/frv/Makefile.in
deleted file mode 100644
index d898bcbc2493..000000000000
--- a/sim/frv/Makefile.in
+++ /dev/null
@@ -1,21 +0,0 @@
-# Makefile template for Configure for the frv simulator
-# Copyright (C) 1998-2023 Free Software Foundation, Inc.
-# Contributed by Red Hat.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
-
-arch = frv
diff --git a/sim/ft32/Makefile.in b/sim/ft32/Makefile.in
deleted file mode 100644
index 50f497ebb9d7..000000000000
--- a/sim/ft32/Makefile.in
+++ /dev/null
@@ -1,19 +0,0 @@
-#    Makefile template for Configure for the ft32 sim library.
-#    Copyright (C) 2008-2023 Free Software Foundation, Inc.
-#    Written by FTDI
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/h8300/Makefile.in b/sim/h8300/Makefile.in
deleted file mode 100644
index 7d378cb970f1..000000000000
--- a/sim/h8300/Makefile.in
+++ /dev/null
@@ -1,19 +0,0 @@
-#    Makefile template for Configure for the h8300 sim library.
-#    Copyright (C) 1990-2023 Free Software Foundation, Inc.
-#    Written by Cygnus Support.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/iq2000/Makefile.in b/sim/iq2000/Makefile.in
deleted file mode 100644
index 6114d0e96f31..000000000000
--- a/sim/iq2000/Makefile.in
+++ /dev/null
@@ -1,21 +0,0 @@
-# Makefile template for Configure for the IQ2000 simulator
-# Copyright (C) 1998-2023 Free Software Foundation, Inc.
-# Contributed by Cygnus Support.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
-
-arch = iq2000
diff --git a/sim/lm32/Makefile.in b/sim/lm32/Makefile.in
deleted file mode 100644
index d34049a3682e..000000000000
--- a/sim/lm32/Makefile.in
+++ /dev/null
@@ -1,8 +0,0 @@
-# Makefile for Lattice Mico32 simulator.
-# Contributed by Jon Beniston <jon@beniston.com>
-
-## COMMON_PRE_CONFIG_FRAG
-
-arch = lm32
-
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/m32c/Makefile.in b/sim/m32c/Makefile.in
deleted file mode 100644
index 02d204366ac5..000000000000
--- a/sim/m32c/Makefile.in
+++ /dev/null
@@ -1,22 +0,0 @@
-#### Makefile.in --- Makefile template for the M32C simulator
-
-### Copyright (C) 2005-2023 Free Software Foundation, Inc.
-### Contributed by Red Hat, Inc.
-### 
-### This file is part of the GNU simulators.
-### 
-### This program is free software; you can redistribute it and/or modify
-### it under the terms of the GNU General Public License as published by
-### the Free Software Foundation; either version 3 of the License, or
-### (at your option) any later version.
-###
-### This program is distributed in the hope that it will be useful,
-### but WITHOUT ANY WARRANTY; without even the implied warranty of
-### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-### GNU General Public License for more details.
-###
-### You should have received a copy of the GNU General Public License
-### along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/m32r/Makefile.in b/sim/m32r/Makefile.in
deleted file mode 100644
index 43346b8b9849..000000000000
--- a/sim/m32r/Makefile.in
+++ /dev/null
@@ -1,24 +0,0 @@
-# Makefile template for Configure for the m32r simulator
-# Copyright (C) 1996-2023 Free Software Foundation, Inc.
-# Contributed by Cygnus Support.
-#
-# This file is part of GDB, the GNU debugger.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-
-arch = m32r
-
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/m68hc11/Makefile.in b/sim/m68hc11/Makefile.in
deleted file mode 100644
index 5c8ee196a6c4..000000000000
--- a/sim/m68hc11/Makefile.in
+++ /dev/null
@@ -1,32 +0,0 @@
-#    Makefile template for Configure for the 68HC11 sim library.
-#    Copyright (C) 1999-2023 Free Software Foundation, Inc.
-#    Written by Cygnus Support.
-# 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-
-arch = m68hc11
-
-# 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'
-# instead of 'address_word' in some places (the result is a truncation
-# of the 32-bit address to 16-bit; and this breaks the simulator).
-SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=32 \
-		   -DWITH_TARGET_CELL_BITSIZE=32 \
-		   -DWITH_TARGET_ADDRESS_BITSIZE=32 \
-		   -DWITH_TARGET_WORD_MSB=31
-
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/mcore/Makefile.in b/sim/mcore/Makefile.in
deleted file mode 100644
index a16303ca2595..000000000000
--- a/sim/mcore/Makefile.in
+++ /dev/null
@@ -1,19 +0,0 @@
-#    Makefile template for Configure for the MCore sim library.
-#    Copyright (C) 1990-2023 Free Software Foundation, Inc.
-#    Written by Cygnus Solutions.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/microblaze/Makefile.in b/sim/microblaze/Makefile.in
deleted file mode 100644
index a16303ca2595..000000000000
--- a/sim/microblaze/Makefile.in
+++ /dev/null
@@ -1,19 +0,0 @@
-#    Makefile template for Configure for the MCore sim library.
-#    Copyright (C) 1990-2023 Free Software Foundation, Inc.
-#    Written by Cygnus Solutions.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in
deleted file mode 100644
index 8829e3d9b0e2..000000000000
--- a/sim/mips/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#    Makefile template for Configure for the MIPS simulator.
-#    Written by Cygnus Support.
-
-## COMMON_PRE_CONFIG_FRAG
-
-arch = mips
-
-# List of flags to always pass to $(CC).
-SIM_EXTRA_CFLAGS = @SIM_MIPS_SUBTARGET@
-
-SIM_BITSIZE = -DWITH_TARGET_WORD_BITSIZE=@SIM_MIPS_BITSIZE@ -DWITH_TARGET_WORD_MSB=WITH_TARGET_WORD_BITSIZE-1
-SIM_FLOAT = -DWITH_FLOATING_POINT=HARD_FLOATING_POINT -DWITH_TARGET_FLOATING_POINT_BITSIZE=@SIM_MIPS_FPU_BITSIZE@
-
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/mn10300/Makefile.in b/sim/mn10300/Makefile.in
deleted file mode 100644
index a545450fdc81..000000000000
--- a/sim/mn10300/Makefile.in
+++ /dev/null
@@ -1,27 +0,0 @@
-#    Makefile template for Configure for the mn10300 sim library.
-#    Copyright (C) 1996-2023 Free Software Foundation, Inc.
-#    Written by Cygnus Support.
-# 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-
-arch = mn10300
-
-# List of extra flags to always pass to $(CC).
-SIM_EXTRA_CFLAGS = \
-	-DPOLL_QUIT_INTERVAL=0x20 \
-	-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
-
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/moxie/Makefile.in b/sim/moxie/Makefile.in
deleted file mode 100644
index 0067fabbe5ca..000000000000
--- a/sim/moxie/Makefile.in
+++ /dev/null
@@ -1,19 +0,0 @@
-#    Makefile template for Configure for the moxie sim library.
-#    Copyright (C) 2008-2023 Free Software Foundation, Inc.
-#    Written by Anthony Green
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/msp430/Makefile.in b/sim/msp430/Makefile.in
deleted file mode 100644
index 7960d8639325..000000000000
--- a/sim/msp430/Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
-#    Makefile template for Configure for the MSP430 sim library.
-#    Copyright 2012-2023 Free Software Foundation, Inc.
-#    Written by Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/or1k/Makefile.in b/sim/or1k/Makefile.in
deleted file mode 100644
index 9df0e6d4fa64..000000000000
--- a/sim/or1k/Makefile.in
+++ /dev/null
@@ -1,25 +0,0 @@
-# Makefile template for configure for the or1k simulator
-# Copyright (C) 2017-2023 Free Software Foundation, Inc.
-#
-# This file is part of GDB, the GNU debugger.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-
-SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
-
-## COMMON_POST_CONFIG_FRAG
-
-arch = or1k
diff --git a/sim/pru/Makefile.in b/sim/pru/Makefile.in
deleted file mode 100644
index 214d2eea478d..000000000000
--- a/sim/pru/Makefile.in
+++ /dev/null
@@ -1,21 +0,0 @@
-#    Makefile template for Configure for the PRU sim library.
-#    Copyright (C) 1990-2023 Free Software Foundation, Inc.
-#    Written by Dimitar Dimitrov <dimitar@dinux.eu>
-#
-#    Based on the MCore sim library
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/riscv/Makefile.in b/sim/riscv/Makefile.in
deleted file mode 100644
index e4631052349b..000000000000
--- a/sim/riscv/Makefile.in
+++ /dev/null
@@ -1,22 +0,0 @@
-#    Makefile template for Configure for the example basic simulator.
-#    Copyright (C) 2005-2023 Free Software Foundation, Inc.
-#    Written by Mike Frysinger.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-
-SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=@SIM_RISCV_BITSIZE@
-
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/rl78/Makefile.in b/sim/rl78/Makefile.in
deleted file mode 100644
index f57356eb8077..000000000000
--- a/sim/rl78/Makefile.in
+++ /dev/null
@@ -1,22 +0,0 @@
-#### Makefile.in --- Makefile template for the RL78 simulator
-
-### Copyright (C) 2008-2023 Free Software Foundation, Inc.
-### Contributed by Red Hat, Inc.
-### 
-### This file is part of the GNU simulators.
-### 
-### The GNU simulators are free software; you can redistribute them and/or
-### modify them under the terms of the GNU General Public License as
-### published by the Free Software Foundation; either version 3 of the
-### License, or (at your option) any later version.
-### 
-### The GNU simulators are distributed in the hope that they will be
-### useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
-### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-### General Public License for more details.
-### 
-### You should have received a copy of the GNU General Public License
-### along with the GNU simulators; if not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/rx/Makefile.in b/sim/rx/Makefile.in
deleted file mode 100644
index da241390ab1e..000000000000
--- a/sim/rx/Makefile.in
+++ /dev/null
@@ -1,22 +0,0 @@
-#### Makefile.in --- Makefile template for the RX simulator
-
-### Copyright (C) 2008-2023 Free Software Foundation, Inc.
-### Contributed by Red Hat, Inc.
-### 
-### This file is part of the GNU simulators.
-### 
-### The GNU simulators are free software; you can redistribute them and/or
-### modify them under the terms of the GNU General Public License as
-### published by the Free Software Foundation; either version 3 of the
-### License, or (at your option) any later version.
-### 
-### The GNU simulators are distributed in the hope that they will be
-### useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
-### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-### General Public License for more details.
-### 
-### You should have received a copy of the GNU General Public License
-### along with the GNU simulators; if not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/sh/Makefile.in b/sim/sh/Makefile.in
deleted file mode 100644
index 8abf705126b9..000000000000
--- a/sim/sh/Makefile.in
+++ /dev/null
@@ -1,19 +0,0 @@
-#    Makefile template for Configure for the SH sim library.
-#    Copyright (C) 1990-2023 Free Software Foundation, Inc.
-#    Written by Cygnus Support.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-## COMMON_POST_CONFIG_FRAG
diff --git a/sim/v850/Makefile.in b/sim/v850/Makefile.in
deleted file mode 100644
index dc319dca70aa..000000000000
--- a/sim/v850/Makefile.in
+++ /dev/null
@@ -1,22 +0,0 @@
-#    Makefile template for Configure for the V850 sim library.
-#    Copyright (C) 1996-2023 Free Software Foundation, Inc.
-#    Written by Cygnus Support.
-# 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-## COMMON_PRE_CONFIG_FRAG
-
-SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
-
-## COMMON_POST_CONFIG_FRAG
-- 
2.39.0


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

* [PATCH 74/83] sim: build: delete Make-common.in logic
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (72 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 73/83] sim: build: drop subdir Makefile.in files Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 75/83] sim: build: drop AM_MAKEFLAGS settings Mike Frysinger
                   ` (8 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

Now that all (other than ppc) build in the top-level, this logic is
unused, so punt it all.
---
 sim/Makefile.in           |   4 -
 sim/README-HACKING        |  45 +-------
 sim/common/Make-common.in | 210 --------------------------------------
 sim/common/local.mk       |   1 -
 sim/configure             |  16 +--
 sim/configure.ac          |  13 ---
 6 files changed, 3 insertions(+), 286 deletions(-)
 delete mode 100644 sim/common/Make-common.in

diff --git a/sim/README-HACKING b/sim/README-HACKING
index fd6461e5ae90..55caa7b15b20 100644
--- a/sim/README-HACKING
+++ b/sim/README-HACKING
@@ -17,54 +17,11 @@ The common directory contains:
 
 - common documentation files (e.g. run.1, and maybe in time .texi files)
 - common source files (e.g. run.c)
-- common Makefile fragment and configury (e.g. Make-common.in, aclocal.m4).
+- common Makefile fragment and configury (e.g. common/local.mk)
 
 In addition "common" contains portions of the system call support
 (e.g. callback.c, target-newlib-*.c).
 \f
-Common Makefile Support
-=======================
-
-A common configuration framework is available for simulators that want
-to use it.  The common framework exists to remove a lot of duplication
-in configure.ac and Makefile.in, and it also provides a foundation for
-enhancing the simulators uniformly (e.g. the more they share in common
-the easier a feature added to one is added to all).
-
-The Makefile.in of a simulator using the common framework should look like:
-
---- snip ---
-# Makefile for blah ...
-# Copyright blah ...
-
-## COMMON_PRE_CONFIG_FRAG
-
-# These variables are given default values in COMMON_PRE_CONFIG_FRAG.
-# We override the ones we need to here.
-# Not all of these need to be mentioned, only the necessary ones.
-# In fact it is better to *not* mention ones if the value is the default.
-
-# List of flags to always pass to $(CC).
-SIM_EXTRA_CFLAGS =
-# Dependency of `clean' to clean any extra files.
-SIM_EXTRA_CLEAN =
-
-## COMMON_POST_CONFIG_FRAG
-
-... target specific rules ...
---- snip ---
-
-COMMON_{PRE,POST}_CONFIG_FRAG are markers for configure to tell it
-where to insert the two pieces of common/Make-common.in.
-The resulting Makefile is created by doing autoconf substitions on
-both the target's Makefile.in and Make-common.in, and inserting
-the two pieces of Make-common.in into the target's Makefile.in at
-COMMON_{PRE,POST}_CONFIG_FRAG.
-
-Note that SIM_EXTRA_{INSTALL,CLEAN} could be removed and "::" targets
-could be used instead.  However, it's not clear yet whether "::" targets
-are portable enough.
-\f
 TAGS support
 ============
 
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
deleted file mode 100644
index a081525c91ce..000000000000
--- a/sim/common/Make-common.in
+++ /dev/null
@@ -1,210 +0,0 @@
-# Makefile fragment for common parts of all simulators.
-# Copyright 1997-2023 Free Software Foundation, Inc.
-# Contributed by Cygnus Support.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# This Makefile fragment consists of two separate parts.
-# They are merged into the final Makefile at points denoted by
-# "## COMMON_PRE_CONFIG_FRAG" and "## COMMON_POST_CONFIG_FRAG".
-#
-# The target Makefile should look like:
-#
-#># Copyright blah blah
-#>
-#>## COMMON_PRE_CONFIG_FRAG
-#>
-#># Any overrides necessary for the SIM_FOO config vars.
-#>SIM_FOO = ...
-#>
-#>## COMMON_POST_CONFIG_FRAG
-#>
-#># Rules to build target specific .o's.
-
-## COMMON_PRE_CONFIG_FRAG
-
-srcdir = @abs_srcdir@
-VPATH = $(srcdir):$(srccom)
-srccom = $(srcdir)/../common
-srcroot = $(srcdir)/../..
-srcsim = $(srcdir)/..
-
-@SIM_COMMON_BUILD_FALSE@config.status = config.status
-@SIM_COMMON_BUILD_TRUE@config.status = ../config.status
-
-# Settings from top-level configure.
-include ../arch-subdir.mk
-
-include $(srcroot)/gdb/silent-rules.mk
-
-ifeq ($(V),0)
-ECHO_STAMP = @echo "  GEN   "
-else
-ECHO_STAMP = @:
-endif
-
-# Helper code from gnulib.
-GNULIB_PARENT_DIR = ../..
-include $(GNULIB_PARENT_DIR)/gnulib/Makefile.gnulib.inc
-
-# This can be referenced by the gettext configuration code.
-top_builddir = ..
-
-SHELL = @SHELL@
-
-SIM_BITSIZE = @sim_bitsize@
-SIM_FLOAT = @sim_float@
-SIM_WARN_CFLAGS = $(WARN_CFLAGS)
-SIM_WERROR_CFLAGS = $(WERROR_CFLAGS)
-
-# Dependency tracking information.
-depcomp = $(SHELL) $(srcroot)/depcomp
-
-# Note that these are overridden by GNU make-specific code below if
-# GNU make is used.  The overrides implement dependency tracking.
-COMPILE.pre = $(CC) $(C_DIALECT)
-COMPILE.post = -c -o $@
-COMPILE = $(ECHO_CC) $(COMPILE.pre) $(ALL_CFLAGS) $(COMPILE.post)
-POSTCOMPILE = @true
-
-# Each simulator's Makefile.in defines one or more of these variables
-# to override our settings as necessary.  There is no need to define these
-# in the simulator's Makefile.in if one is using the default value.  In fact
-# it's preferable not to.
-
-# List of flags to always pass to $(CC).
-SIM_EXTRA_CFLAGS =
-# Dependency of `clean' to clean any extra files.
-SIM_EXTRA_CLEAN =
-
-# Every time a new general purpose source file was added every target's
-# Makefile.in needed to be updated to include the file.
-# This doesn't scale.
-# This variable specifies all the generic stuff common to the newer simulators.
-# Things like sim-reason.o can't go here as the cpu may provide its own
-# (though hopefully in time that won't be so).  Things like sim-bits.o can go
-# here.  Some files are used by all simulators (e.g. callback.o).
-
-## End COMMON_PRE_CONFIG_FRAG
-
-## COMMON_POST_CONFIG_FRAG
-
-CONFIG_CFLAGS = \
-	-DHAVE_CONFIG_H \
-	$(SIM_BITSIZE) \
-	$(SIM_FLOAT) \
-	$(SIM_HW_CFLAGS) \
-	$(SIM_INLINE) \
-	$(SIM_WARN_CFLAGS) \
-	$(SIM_WERROR_CFLAGS)
-CSEARCH = -I. -I$(srcdir) -I$(srccom) \
-  -I$(srcroot)/include \
-  -I../../bfd \
-  -I$(srcroot) \
-  -I../..
-ALL_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(INCGNU) $(SIM_EXTRA_CFLAGS) $(CFLAGS)
-BUILD_CFLAGS = $(CFLAGS_FOR_BUILD) $(CSEARCH)
-
-COMMON_DEP_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(SIM_EXTRA_CFLAGS)
-
-LIBIBERTY_LIB = ../../libiberty/libiberty.a
-BFD_LIB = ../../bfd/libbfd.la
-OPCODES_LIB = ../../opcodes/libopcodes.la
-LIBDEPS = $(BFD_LIB) $(OPCODES_LIB) $(LIBIBERTY_LIB)
-EXTRA_LIBS = $(BFD_LIB) $(OPCODES_LIB) $(LIBIBERTY_LIB) \
-	$(COMMON_LIBS) $(LIBGNU) $(LIBGNU_EXTRA_LIBS)
-
-COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS)
-LINK_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(LDFLAGS_FOR_BUILD) -o $@
-
-RUNTESTFLAGS =
-
-all:
-
-#
-# Dependency tracking.  Most of this is conditional on GNU Make being
-# found by configure; if GNU Make is not found, we fall back to a
-# simpler scheme.
-#
-
-ifeq ($(DEPMODE),depmode=gcc3)
-# Note that we put the dependencies into a .Tpo file, then move them
-# into place if the compile succeeds.  We need this because gcc does
-# not atomically write the dependency output file.
-override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
-	-MF $(DEPDIR)/$(basename $(@F)).Tpo
-override POSTCOMPILE = @mv $(DEPDIR)/$(basename $(@F)).Tpo \
-	$(DEPDIR)/$(basename $(@F)).Po
-else
-override COMPILE.pre = source='$<' object='$@' libtool=no \
-	DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) $(CC)
-# depcomp handles atomicity for us, so we don't need a postcompile
-# step.
-override POSTCOMPILE =
-endif
-
-# Support targets.
-
-install:
-installdirs:
-uninstall:
-
-check:
-
-html:
-clean-html:
-install-html:
-
-info:
-clean-info:
-install-info:
-
-pdf:
-clean-pdf:
-install-pdf:
-
-.NOEXPORT:
-MAKEOVERRIDES=
-
-tags etags: TAGS
-
-# Macros like EXTERN_SIM_CORE confuse tags.
-# And the sim-n-foo.h files create functions that can't be found either.
-TAGS: force
-	cd $(srcdir) && \
-	etags --regex '/^\([[:lower:]_]+\) (/\1/' --regex '/^\/[*] TAGS: .*/' \
-		*.[ch] ../common/*.[ch]
-
-mostlyclean clean: $(SIM_EXTRA_CLEAN)
-	rm -f *.[oa] *~ core
-
-distclean maintainer-clean realclean: clean
-	rm -f TAGS Makefile
-
-.c.o:
-	$(COMPILE) $<
-	$(POSTCOMPILE)
-
-# Dummy target to force execution of dependent targets.
-force:
-
-Makefile: Makefile.in $(srccom)/Make-common.in $(config.status)
-@SIM_COMMON_BUILD_FALSE@	$(ECHO_GEN) CONFIG_HEADERS= $(SHELL) ./config.status
-@SIM_COMMON_BUILD_TRUE@	$(ECHO_GEN) pwd=`pwd` && subdir=`basename "$$pwd"` && cd .. && \
-@SIM_COMMON_BUILD_TRUE@		$(SHELL) ./config.status Make-common.sim $$subdir/Makefile.sim $$subdir/Makefile
-
-@SIM_COMMON_BUILD_FALSE@config.status: configure
-@SIM_COMMON_BUILD_FALSE@	$(ECHO_GEN) $(SHELL) ./config.status --recheck
-
-## End COMMON_POST_CONFIG_FRAG
diff --git a/sim/common/local.mk b/sim/common/local.mk
index f79a30113740..0ed18359ae43 100644
--- a/sim/common/local.mk
+++ b/sim/common/local.mk
@@ -16,7 +16,6 @@
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ## Parts of the common/ sim code that have been unified.
-## Most still lives in common/Make-common.in.
 
 AM_CPPFLAGS += \
 	-I$(srcdir)/%D% \
diff --git a/sim/configure.ac b/sim/configure.ac
index 8198780c1eb1..91447ae4c655 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -52,12 +52,6 @@ dnl List of enabled arch backends.
 SIM_ENABLED_ARCHES=
 AC_SUBST(SIM_ENABLED_ARCHES)
 
-dnl Used by common/Make-common.in to see which configure script created it.
-SIM_COMMON_BUILD_TRUE=
-SIM_COMMON_BUILD_FALSE='#'
-AC_SUBST(SIM_COMMON_BUILD_TRUE)
-AC_SUBST(SIM_COMMON_BUILD_FALSE)
-
 ENABLE_SIM=no
 dnl Build a particular arch subdir.
 dnl arg[1] is the arch subdir name.
@@ -176,13 +170,6 @@ if test $sim_cv_decl_getopt_unistd_h = yes; then
 	    [Is the prototype for getopt in <unistd.h> in the expected format?])
 fi
 
-dnl These are unfortunate.  They are conditionally called by other sim macros
-dnl but always used by common/Make-common.in.  So we have to subst here even
-dnl when the rest of the code is in the respective macros.  Once we merge the
-dnl respective SIM_AC_OPTION_xxx call above, we can drop these.
-AC_SUBST(sim_bitsize)
-AC_SUBST(sim_float)
-
 dnl Some arches have unique configure flags.
 m4_include([frv/acinclude.m4])
 m4_include([mips/acinclude.m4])
-- 
2.39.0


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

* [PATCH 75/83] sim: build: drop AM_MAKEFLAGS settings
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (73 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 74/83] sim: build: delete Make-common.in logic Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 76/83] sim: common: simplify hw-config.h deps Mike Frysinger
                   ` (7 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

We don't have any recursive builds anymore, so we can drop this logic.
---
 sim/Makefile.in      | 335 +++++++++++++++++++++----------------------
 sim/bfin/local.mk    |   1 -
 sim/common/local.mk  |   4 -
 sim/cris/local.mk    |   1 -
 sim/lm32/local.mk    |   1 -
 sim/m32r/local.mk    |   1 -
 sim/m68hc11/local.mk |   1 -
 sim/mips/local.mk    |   1 -
 sim/mn10300/local.mk |   1 -
 9 files changed, 162 insertions(+), 184 deletions(-)

diff --git a/sim/bfin/local.mk b/sim/bfin/local.mk
index 90b697e9dcb0..17a5047fa240 100644
--- a/sim/bfin/local.mk
+++ b/sim/bfin/local.mk
@@ -78,7 +78,6 @@ noinst_PROGRAMS += %D%/run
 	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
diff --git a/sim/common/local.mk b/sim/common/local.mk
index 0ed18359ae43..2c68f668d37c 100644
--- a/sim/common/local.mk
+++ b/sim/common/local.mk
@@ -106,16 +106,12 @@ SIM_NEW_COMMON_OBJS = \
 	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
 
 # FIXME This is one very simple-minded way of generating the file hw-config.h.
diff --git a/sim/cris/local.mk b/sim/cris/local.mk
index 78f40e03ec49..ef78c63062c2 100644
--- a/sim/cris/local.mk
+++ b/sim/cris/local.mk
@@ -59,7 +59,6 @@ noinst_LIBRARIES += %D%/libsim.a
 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.
diff --git a/sim/lm32/local.mk b/sim/lm32/local.mk
index f3e0567d73bf..1c286245cca1 100644
--- a/sim/lm32/local.mk
+++ b/sim/lm32/local.mk
@@ -56,7 +56,6 @@ noinst_LIBRARIES += %D%/libsim.a
 noinst_PROGRAMS += %D%/run
 
 %C%_SIM_EXTRA_HW_DEVICES = lm32cpu lm32timer lm32uart
-AM_MAKEFLAGS += %C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"
 
 ## List all generated headers to help Automake dependency tracking.
 BUILT_SOURCES += %D%/eng.h
diff --git a/sim/m32r/local.mk b/sim/m32r/local.mk
index 31178a3b034e..78c8a87a42eb 100644
--- a/sim/m32r/local.mk
+++ b/sim/m32r/local.mk
@@ -82,7 +82,6 @@ noinst_LIBRARIES += %D%/libsim.a
 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)"
 
 ## List all generated headers to help Automake dependency tracking.
 BUILT_SOURCES += \
diff --git a/sim/m68hc11/local.mk b/sim/m68hc11/local.mk
index da4c25913d8f..8f881d5b854d 100644
--- a/sim/m68hc11/local.mk
+++ b/sim/m68hc11/local.mk
@@ -57,7 +57,6 @@ noinst_LIBRARIES += %D%/libsim.a
 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) \
diff --git a/sim/mips/local.mk b/sim/mips/local.mk
index 136eebaacafa..e54a0ef6102e 100644
--- a/sim/mips/local.mk
+++ b/sim/mips/local.mk
@@ -86,7 +86,6 @@ noinst_LIBRARIES += %D%/libsim.a
 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)"
 
 ## List all generated headers to help Automake dependency tracking.
 BUILT_SOURCES += %D%/itable.h
diff --git a/sim/mn10300/local.mk b/sim/mn10300/local.mk
index 61c7f9188eaf..0c5d1bf59be4 100644
--- a/sim/mn10300/local.mk
+++ b/sim/mn10300/local.mk
@@ -53,7 +53,6 @@ noinst_LIBRARIES += %D%/libsim.a
 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)"
 
 ## List all generated headers to help Automake dependency tracking.
 BUILT_SOURCES += \
-- 
2.39.0


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

* [PATCH 76/83] sim: common: simplify hw-config.h deps
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (74 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 75/83] sim: build: drop AM_MAKEFLAGS settings Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:55 ` [PATCH 77/83] sim: igen: simplify build dep Mike Frysinger
                   ` (6 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

Now that all ports (other than ppc) build in the top-level, we don't
need to expand all the hw-config.h targets as a recursive dep.  Each
port depends on their respective header now, and the ppc port doesn't
use it at all.
---
 sim/Makefile.in     | 19 +++++++++----------
 sim/common/local.mk |  5 ++---
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/sim/common/local.mk b/sim/common/local.mk
index 2c68f668d37c..c297668b0be9 100644
--- a/sim/common/local.mk
+++ b/sim/common/local.mk
@@ -131,9 +131,8 @@ endif
 	touch $@
 .PRECIOUS: %/stamp-hw
 
-%C%_HW_CONFIG_H_TARGETS = $(patsubst %,%/hw-config.h,$(SIM_ENABLED_ARCHES))
-MOSTLYCLEANFILES += $(%C%_HW_CONFIG_H_TARGETS) $(patsubst %,%/stamp-hw,$(SIM_ENABLED_ARCHES))
-SIM_ALL_RECURSIVE_DEPS += $(%C%_HW_CONFIG_H_TARGETS)
+%C%_HW_CONFIG_H_TARGETS = $(SIM_ENABLED_ARCHES:%=%/hw-config.h)
+MOSTLYCLEANFILES += $(%C%_HW_CONFIG_H_TARGETS) $(SIM_ENABLED_ARCHES:%=%/stamp-hw)
 
 ## See sim_pre_argv_init and sim_module_install in sim-module.c for more details.
 ## TODO: Switch this to xxx_SOURCES once projects build objects in local.mk.
-- 
2.39.0


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

* [PATCH 77/83] sim: igen: simplify build dep
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (75 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 76/83] sim: common: simplify hw-config.h deps Mike Frysinger
@ 2023-01-03  7:55 ` Mike Frysinger
  2023-01-03  7:56 ` [PATCH 78/83] sim: common: move libcommon.a objects to sources Mike Frysinger
                   ` (5 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:55 UTC (permalink / raw)
  To: gdb-patches

Now that all ports (other than ppc) build in the top-level, we don't
need to mark the igen tool as a recursive dep.  Each port depends on
the tool if it actually uses it, and ppc doesn't use it at all.
---
 sim/Makefile.in   | 303 +++++++++++++++++++++++-----------------------
 sim/igen/local.mk |   4 -
 2 files changed, 151 insertions(+), 156 deletions(-)

diff --git a/sim/igen/local.mk b/sim/igen/local.mk
index db902a61402d..0126a2cdb7eb 100644
--- a/sim/igen/local.mk
+++ b/sim/igen/local.mk
@@ -24,10 +24,6 @@
 IGEN = %D%/igen$(EXEEXT)
 IGEN_RUN = ASAN_OPTIONS=detect_leaks=0 $(IGEN) $(IGEN_FLAGS_SMP)
 
-## This makes sure igen is available before building the arch-subdirs which
-## need to run the igen tool.
-SIM_ALL_RECURSIVE_DEPS += $(IGEN)
-
 # Alias for developers.
 igen: $(IGEN)
 
-- 
2.39.0


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

* [PATCH 78/83] sim: common: move libcommon.a objects to sources
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (76 preceding siblings ...)
  2023-01-03  7:55 ` [PATCH 77/83] sim: igen: simplify build dep Mike Frysinger
@ 2023-01-03  7:56 ` Mike Frysinger
  2023-01-03  7:56 ` [PATCH 79/83] sim: build: drop most recursive build deps Mike Frysinger
                   ` (4 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:56 UTC (permalink / raw)
  To: gdb-patches

This simplifies the build logic and avoids an Automake bug where the
common_libcommon_a_OBJECTS variable isn't set in the arch libsim.a
DEPENDENCIES for targets that, alphabetically, come before "common".
We aren't affected by that bug with the current code, but as we move
things out of SIM_ALL_RECURSIVE_DEPS and rely on finer dependencies,
we will trip over it.
---
 sim/Makefile.in              | 401 ++++++++++++++++++-----------------
 sim/aarch64/local.mk         |   4 +-
 sim/arm/local.mk             |   4 +-
 sim/avr/local.mk             |   4 +-
 sim/bfin/local.mk            |   4 +-
 sim/bpf/local.mk             |   4 +-
 sim/common/local.mk          |   1 +
 sim/cr16/local.mk            |   4 +-
 sim/cris/local.mk            |   4 +-
 sim/d10v/local.mk            |   4 +-
 sim/erc32/local.mk           |   4 +-
 sim/example-synacor/local.mk |   4 +-
 sim/frv/local.mk             |   4 +-
 sim/ft32/local.mk            |   4 +-
 sim/h8300/local.mk           |   4 +-
 sim/iq2000/local.mk          |   4 +-
 sim/lm32/local.mk            |   4 +-
 sim/m32c/local.mk            |   4 +-
 sim/m32r/local.mk            |   4 +-
 sim/m68hc11/local.mk         |   4 +-
 sim/mcore/local.mk           |   4 +-
 sim/microblaze/local.mk      |   4 +-
 sim/mips/local.mk            |   4 +-
 sim/mn10300/local.mk         |   4 +-
 sim/moxie/local.mk           |   4 +-
 sim/msp430/local.mk          |   4 +-
 sim/or1k/local.mk            |   4 +-
 sim/pru/local.mk             |   4 +-
 sim/riscv/local.mk           |   4 +-
 sim/rl78/local.mk            |   4 +-
 sim/rx/local.mk              |   4 +-
 sim/sh/local.mk              |   4 +-
 sim/v850/local.mk            |   4 +-
 33 files changed, 275 insertions(+), 251 deletions(-)

diff --git a/sim/aarch64/local.mk b/sim/aarch64/local.mk
index 10e814b49f90..ff7c51e43157 100644
--- a/sim/aarch64/local.mk
+++ b/sim/aarch64/local.mk
@@ -16,9 +16,9 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/cpustate.o \
diff --git a/sim/arm/local.mk b/sim/arm/local.mk
index c172b5f26824..2e20f8533897 100644
--- a/sim/arm/local.mk
+++ b/sim/arm/local.mk
@@ -18,9 +18,9 @@
 
 AM_CPPFLAGS_%C% = -DMODET
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/wrapper.o \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
diff --git a/sim/avr/local.mk b/sim/avr/local.mk
index 3cae5bf8483b..0647dedd1bd5 100644
--- a/sim/avr/local.mk
+++ b/sim/avr/local.mk
@@ -15,9 +15,9 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/interp.o \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
diff --git a/sim/bfin/local.mk b/sim/bfin/local.mk
index 17a5047fa240..9291e0641a38 100644
--- a/sim/bfin/local.mk
+++ b/sim/bfin/local.mk
@@ -18,9 +18,9 @@
 
 AM_CPPFLAGS_%C% = $(SDL_CFLAGS)
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
diff --git a/sim/bpf/local.mk b/sim/bpf/local.mk
index 5f559c93a02e..4218999c7e72 100644
--- a/sim/bpf/local.mk
+++ b/sim/bpf/local.mk
@@ -23,9 +23,9 @@ AM_CPPFLAGS_%C%_decode_be.o = -DWANT_ISA_EBPFBE
 AM_CPPFLAGS_%C%_sem_le.o = -DWANT_ISA_EBPFLE
 AM_CPPFLAGS_%C%_sem_be.o = -DWANT_ISA_EBPFBE
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/modules.o \
diff --git a/sim/common/local.mk b/sim/common/local.mk
index c297668b0be9..18b85cfd9418 100644
--- a/sim/common/local.mk
+++ b/sim/common/local.mk
@@ -30,6 +30,7 @@ SIM_ALL_RECURSIVE_DEPS += \
 
 ## NB: libcommon.a isn't used directly by ports.  We need a target for common
 ## objects to be a part of, and ports use the individual objects directly.
+## We can delete this once ppc/Makefile.in is merged into ppc/local.mk.
 noinst_LIBRARIES += %D%/libcommon.a
 %C%_libcommon_a_SOURCES = \
 	%D%/callback.c \
diff --git a/sim/cr16/local.mk b/sim/cr16/local.mk
index 8d8d27f82e67..19446381c9f5 100644
--- a/sim/cr16/local.mk
+++ b/sim/cr16/local.mk
@@ -16,9 +16,9 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/interp.o \
diff --git a/sim/cris/local.mk b/sim/cris/local.mk
index ef78c63062c2..14c8644fe070 100644
--- a/sim/cris/local.mk
+++ b/sim/cris/local.mk
@@ -16,9 +16,9 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
diff --git a/sim/d10v/local.mk b/sim/d10v/local.mk
index 04dd763f57c0..967d4e7e543c 100644
--- a/sim/d10v/local.mk
+++ b/sim/d10v/local.mk
@@ -16,9 +16,9 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/interp.o \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
diff --git a/sim/erc32/local.mk b/sim/erc32/local.mk
index 2361cf2eafc8..a371fbc542b1 100644
--- a/sim/erc32/local.mk
+++ b/sim/erc32/local.mk
@@ -25,9 +25,9 @@ AM_CPPFLAGS_%C% = $(READLINE_CFLAGS)
 ## behaviour of UART interrupt routines ...
 AM_CPPFLAGS_%C% += -DFAST_UART
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/erc32.o \
 	%D%/exec.o \
 	%D%/float.o \
diff --git a/sim/example-synacor/local.mk b/sim/example-synacor/local.mk
index 37999807ba32..f9d43a89feb6 100644
--- a/sim/example-synacor/local.mk
+++ b/sim/example-synacor/local.mk
@@ -16,9 +16,9 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/interp.o \
diff --git a/sim/frv/local.mk b/sim/frv/local.mk
index 8c2a61588429..c1a10045a708 100644
--- a/sim/frv/local.mk
+++ b/sim/frv/local.mk
@@ -22,9 +22,9 @@ AM_CPPFLAGS_%C% = $(SIM_FRV_TRAPDUMP_FLAGS)
 AM_CFLAGS_%C%_memory.o = -Wno-error
 AM_CFLAGS_%C%_sem.o = -Wno-error
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/modules.o \
diff --git a/sim/ft32/local.mk b/sim/ft32/local.mk
index 36081effabec..c793f87f4aaf 100644
--- a/sim/ft32/local.mk
+++ b/sim/ft32/local.mk
@@ -16,9 +16,9 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/interp.o \
diff --git a/sim/h8300/local.mk b/sim/h8300/local.mk
index dca8084763d0..04affc9051bb 100644
--- a/sim/h8300/local.mk
+++ b/sim/h8300/local.mk
@@ -16,9 +16,9 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/compile.o \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
diff --git a/sim/iq2000/local.mk b/sim/iq2000/local.mk
index 34589dbad885..fa498e485950 100644
--- a/sim/iq2000/local.mk
+++ b/sim/iq2000/local.mk
@@ -16,9 +16,9 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/modules.o \
diff --git a/sim/lm32/local.mk b/sim/lm32/local.mk
index 1c286245cca1..4fecaca6a389 100644
--- a/sim/lm32/local.mk
+++ b/sim/lm32/local.mk
@@ -16,9 +16,9 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
diff --git a/sim/m32c/local.mk b/sim/m32c/local.mk
index ad047f17b783..7093e248c7e2 100644
--- a/sim/m32c/local.mk
+++ b/sim/m32c/local.mk
@@ -18,9 +18,9 @@
 
 AM_CPPFLAGS_%C% = -DTIMER_A
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/gdb-if.o \
 	%D%/int.o \
 	%D%/load.o \
diff --git a/sim/m32r/local.mk b/sim/m32r/local.mk
index 78c8a87a42eb..6a6a6d999128 100644
--- a/sim/m32r/local.mk
+++ b/sim/m32r/local.mk
@@ -30,9 +30,9 @@ AM_CFLAGS_%C%_sem.o = -Wno-error
 AM_CFLAGS_%C%_sim_if.o = -Wno-error
 AM_CFLAGS_%C%_traps.o = -Wno-error
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
diff --git a/sim/m68hc11/local.mk b/sim/m68hc11/local.mk
index 8f881d5b854d..d5faae40ed53 100644
--- a/sim/m68hc11/local.mk
+++ b/sim/m68hc11/local.mk
@@ -27,9 +27,9 @@ AM_CPPFLAGS_%C% = \
 	-DWITH_TARGET_ADDRESS_BITSIZE=32 \
 	-DWITH_TARGET_WORD_MSB=31
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/interp.o \
 	%D%/m68hc11int.o \
 	%D%/m68hc12int.o \
diff --git a/sim/mcore/local.mk b/sim/mcore/local.mk
index dff8a684ef44..4c9cb50af911 100644
--- a/sim/mcore/local.mk
+++ b/sim/mcore/local.mk
@@ -16,9 +16,9 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/interp.o \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
diff --git a/sim/microblaze/local.mk b/sim/microblaze/local.mk
index dff8a684ef44..4c9cb50af911 100644
--- a/sim/microblaze/local.mk
+++ b/sim/microblaze/local.mk
@@ -16,9 +16,9 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/interp.o \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
diff --git a/sim/mips/local.mk b/sim/mips/local.mk
index e54a0ef6102e..942997240c8e 100644
--- a/sim/mips/local.mk
+++ b/sim/mips/local.mk
@@ -53,9 +53,9 @@ if SIM_MIPS_GEN_MODE_MULTI
 	%D%/itable.o \
 	%D%/multi-run.o
 endif
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/interp.o \
 	$(%C%_GEN_OBJ) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
diff --git a/sim/mn10300/local.mk b/sim/mn10300/local.mk
index 0c5d1bf59be4..2abd093e8343 100644
--- a/sim/mn10300/local.mk
+++ b/sim/mn10300/local.mk
@@ -20,9 +20,9 @@ AM_CPPFLAGS_%C% = \
 	-DPOLL_QUIT_INTERVAL=0x20 \
 	-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/itable.o \
 	%D%/semantics.o \
 	%D%/idecode.o \
diff --git a/sim/moxie/local.mk b/sim/moxie/local.mk
index 4b7d2984f16e..0e07c8607879 100644
--- a/sim/moxie/local.mk
+++ b/sim/moxie/local.mk
@@ -18,9 +18,9 @@
 
 AM_CPPFLAGS_%C% = -DDTB="\"$(dtbdir)/moxie-gdb.dtb\""
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/interp.o \
diff --git a/sim/msp430/local.mk b/sim/msp430/local.mk
index bb7afd304705..27169c504075 100644
--- a/sim/msp430/local.mk
+++ b/sim/msp430/local.mk
@@ -16,9 +16,9 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/msp430-sim.o \
diff --git a/sim/or1k/local.mk b/sim/or1k/local.mk
index 2a3b129c9fb9..71a34db21d8d 100644
--- a/sim/or1k/local.mk
+++ b/sim/or1k/local.mk
@@ -17,9 +17,9 @@
 
 AM_CPPFLAGS_%C% = -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/modules.o \
diff --git a/sim/pru/local.mk b/sim/pru/local.mk
index 0048199f6d3e..8ffc509c0144 100644
--- a/sim/pru/local.mk
+++ b/sim/pru/local.mk
@@ -16,9 +16,9 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/interp.o \
diff --git a/sim/riscv/local.mk b/sim/riscv/local.mk
index a3f232eea5ec..150639315fae 100644
--- a/sim/riscv/local.mk
+++ b/sim/riscv/local.mk
@@ -18,9 +18,9 @@
 
 AM_CPPFLAGS_%C% = -DWITH_TARGET_WORD_BITSIZE=$(SIM_RISCV_BITSIZE)
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/interp.o \
diff --git a/sim/rl78/local.mk b/sim/rl78/local.mk
index 56161eae25a2..0d39140ac6b8 100644
--- a/sim/rl78/local.mk
+++ b/sim/rl78/local.mk
@@ -16,9 +16,9 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/load.o \
 	%D%/mem.o \
 	%D%/cpu.o \
diff --git a/sim/rx/local.mk b/sim/rx/local.mk
index 3b1e199e68b8..2a9387d27b79 100644
--- a/sim/rx/local.mk
+++ b/sim/rx/local.mk
@@ -18,9 +18,9 @@
 
 AM_CPPFLAGS_%C% = $(SIM_RX_CYCLE_ACCURATE_FLAGS)
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/fpu.o \
 	%D%/load.o \
 	%D%/mem.o \
diff --git a/sim/sh/local.mk b/sim/sh/local.mk
index 558a747d2661..b197fa4c7c37 100644
--- a/sim/sh/local.mk
+++ b/sim/sh/local.mk
@@ -16,9 +16,9 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	%D%/interp.o \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
diff --git a/sim/v850/local.mk b/sim/v850/local.mk
index 62d3e82ff76a..68f61f89505c 100644
--- a/sim/v850/local.mk
+++ b/sim/v850/local.mk
@@ -18,9 +18,9 @@
 
 AM_CPPFLAGS_%C% = -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
 
-%C%_libsim_a_SOURCES =
+%C%_libsim_a_SOURCES = \
+	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
-	$(common_libcommon_a_OBJECTS) \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/simops.o \
-- 
2.39.0


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

* [PATCH 79/83] sim: build: drop most recursive build deps
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (77 preceding siblings ...)
  2023-01-03  7:56 ` [PATCH 78/83] sim: common: move libcommon.a objects to sources Mike Frysinger
@ 2023-01-03  7:56 ` Mike Frysinger
  2023-01-03  7:56 ` [PATCH 80/83] sim: common: move libcommon.a dep to ppc code Mike Frysinger
                   ` (3 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:56 UTC (permalink / raw)
  To: gdb-patches

Now that we build these objects in the top dir & generate modules.c
there, we don't need to generate them all first -- we can let the
normal dependency graph take care of building things in parallel.
---
 sim/Makefile.in      | 281 +++++++++++++++++++++----------------------
 sim/bpf/local.mk     |   3 +-
 sim/cr16/local.mk    |   3 +-
 sim/cris/local.mk    |   3 +-
 sim/d10v/local.mk    |   3 +-
 sim/frv/local.mk     |   3 +-
 sim/iq2000/local.mk  |   3 +-
 sim/lm32/local.mk    |   3 +-
 sim/m32c/local.mk    |   3 +-
 sim/m32r/local.mk    |   3 +-
 sim/m68hc11/local.mk |   3 +-
 sim/mips/local.mk    |   3 +-
 sim/mn10300/local.mk |   3 +-
 sim/or1k/local.mk    |   3 +-
 sim/sh/local.mk      |   3 +-
 sim/v850/local.mk    |   3 +-
 16 files changed, 153 insertions(+), 173 deletions(-)

diff --git a/sim/bpf/local.mk b/sim/bpf/local.mk
index 4218999c7e72..80bf775104ff 100644
--- a/sim/bpf/local.mk
+++ b/sim/bpf/local.mk
@@ -73,8 +73,7 @@ BUILT_SOURCES += \
 	%D%/mloop-be.c \
 	%D%/stamp-mloop-be
 
-## This makes sure build tools are available before building the arch-subdirs.
-SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+## Generating modules.c requires all sources to scan.
 %D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 %D%/mloop-le.c %D%/eng-le.h: %D%/stamp-mloop-le ; @true
diff --git a/sim/cr16/local.mk b/sim/cr16/local.mk
index 19446381c9f5..cb5ae553594b 100644
--- a/sim/cr16/local.mk
+++ b/sim/cr16/local.mk
@@ -47,8 +47,7 @@ BUILT_SOURCES += %D%/simops.h
 	%D%/gencode$(EXEEXT) \
 	%D%/table.c
 
-## This makes sure build tools are available before building the arch-subdirs.
-SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+## Generating modules.c requires all sources to scan.
 %D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 %C%_gencode_SOURCES = %D%/gencode.c
diff --git a/sim/cris/local.mk b/sim/cris/local.mk
index 14c8644fe070..3976f6836ef3 100644
--- a/sim/cris/local.mk
+++ b/sim/cris/local.mk
@@ -77,8 +77,7 @@ BUILT_SOURCES += \
 	%D%/mloopv32f.c \
 	%D%/stamp-mloop-v32f
 
-## This makes sure build tools are available before building the arch-subdirs.
-SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+## Generating modules.c requires all sources to scan.
 %D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 ## FIXME: What is mono and what does "Use of `mono' is wip" mean (other
diff --git a/sim/d10v/local.mk b/sim/d10v/local.mk
index 967d4e7e543c..63ddb6ea0c58 100644
--- a/sim/d10v/local.mk
+++ b/sim/d10v/local.mk
@@ -48,8 +48,7 @@ BUILT_SOURCES += %D%/simops.h
 	%D%/gencode$(EXEEXT) \
 	%D%/table.c
 
-## This makes sure build tools are available before building the arch-subdirs.
-SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+## Generating modules.c requires all sources to scan.
 %D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 %C%_gencode_SOURCES = %D%/gencode.c
diff --git a/sim/frv/local.mk b/sim/frv/local.mk
index c1a10045a708..7d572fccb6ab 100644
--- a/sim/frv/local.mk
+++ b/sim/frv/local.mk
@@ -83,8 +83,7 @@ BUILT_SOURCES += %D%/eng.h
 	%D%/mloop.c \
 	%D%/stamp-mloop
 
-## This makes sure build tools are available before building the arch-subdirs.
-SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+## Generating modules.c requires all sources to scan.
 %D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 ## FIXME: Use of `mono' is wip.
diff --git a/sim/iq2000/local.mk b/sim/iq2000/local.mk
index fa498e485950..77804fe69abe 100644
--- a/sim/iq2000/local.mk
+++ b/sim/iq2000/local.mk
@@ -58,8 +58,7 @@ BUILT_SOURCES += %D%/eng.h
 	%D%/mloop.c \
 	%D%/stamp-mloop
 
-## This makes sure build tools are available before building the arch-subdirs.
-SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+## Generating modules.c requires all sources to scan.
 %D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 ## FIXME: Use of `mono' is wip.
diff --git a/sim/lm32/local.mk b/sim/lm32/local.mk
index 4fecaca6a389..40f8d524c952 100644
--- a/sim/lm32/local.mk
+++ b/sim/lm32/local.mk
@@ -63,8 +63,7 @@ BUILT_SOURCES += %D%/eng.h
 	%D%/mloop.c \
 	%D%/stamp-mloop
 
-## This makes sure build tools are available before building the arch-subdirs.
-SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+## Generating modules.c requires all sources to scan.
 %D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 ## FIXME: Use of `mono' is wip.
diff --git a/sim/m32c/local.mk b/sim/m32c/local.mk
index 7093e248c7e2..a6d22424929c 100644
--- a/sim/m32c/local.mk
+++ b/sim/m32c/local.mk
@@ -53,8 +53,7 @@ noinst_PROGRAMS += %D%/run
 	%D%/m32c.c \
 	%D%/r8c.c
 
-## This makes sure build tools are available before building the arch-subdirs.
-SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+## Generating modules.c requires all sources to scan.
 %D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 %C%_opc2c_SOURCES = %D%/opc2c.c
diff --git a/sim/m32r/local.mk b/sim/m32r/local.mk
index 6a6a6d999128..24ef10ef2bcc 100644
--- a/sim/m32r/local.mk
+++ b/sim/m32r/local.mk
@@ -96,8 +96,7 @@ BUILT_SOURCES += \
 	%D%/mloop2.c \
 	%D%/stamp-mloop-2
 
-## This makes sure build tools are available before building the arch-subdirs.
-SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+## Generating modules.c requires all sources to scan.
 %D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 ## FIXME: Use of `mono' is wip.
diff --git a/sim/m68hc11/local.mk b/sim/m68hc11/local.mk
index d5faae40ed53..e094918a3210 100644
--- a/sim/m68hc11/local.mk
+++ b/sim/m68hc11/local.mk
@@ -63,8 +63,7 @@ noinst_PROGRAMS += %D%/run
 	%D%/m68hc11int.c \
 	%D%/m68hc12int.c
 
-## This makes sure build tools are available before building the arch-subdirs.
-SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+## Generating modules.c requires all sources to scan.
 %D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 %C%_gencode_SOURCES = %D%/gencode.c
diff --git a/sim/mips/local.mk b/sim/mips/local.mk
index 942997240c8e..5f32eee573f0 100644
--- a/sim/mips/local.mk
+++ b/sim/mips/local.mk
@@ -154,8 +154,7 @@ if SIM_MIPS_GEN_MODE_MULTI
 	%D%/stamp-gen-mode-multi-run
 endif
 
-## This makes sure build tools are available before building the arch-subdirs.
-SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+## Generating modules.c requires all sources to scan.
 %D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 $(%C%_BUILT_SRC_FROM_IGEN_ITABLE): %D%/stamp-igen-itable
diff --git a/sim/mn10300/local.mk b/sim/mn10300/local.mk
index 2abd093e8343..1eae112642d4 100644
--- a/sim/mn10300/local.mk
+++ b/sim/mn10300/local.mk
@@ -83,8 +83,7 @@ BUILT_SOURCES += \
 	$(%C%_BUILT_SRC_FROM_IGEN) \
 	%D%/stamp-igen
 
-## This makes sure build tools are available before building the arch-subdirs.
-SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+## Generating modules.c requires all sources to scan.
 %D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 $(%C%_BUILT_SRC_FROM_IGEN): %D%/stamp-igen
diff --git a/sim/or1k/local.mk b/sim/or1k/local.mk
index 71a34db21d8d..a5989d51ddaf 100644
--- a/sim/or1k/local.mk
+++ b/sim/or1k/local.mk
@@ -65,8 +65,7 @@ BUILT_SOURCES += %D%/eng.h
 	%D%/mloop.c \
 	%D%/stamp-mloop
 
-## This makes sure build tools are available before building the arch-subdirs.
-SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+## Generating modules.c requires all sources to scan.
 %D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 ## FIXME: Use of `mono' is wip.
diff --git a/sim/sh/local.mk b/sim/sh/local.mk
index b197fa4c7c37..4f6a4c5e6617 100644
--- a/sim/sh/local.mk
+++ b/sim/sh/local.mk
@@ -49,8 +49,7 @@ BUILT_SOURCES += \
 	%D%/gencode$(EXEEXT) \
 	%D%/table.c
 
-## This makes sure build tools are available before building the arch-subdirs.
-SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+## Generating modules.c requires all sources to scan.
 %D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 %C%_gencode_SOURCES = %D%/gencode.c
diff --git a/sim/v850/local.mk b/sim/v850/local.mk
index 68f61f89505c..973e83c42789 100644
--- a/sim/v850/local.mk
+++ b/sim/v850/local.mk
@@ -78,8 +78,7 @@ BUILT_SOURCES += \
 	$(%C%_BUILT_SRC_FROM_IGEN) \
 	%D%/stamp-igen
 
-## This makes sure build tools are available before building the arch-subdirs.
-SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+## Generating modules.c requires all sources to scan.
 %D%/modules.c: | $(%C%_BUILD_OUTPUTS)
 
 $(%C%_BUILT_SRC_FROM_IGEN): %D%/stamp-igen
-- 
2.39.0


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

* [PATCH 80/83] sim: common: move libcommon.a dep to ppc code
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (78 preceding siblings ...)
  2023-01-03  7:56 ` [PATCH 79/83] sim: build: drop most recursive build deps Mike Frysinger
@ 2023-01-03  7:56 ` Mike Frysinger
  2023-01-03  7:56 ` [PATCH 81/83] sim: common: move modules.c to source tracking Mike Frysinger
                   ` (2 subsequent siblings)
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:56 UTC (permalink / raw)
  To: gdb-patches

Rather than force this to be built ahead of time for all targets,
move the dep to the ppc code since it's the only user of it now.
---
 sim/Makefile.in     | 53 ++++++++++++++++++++++++---------------------
 sim/common/local.mk |  5 -----
 sim/ppc/local.mk    |  6 +++++
 3 files changed, 34 insertions(+), 30 deletions(-)

diff --git a/sim/common/local.mk b/sim/common/local.mk
index 18b85cfd9418..5905266dd80b 100644
--- a/sim/common/local.mk
+++ b/sim/common/local.mk
@@ -23,11 +23,6 @@ AM_CPPFLAGS += \
 AM_CPPFLAGS_%C% = -DSIM_COMMON_BUILD
 AM_CPPFLAGS_FOR_BUILD += -I$(srcdir)/%D%
 
-## This makes sure common parts are available before building the arch-subdirs
-## which will refer to these.
-SIM_ALL_RECURSIVE_DEPS += \
-	%D%/libcommon.a
-
 ## NB: libcommon.a isn't used directly by ports.  We need a target for common
 ## objects to be a part of, and ports use the individual objects directly.
 ## We can delete this once ppc/Makefile.in is merged into ppc/local.mk.
diff --git a/sim/ppc/local.mk b/sim/ppc/local.mk
index d8a4cacb152b..fca3b4f6b2ec 100644
--- a/sim/ppc/local.mk
+++ b/sim/ppc/local.mk
@@ -24,6 +24,12 @@
 %D%/psim$(EXEEXT): %D%/run$(EXEEXT)
 	$(AM_V_GEN)ln $< $@ 2>/dev/null || $(LN_S) $< $@ 2>/dev/null || cp -p $< $@
 
+## This makes sure common parts are available before building the arch-subdirs
+## which will refer to these.
+SIM_ALL_RECURSIVE_DEPS += common/libcommon.a
+%D%/libsim.a: common/libcommon.a
+	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
 ## Helper targets for running make from the top-level due to run's sis.o.
 %D%/%.o: %D%/%.c | %D%/libsim.a $(SIM_ALL_RECURSIVE_DEPS)
 	$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-- 
2.39.0


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

* [PATCH 81/83] sim: common: move modules.c to source tracking
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (79 preceding siblings ...)
  2023-01-03  7:56 ` [PATCH 80/83] sim: common: move libcommon.a dep to ppc code Mike Frysinger
@ 2023-01-03  7:56 ` Mike Frysinger
  2023-01-03  7:56 ` [PATCH 82/83] sim: common: simplify modules.c deps Mike Frysinger
  2023-01-03  7:56 ` [PATCH 83/83] sim: build: drop depdir subdir hack Mike Frysinger
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:56 UTC (permalink / raw)
  To: gdb-patches

This makes sure the arch-specific modules.c wildcard is matched and
not the common/%.c so that we compile it correctly.  It also makes
sure each subdir has depdir logic enabled.
---
 sim/Makefile.in              | 680 ++++++++++++++++++++++++++---------
 sim/aarch64/local.mk         |   3 +-
 sim/arm/local.mk             |   5 +-
 sim/avr/local.mk             |   3 +-
 sim/bfin/local.mk            |   3 +-
 sim/bpf/local.mk             |   3 +-
 sim/cr16/local.mk            |   3 +-
 sim/cris/local.mk            |   3 +-
 sim/d10v/local.mk            |   3 +-
 sim/erc32/local.mk           |   5 +-
 sim/example-synacor/local.mk |   3 +-
 sim/frv/local.mk             |   3 +-
 sim/ft32/local.mk            |   3 +-
 sim/h8300/local.mk           |   3 +-
 sim/iq2000/local.mk          |   3 +-
 sim/lm32/local.mk            |   3 +-
 sim/m32c/local.mk            |   3 +-
 sim/m32r/local.mk            |   3 +-
 sim/m68hc11/local.mk         |   3 +-
 sim/mcore/local.mk           |   3 +-
 sim/microblaze/local.mk      |   3 +-
 sim/mips/local.mk            |   3 +-
 sim/mn10300/local.mk         |   3 +-
 sim/moxie/local.mk           |   3 +-
 sim/msp430/local.mk          |   3 +-
 sim/or1k/local.mk            |   3 +-
 sim/pru/local.mk             |   3 +-
 sim/riscv/local.mk           |   3 +-
 sim/rl78/local.mk            |   3 +-
 sim/rx/local.mk              |   5 +-
 sim/sh/local.mk              |   3 +-
 sim/v850/local.mk            |   3 +-
 32 files changed, 584 insertions(+), 195 deletions(-)

diff --git a/sim/aarch64/local.mk b/sim/aarch64/local.mk
index ff7c51e43157..113055b126dd 100644
--- a/sim/aarch64/local.mk
+++ b/sim/aarch64/local.mk
@@ -16,6 +16,8 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
@@ -24,7 +26,6 @@
 	%D%/cpustate.o \
 	%D%/interp.o \
 	%D%/memory.o \
-	%D%/modules.o \
 	%D%/sim-resume.o \
 	%D%/simulator.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
diff --git a/sim/arm/local.mk b/sim/arm/local.mk
index 2e20f8533897..0c2b1a386dc9 100644
--- a/sim/arm/local.mk
+++ b/sim/arm/local.mk
@@ -18,6 +18,8 @@
 
 AM_CPPFLAGS_%C% = -DMODET
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
@@ -27,8 +29,7 @@ AM_CPPFLAGS_%C% = -DMODET
 	%D%/armemu.o \
 	%D%/armemu32.o %D%/arminit.o %D%/armos.o %D%/armsupp.o \
 	%D%/armvirt.o %D%/thumbemu.o \
-	%D%/armcopro.o %D%/maverick.o %D%/iwmmxt.o \
-	%D%/modules.o
+	%D%/armcopro.o %D%/maverick.o %D%/iwmmxt.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
diff --git a/sim/avr/local.mk b/sim/avr/local.mk
index 0647dedd1bd5..07752e546a12 100644
--- a/sim/avr/local.mk
+++ b/sim/avr/local.mk
@@ -15,13 +15,14 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
 	%D%/interp.o \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
-	%D%/modules.o \
 	%D%/sim-resume.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
diff --git a/sim/bfin/local.mk b/sim/bfin/local.mk
index 9291e0641a38..e6f6662020af 100644
--- a/sim/bfin/local.mk
+++ b/sim/bfin/local.mk
@@ -18,6 +18,8 @@
 
 AM_CPPFLAGS_%C% = $(SDL_CFLAGS)
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
@@ -29,7 +31,6 @@ AM_CPPFLAGS_%C% = $(SDL_CFLAGS)
 	%D%/gui.o \
 	%D%/interp.o \
 	%D%/machs.o \
-	%D%/modules.o \
 	%D%/sim-resume.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
diff --git a/sim/bpf/local.mk b/sim/bpf/local.mk
index 80bf775104ff..04f06e3aed37 100644
--- a/sim/bpf/local.mk
+++ b/sim/bpf/local.mk
@@ -23,12 +23,13 @@ AM_CPPFLAGS_%C%_decode_be.o = -DWANT_ISA_EBPFBE
 AM_CPPFLAGS_%C%_sem_le.o = -DWANT_ISA_EBPFLE
 AM_CPPFLAGS_%C%_sem_be.o = -DWANT_ISA_EBPFBE
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
-	%D%/modules.o \
 	\
 	%D%/cgen-run.o \
 	%D%/cgen-scache.o \
diff --git a/sim/cr16/local.mk b/sim/cr16/local.mk
index cb5ae553594b..6d1dd02b68c5 100644
--- a/sim/cr16/local.mk
+++ b/sim/cr16/local.mk
@@ -16,13 +16,14 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/interp.o \
-	%D%/modules.o \
 	%D%/sim-resume.o \
 	%D%/simops.o \
 	%D%/table.o
diff --git a/sim/cris/local.mk b/sim/cris/local.mk
index 3976f6836ef3..884024a8e5fc 100644
--- a/sim/cris/local.mk
+++ b/sim/cris/local.mk
@@ -16,13 +16,14 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
-	%D%/modules.o \
 	\
 	%D%/cgen-run.o \
 	%D%/cgen-scache.o \
diff --git a/sim/d10v/local.mk b/sim/d10v/local.mk
index 63ddb6ea0c58..25578dd537fb 100644
--- a/sim/d10v/local.mk
+++ b/sim/d10v/local.mk
@@ -16,6 +16,8 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
@@ -23,7 +25,6 @@
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/endian.o \
-	%D%/modules.o \
 	%D%/sim-resume.o \
 	%D%/simops.o \
 	%D%/table.o
diff --git a/sim/erc32/local.mk b/sim/erc32/local.mk
index a371fbc542b1..2a3f541b145c 100644
--- a/sim/erc32/local.mk
+++ b/sim/erc32/local.mk
@@ -25,6 +25,8 @@ AM_CPPFLAGS_%C% = $(READLINE_CFLAGS)
 ## behaviour of UART interrupt routines ...
 AM_CPPFLAGS_%C% += -DFAST_UART
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
@@ -33,8 +35,7 @@ AM_CPPFLAGS_%C% += -DFAST_UART
 	%D%/float.o \
 	%D%/func.o \
 	%D%/help.o \
-	%D%/interf.o \
-	%D%/modules.o
+	%D%/interf.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
diff --git a/sim/example-synacor/local.mk b/sim/example-synacor/local.mk
index f9d43a89feb6..a0de3372dac8 100644
--- a/sim/example-synacor/local.mk
+++ b/sim/example-synacor/local.mk
@@ -16,13 +16,14 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/interp.o \
-	%D%/modules.o \
 	%D%/sim-main.o \
 	%D%/sim-resume.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
diff --git a/sim/frv/local.mk b/sim/frv/local.mk
index 7d572fccb6ab..14db9b64272d 100644
--- a/sim/frv/local.mk
+++ b/sim/frv/local.mk
@@ -22,12 +22,13 @@ AM_CPPFLAGS_%C% = $(SIM_FRV_TRAPDUMP_FLAGS)
 AM_CFLAGS_%C%_memory.o = -Wno-error
 AM_CFLAGS_%C%_sem.o = -Wno-error
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
-	%D%/modules.o \
 	\
 	%D%/cgen-accfp.o \
 	%D%/cgen-fpu.o \
diff --git a/sim/ft32/local.mk b/sim/ft32/local.mk
index c793f87f4aaf..c582cebeec6f 100644
--- a/sim/ft32/local.mk
+++ b/sim/ft32/local.mk
@@ -16,13 +16,14 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/interp.o \
-	%D%/modules.o \
 	%D%/sim-resume.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
diff --git a/sim/h8300/local.mk b/sim/h8300/local.mk
index 04affc9051bb..f1a17efeda1b 100644
--- a/sim/h8300/local.mk
+++ b/sim/h8300/local.mk
@@ -16,13 +16,14 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
 	%D%/compile.o \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
-	%D%/modules.o \
 	%D%/sim-resume.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
diff --git a/sim/iq2000/local.mk b/sim/iq2000/local.mk
index 77804fe69abe..0d00c672e67f 100644
--- a/sim/iq2000/local.mk
+++ b/sim/iq2000/local.mk
@@ -16,12 +16,13 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
-	%D%/modules.o \
 	\
 	%D%/cgen-run.o \
 	%D%/cgen-scache.o \
diff --git a/sim/lm32/local.mk b/sim/lm32/local.mk
index 40f8d524c952..f4a4233e7be4 100644
--- a/sim/lm32/local.mk
+++ b/sim/lm32/local.mk
@@ -16,13 +16,14 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
-	%D%/modules.o \
 	\
 	%D%/cgen-run.o \
 	%D%/cgen-scache.o \
diff --git a/sim/m32c/local.mk b/sim/m32c/local.mk
index a6d22424929c..dc145302eb4b 100644
--- a/sim/m32c/local.mk
+++ b/sim/m32c/local.mk
@@ -18,6 +18,8 @@
 
 AM_CPPFLAGS_%C% = -DTIMER_A
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
@@ -27,7 +29,6 @@ AM_CPPFLAGS_%C% = -DTIMER_A
 	%D%/m32c.o \
 	%D%/mem.o \
 	%D%/misc.o \
-	%D%/modules.o \
 	%D%/r8c.o \
 	%D%/reg.o \
 	%D%/srcdest.o \
diff --git a/sim/m32r/local.mk b/sim/m32r/local.mk
index 24ef10ef2bcc..85190650e8e4 100644
--- a/sim/m32r/local.mk
+++ b/sim/m32r/local.mk
@@ -30,13 +30,14 @@ AM_CFLAGS_%C%_sem.o = -Wno-error
 AM_CFLAGS_%C%_sim_if.o = -Wno-error
 AM_CFLAGS_%C%_traps.o = -Wno-error
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
-	%D%/modules.o \
 	\
 	%D%/cgen-run.o \
 	%D%/cgen-scache.o \
diff --git a/sim/m68hc11/local.mk b/sim/m68hc11/local.mk
index e094918a3210..5f585dfd05ff 100644
--- a/sim/m68hc11/local.mk
+++ b/sim/m68hc11/local.mk
@@ -27,6 +27,8 @@ AM_CPPFLAGS_%C% = \
 	-DWITH_TARGET_ADDRESS_BITSIZE=32 \
 	-DWITH_TARGET_WORD_MSB=31
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
@@ -39,7 +41,6 @@ AM_CPPFLAGS_%C% = \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
-	%D%/modules.o \
 	%D%/sim-resume.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
diff --git a/sim/mcore/local.mk b/sim/mcore/local.mk
index 4c9cb50af911..bde13dbb6a44 100644
--- a/sim/mcore/local.mk
+++ b/sim/mcore/local.mk
@@ -16,13 +16,14 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
 	%D%/interp.o \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
-	%D%/modules.o \
 	%D%/sim-resume.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
diff --git a/sim/microblaze/local.mk b/sim/microblaze/local.mk
index 4c9cb50af911..bde13dbb6a44 100644
--- a/sim/microblaze/local.mk
+++ b/sim/microblaze/local.mk
@@ -16,13 +16,14 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
 	%D%/interp.o \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
-	%D%/modules.o \
 	%D%/sim-resume.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
diff --git a/sim/mips/local.mk b/sim/mips/local.mk
index 5f32eee573f0..88d4c900d5ff 100644
--- a/sim/mips/local.mk
+++ b/sim/mips/local.mk
@@ -53,6 +53,8 @@ if SIM_MIPS_GEN_MODE_MULTI
 	%D%/itable.o \
 	%D%/multi-run.o
 endif
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
@@ -64,7 +66,6 @@ endif
 	%D%/cp1.o \
 	%D%/dsp.o \
 	%D%/mdmx.o \
-	%D%/modules.o \
 	%D%/sim-main.o \
 	%D%/sim-resume.o
 ## Workaround Automake bug where $(SIM_MIPS_MULTI_OBJ) isn't copied from LIBADD
diff --git a/sim/mn10300/local.mk b/sim/mn10300/local.mk
index 1eae112642d4..f7c2d5537351 100644
--- a/sim/mn10300/local.mk
+++ b/sim/mn10300/local.mk
@@ -20,6 +20,8 @@ AM_CPPFLAGS_%C% = \
 	-DPOLL_QUIT_INTERVAL=0x20 \
 	-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
@@ -34,7 +36,6 @@ AM_CPPFLAGS_%C% = \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	$(patsubst %,%D%/dv-%.o,$(%C%_SIM_EXTRA_HW_DEVICES)) \
 	%D%/interp.o \
-	%D%/modules.o \
 	%D%/op_utils.o \
 	%D%/sim-resume.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
diff --git a/sim/moxie/local.mk b/sim/moxie/local.mk
index 0e07c8607879..4a8b9f740c85 100644
--- a/sim/moxie/local.mk
+++ b/sim/moxie/local.mk
@@ -18,13 +18,14 @@
 
 AM_CPPFLAGS_%C% = -DDTB="\"$(dtbdir)/moxie-gdb.dtb\""
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/interp.o \
-	%D%/modules.o \
 	%D%/sim-resume.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
diff --git a/sim/msp430/local.mk b/sim/msp430/local.mk
index 27169c504075..b6ae9c0848b5 100644
--- a/sim/msp430/local.mk
+++ b/sim/msp430/local.mk
@@ -16,13 +16,14 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/msp430-sim.o \
-	%D%/modules.o \
 	%D%/sim-resume.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
diff --git a/sim/or1k/local.mk b/sim/or1k/local.mk
index a5989d51ddaf..23625580dbb9 100644
--- a/sim/or1k/local.mk
+++ b/sim/or1k/local.mk
@@ -17,12 +17,13 @@
 
 AM_CPPFLAGS_%C% = -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
-	%D%/modules.o \
 	\
 	%D%/cgen-accfp.o \
 	%D%/cgen-fpu.o \
diff --git a/sim/pru/local.mk b/sim/pru/local.mk
index 8ffc509c0144..0aead8e0ce61 100644
--- a/sim/pru/local.mk
+++ b/sim/pru/local.mk
@@ -16,13 +16,14 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/interp.o \
-	%D%/modules.o \
 	%D%/sim-resume.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
diff --git a/sim/riscv/local.mk b/sim/riscv/local.mk
index 150639315fae..d1e84123b9b0 100644
--- a/sim/riscv/local.mk
+++ b/sim/riscv/local.mk
@@ -18,6 +18,8 @@
 
 AM_CPPFLAGS_%C% = -DWITH_TARGET_WORD_BITSIZE=$(SIM_RISCV_BITSIZE)
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
@@ -25,7 +27,6 @@ AM_CPPFLAGS_%C% = -DWITH_TARGET_WORD_BITSIZE=$(SIM_RISCV_BITSIZE)
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
 	%D%/interp.o \
 	%D%/machs.o \
-	%D%/modules.o \
 	%D%/sim-main.o \
 	%D%/sim-resume.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
diff --git a/sim/rl78/local.mk b/sim/rl78/local.mk
index 0d39140ac6b8..bab9e4561ca4 100644
--- a/sim/rl78/local.mk
+++ b/sim/rl78/local.mk
@@ -16,6 +16,8 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
@@ -24,7 +26,6 @@
 	%D%/cpu.o \
 	%D%/rl78.o \
 	%D%/gdb-if.o \
-	%D%/modules.o \
 	%D%/trace.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
diff --git a/sim/rx/local.mk b/sim/rx/local.mk
index 2a9387d27b79..63993b9d278c 100644
--- a/sim/rx/local.mk
+++ b/sim/rx/local.mk
@@ -18,6 +18,8 @@
 
 AM_CPPFLAGS_%C% = $(SIM_RX_CYCLE_ACCURATE_FLAGS)
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
@@ -30,8 +32,7 @@ AM_CPPFLAGS_%C% = $(SIM_RX_CYCLE_ACCURATE_FLAGS)
 	%D%/syscalls.o \
 	%D%/trace.o \
 	%D%/gdb-if.o \
-	%D%/err.o \
-	%D%/modules.o
+	%D%/err.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
 noinst_LIBRARIES += %D%/libsim.a
diff --git a/sim/sh/local.mk b/sim/sh/local.mk
index 4f6a4c5e6617..71fa8f2245e1 100644
--- a/sim/sh/local.mk
+++ b/sim/sh/local.mk
@@ -16,13 +16,14 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
 	%D%/interp.o \
 	$(patsubst %,%D%/%,$(SIM_NEW_COMMON_OBJS)) \
 	$(patsubst %,%D%/dv-%.o,$(SIM_HW_DEVICES)) \
-	%D%/modules.o \
 	%D%/table.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
diff --git a/sim/v850/local.mk b/sim/v850/local.mk
index 973e83c42789..df0045765c26 100644
--- a/sim/v850/local.mk
+++ b/sim/v850/local.mk
@@ -18,6 +18,8 @@
 
 AM_CPPFLAGS_%C% = -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
 
+nodist_%C%_libsim_a_SOURCES = \
+	%D%/modules.c
 %C%_libsim_a_SOURCES = \
 	$(common_libcommon_a_SOURCES)
 %C%_libsim_a_LIBADD = \
@@ -32,7 +34,6 @@ AM_CPPFLAGS_%C% = -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
 	%D%/engine.o \
 	%D%/irun.o \
 	%D%/support.o \
-	%D%/modules.o \
 	%D%/sim-resume.o
 $(%C%_libsim_a_OBJECTS) $(%C%_libsim_a_LIBADD): %D%/hw-config.h
 
-- 
2.39.0


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

* [PATCH 82/83] sim: common: simplify modules.c deps
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (80 preceding siblings ...)
  2023-01-03  7:56 ` [PATCH 81/83] sim: common: move modules.c to source tracking Mike Frysinger
@ 2023-01-03  7:56 ` Mike Frysinger
  2023-01-03  7:56 ` [PATCH 83/83] sim: build: drop depdir subdir hack Mike Frysinger
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:56 UTC (permalink / raw)
  To: gdb-patches

Now that all ports (other than ppc) build in the top-level, we don't
need to expand all the modules.c targets as a recursive dep.  Each
port depends on their respective file now, and the ppc port doesn't
use it at all.
---
 sim/Makefile.in     | 9 ++++-----
 sim/common/local.mk | 6 ++----
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/sim/common/local.mk b/sim/common/local.mk
index 5905266dd80b..4a609ba5f8c9 100644
--- a/sim/common/local.mk
+++ b/sim/common/local.mk
@@ -161,10 +161,8 @@ GEN_MODULES_C_SRCS = \
 .PRECIOUS: %/stamp-modules
 
 ## NB: The ppc port doesn't currently utilize the modules API, so skip it.
-%C%_GEN_MODULES_C_TARGETS = $(patsubst %,%/modules.c,$(filter-out ppc,$(SIM_ENABLED_ARCHES)))
-MOSTLYCLEANFILES += $(%C%_GEN_MODULES_C_TARGETS) $(patsubst %,%/stamp-modules,$(SIM_ENABLED_ARCHES))
-## TODO: Drop this once each port's local.mk:libsim.a depends on it themself.
-SIM_ALL_RECURSIVE_DEPS += $(%C%_GEN_MODULES_C_TARGETS)
+%C%_GEN_MODULES_C_TARGETS = $(SIM_ENABLED_ARCHES:%=%/modules.c)
+MOSTLYCLEANFILES += $(%C%_GEN_MODULES_C_TARGETS) $(SIM_ENABLED_ARCHES:%=%/stamp-modules)
 
 LIBIBERTY_LIB = ../libiberty/libiberty.a
 BFD_LIB = ../bfd/libbfd.la
-- 
2.39.0


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

* [PATCH 83/83] sim: build: drop depdir subdir hack
  2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
                   ` (81 preceding siblings ...)
  2023-01-03  7:56 ` [PATCH 82/83] sim: common: simplify modules.c deps Mike Frysinger
@ 2023-01-03  7:56 ` Mike Frysinger
  82 siblings, 0 replies; 84+ messages in thread
From: Mike Frysinger @ 2023-01-03  7:56 UTC (permalink / raw)
  To: gdb-patches

Now that all the ports compile some C files in their arch dirs, Automake
guarantees creating the depdir for us, so we can drop our configure hack.
---
 sim/configure    | 160 -----------------------------------------------
 sim/configure.ac |   4 --
 2 files changed, 164 deletions(-)

diff --git a/sim/configure.ac b/sim/configure.ac
index 91447ae4c655..132146433ad7 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -63,10 +63,6 @@ m4_define([SIM_BUILD_TARGET], [dnl
     AC_CONFIG_SUBDIRS($1)
   ])
   AC_CONFIG_FILES($1/.gdbinit:common/gdbinit.in)
-  dnl Create the depdirs for ports until we can convert them to automake.
-  AC_CONFIG_COMMANDS([depdir-$1],
-		     [$SHELL $ac_aux_dir/mkinstalldirs $1/$DEPDIR],
-		     [ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR])
 ])
 dnl Enable a particular arch subdir.
 dnl arg[1] is the matching target triple.
-- 
2.39.0


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

end of thread, other threads:[~2023-01-03  7:59 UTC | newest]

Thread overview: 84+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-03  7:54 [PATCH 00/83] sim: merge subdir makefiles into top-level Mike Frysinger
2023-01-03  7:54 ` [PATCH 01/83] sim: mips: add multi source to built sources Mike Frysinger
2023-01-03  7:54 ` [PATCH 02/83] sim: modules: trigger generation from top-level Mike Frysinger
2023-01-03  7:54 ` [PATCH 03/83] sim: build: drop support for subdir extra deps Mike Frysinger
2023-01-03  7:54 ` [PATCH 04/83] sim: aarch64: move libsim.a creation to top-level Mike Frysinger
2023-01-03  7:54 ` [PATCH 05/83] sim: arm: " Mike Frysinger
2023-01-03  7:54 ` [PATCH 06/83] sim: avr: " Mike Frysinger
2023-01-03  7:54 ` [PATCH 07/83] sim: bfin: " Mike Frysinger
2023-01-03  7:54 ` [PATCH 08/83] sim: bpf: " Mike Frysinger
2023-01-03  7:54 ` [PATCH 09/83] sim: cr16: " Mike Frysinger
2023-01-03  7:54 ` [PATCH 10/83] sim: cris: " Mike Frysinger
2023-01-03  7:54 ` [PATCH 11/83] sim: d10v: " Mike Frysinger
2023-01-03  7:54 ` [PATCH 12/83] sim: erc32: " Mike Frysinger
2023-01-03  7:54 ` [PATCH 13/83] sim: example-synacor: " Mike Frysinger
2023-01-03  7:54 ` [PATCH 14/83] sim: frv: " Mike Frysinger
2023-01-03  7:54 ` [PATCH 15/83] sim: ft32: " Mike Frysinger
2023-01-03  7:54 ` [PATCH 16/83] sim: h8300: " Mike Frysinger
2023-01-03  7:54 ` [PATCH 17/83] sim: iq2000: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 18/83] sim: lm32: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 19/83] sim: m32c: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 20/83] sim: m32r: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 21/83] sim: m68hc11: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 22/83] sim: mcore: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 23/83] sim: microblaze: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 24/83] sim: mips: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 25/83] sim: mn10300: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 26/83] sim: moxie: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 27/83] sim: msp430: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 28/83] sim: or1k: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 29/83] sim: pru: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 30/83] sim: riscv: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 31/83] sim: rl78: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 32/83] sim: rx: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 33/83] sim: sh: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 34/83] sim: v850: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 35/83] sim: build: drop support for creating libsim.a in subdirs Mike Frysinger
2023-01-03  7:55 ` [PATCH 36/83] sim: build: drop common/nrun.o subdir hack Mike Frysinger
2023-01-03  7:55 ` [PATCH 37/83] sim: modules.c: move generation to top-level Mike Frysinger
2023-01-03  7:55 ` [PATCH 38/83] sim: build: add basic framework for compiling arch objects in top-level Mike Frysinger
2023-01-03  7:55 ` [PATCH 39/83] sim: aarch64: move arch-specific file compilation to top-level Mike Frysinger
2023-01-03  7:55 ` [PATCH 40/83] sim: arm: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 41/83] sim: avr: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 42/83] sim: bpf: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 43/83] sim: bfin: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 44/83] sim: cr16: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 45/83] sim: cris: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 46/83] sim: d10v: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 47/83] sim: erc32: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 48/83] sim: example-synacor: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 49/83] sim: frv: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 50/83] sim: ft32: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 51/83] sim: h8300: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 52/83] sim: iq2000: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 53/83] sim: lm32: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 54/83] sim: m32c: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 55/83] sim: m32r: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 56/83] sim: m68hc11: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 57/83] sim: mcore: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 58/83] sim: microblaze: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 59/83] sim: mips: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 60/83] sim: mn10300: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 61/83] sim: moxie: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 62/83] sim: msp430: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 63/83] sim: or1k: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 64/83] sim: pru: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 65/83] sim: riscv: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 66/83] sim: rl78: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 67/83] sim: rx: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 68/83] sim: sh: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 69/83] sim: v850: " Mike Frysinger
2023-01-03  7:55 ` [PATCH 70/83] sim: move arch-specific file compilation of common/ files " Mike Frysinger
2023-01-03  7:55 ` [PATCH 71/83] sim: common: move test-hw-events to top-level build Mike Frysinger
2023-01-03  7:55 ` [PATCH 72/83] sim: disable recursive make in (most) subdirs Mike Frysinger
2023-01-03  7:55 ` [PATCH 73/83] sim: build: drop subdir Makefile.in files Mike Frysinger
2023-01-03  7:55 ` [PATCH 74/83] sim: build: delete Make-common.in logic Mike Frysinger
2023-01-03  7:55 ` [PATCH 75/83] sim: build: drop AM_MAKEFLAGS settings Mike Frysinger
2023-01-03  7:55 ` [PATCH 76/83] sim: common: simplify hw-config.h deps Mike Frysinger
2023-01-03  7:55 ` [PATCH 77/83] sim: igen: simplify build dep Mike Frysinger
2023-01-03  7:56 ` [PATCH 78/83] sim: common: move libcommon.a objects to sources Mike Frysinger
2023-01-03  7:56 ` [PATCH 79/83] sim: build: drop most recursive build deps Mike Frysinger
2023-01-03  7:56 ` [PATCH 80/83] sim: common: move libcommon.a dep to ppc code Mike Frysinger
2023-01-03  7:56 ` [PATCH 81/83] sim: common: move modules.c to source tracking Mike Frysinger
2023-01-03  7:56 ` [PATCH 82/83] sim: common: simplify modules.c deps Mike Frysinger
2023-01-03  7:56 ` [PATCH 83/83] sim: build: drop depdir subdir hack 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).