[80/83] sim: common: move libcommon.a dep to ppc code

Message ID 20230103075605.13606-81-vapier@gentoo.org
State Committed
Headers
Series sim: merge subdir makefiles into top-level |

Commit Message

Mike Frysinger Jan. 3, 2023, 7:56 a.m. UTC
  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(-)
  

Patch

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)