From: Mike Frysinger Date: Sun, 6 Nov 2022 03:59:27 +0000 (+0700) Subject: [WIP] sim: aarch64: merge libsim.a build into top-level X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=007b6af6e18810a408aac4132134037b4dc8d206;p=thirdparty%2Fbinutils-gdb.git [WIP] sim: aarch64: merge libsim.a build into top-level --- diff --git a/sim/Makefile.am b/sim/Makefile.am index 7197590035f..630de804c8d 100644 --- a/sim/Makefile.am +++ b/sim/Makefile.am @@ -47,8 +47,11 @@ AM_CPPFLAGS = \ -I$(srcroot)/include \ -I../bfd \ -I.. \ + -I$(@D) \ + -I$(srcdir)/$(@D) \ $(SIM_HW_CFLAGS) \ - $(SIM_INLINE) + $(SIM_INLINE) \ + $(AM_CPPFLAGS_$(@D)) AM_CPPFLAGS_FOR_BUILD = \ -I$(srcroot)/include \ diff --git a/sim/aarch64/local.mk b/sim/aarch64/local.mk index 747ecc7c0d0..bbcf5920723 100644 --- a/sim/aarch64/local.mk +++ b/sim/aarch64/local.mk @@ -16,17 +16,19 @@ ## You should have received a copy of the GNU General Public License ## along with this program. If not, see . -%C%_libsim_a_SOURCES = +AM_CPPFLAGS_%D% = -DSIM_TOPDIR_BUILD + +%C%_libsim_a_SOURCES = \ + %D%/cpustate.c \ + %D%/interp.c \ + %D%/memory.c \ + %D%/modules.c \ + %D%/simulator.c %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 + %D%/sim-resume.o noinst_LIBRARIES += %D%/libsim.a @@ -40,10 +42,11 @@ 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) +$(%C%_libsim_a_OBJECTS) $(%C%_run_OBJECTS) $(%C%_libsim_a_LIBADD): | $(SIM_ALL_RECURSIVE_DEPS) %D%/%.o: common/%.c | $(SIM_ALL_RECURSIVE_DEPS) - $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) + $(AM_V_CC)$(COMPILE) -c -o $@ $< + +# See sim_pre_argv_init and sim_module_install in sim-module.c for more details. +#%D%/modules.c: %D%/stamp-modules ; @true +#%D%/stamp-modules: Makefile $(%C%_libsim_a_SOURCES) ; $(DO_MODULES_C) diff --git a/sim/common/defs.h b/sim/common/defs.h index 17c5ca27586..b74dcc3ce18 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 +#if !defined(SIM_COMMON_BUILD) && !defined(SIM_TOPDIR_BUILD) #include "../config.h" #else #include "config.h" diff --git a/sim/common/local.mk b/sim/common/local.mk index 9fdd8d86b8a..29b19708654 100644 --- a/sim/common/local.mk +++ b/sim/common/local.mk @@ -18,9 +18,8 @@ ## Parts of the common/ sim code that have been unified. ## Most still lives in common/Make-common.in. -AM_CPPFLAGS += \ - -I$(srcdir)/%D% \ - -DSIM_COMMON_BUILD +AM_CPPFLAGS += -I$(srcdir)/%D% +AM_CPPFLAGS_%D% = -DSIM_COMMON_BUILD AM_CPPFLAGS_FOR_BUILD += -I$(srcdir)/%D% ## This makes sure common parts are available before building the arch-subdirs