]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: aarch64: move libsim.a creation to top-level
authorMike Frysinger <vapier@gentoo.org>
Sun, 6 Nov 2022 15:25:18 +0000 (22:25 +0700)
committerMike Frysinger <vapier@gentoo.org>
Thu, 10 Nov 2022 18:44:16 +0000 (01:44 +0700)
sim/aarch64/Makefile.in
sim/aarch64/local.mk
sim/common/Make-common.in
sim/common/local.mk

index 72a37053b049365763ced4e2c74719543246fcba..e2c5cbc63b8ec6073550a79bdf3082e24d6163ed 100644 (file)
 
 ## 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
 
index 7e5a53797d24de4d43650f1094a873f7d3dffc15..747ecc7c0d0ece8718a30a9c272e12902423935c 100644 (file)
 ## 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 \
        $(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)
index 52cc3c926f7f83d69c3b203b845dedd91833ec98..1b32841f0bf3ff48d9760fef5e5e33efc851d597 100644 (file)
@@ -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
index caffca9b02d36456223e96fba8d614f9bd9a163b..9fdd8d86b8a22498ffbd4a46e7905a2f964ff9c8 100644 (file)
@@ -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.
 ##