summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2022-11-06 22:25:18 +0700
committerMike Frysinger <vapier@gentoo.org>2022-11-11 01:44:16 +0700
commit430e1e55171a132a21063393f883d060db525b21 (patch)
treecc93faea7f3bc9e9ae1f9fc8e401da7ed151420e
parentef3bd6c15e83b6446e8724c0deac8896b6efbb62 (diff)
downloadbinutils-gdb-430e1e55171a132a21063393f883d060db525b21.tar.gz
sim: aarch64: move libsim.a creation to top-level
-rw-r--r--sim/aarch64/Makefile.in8
-rw-r--r--sim/aarch64/local.mk24
-rw-r--r--sim/common/Make-common.in3
-rw-r--r--sim/common/local.mk3
4 files changed, 30 insertions, 8 deletions
diff --git a/sim/aarch64/Makefile.in b/sim/aarch64/Makefile.in
index 72a37053b04..e2c5cbc63b8 100644
--- a/sim/aarch64/Makefile.in
+++ b/sim/aarch64/Makefile.in
@@ -21,13 +21,7 @@
## 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 7e5a53797d2..747ecc7c0d0 100644
--- a/sim/aarch64/local.mk
+++ b/sim/aarch64/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/>.
+%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
+
+noinst_LIBRARIES += %D%/libsim.a
+
%C%_run_SOURCES =
%C%_run_LDADD = \
%D%/nrun.o \
@@ -23,3 +37,13 @@
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
+
+SIM_ALL_RECURSIVE_DEPS += %D%/modules.c
+
+$(%C%_libsim_a_LIBADD): | $(SIM_ALL_RECURSIVE_DEPS)
+
+%D%/%.o: %D%/%.c | $(SIM_ALL_RECURSIVE_DEPS)
+ $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
+%D%/%.o: common/%.c | $(SIM_ALL_RECURSIVE_DEPS)
+ $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 52cc3c926f7..1b32841f0bf 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -100,6 +100,7 @@ SIM_EXTRA_CFLAGS =
SIM_EXTRA_LIBS =
# 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 =
# Likewise `distclean'
@@ -165,7 +166,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
diff --git a/sim/common/local.mk b/sim/common/local.mk
index caffca9b02d..9fdd8d86b8a 100644
--- a/sim/common/local.mk
+++ b/sim/common/local.mk
@@ -52,6 +52,9 @@ noinst_LIBRARIES += $(SIM_COMMON_LIB)
CLEANFILES += \
%D%/version.c %D%/version.c-stamp
+%/modules.c:
+ $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
+
##
## For subdirs.
##