aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2024-01-02 08:28:34 -0500
committerMike Frysinger <vapier@gentoo.org>2024-01-03 01:21:48 -0500
commite0e9cd645f3e421a39e67b0cc32d5f7551318b9e (patch)
tree908a6b89a98a63439826ef3ee988c6e2989cb705
parent4b2b14460026fb5d7718d8cd936583fef2865c2a (diff)
downloadgdb-e0e9cd645f3e421a39e67b0cc32d5f7551318b9e.zip
gdb-e0e9cd645f3e421a39e67b0cc32d5f7551318b9e.tar.gz
gdb-e0e9cd645f3e421a39e67b0cc32d5f7551318b9e.tar.bz2
sim: ppc: move main.o compilation to top-level
-rw-r--r--sim/Makefile.in27
-rw-r--r--sim/ppc/Makefile.in9
-rw-r--r--sim/ppc/local.mk19
3 files changed, 33 insertions, 22 deletions
diff --git a/sim/Makefile.in b/sim/Makefile.in
index 98cf2df..7bee6e5 100644
--- a/sim/Makefile.in
+++ b/sim/Makefile.in
@@ -1145,10 +1145,10 @@ am_ppc_ld_insn_OBJECTS =
ppc_ld_insn_OBJECTS = $(am_ppc_ld_insn_OBJECTS)
@SIM_ENABLE_ARCH_ppc_TRUE@ppc_ld_insn_DEPENDENCIES = \
@SIM_ENABLE_ARCH_ppc_TRUE@ ppc/ld-insn-main.o ppc/libigen.a
-am_ppc_run_OBJECTS =
+@SIM_ENABLE_ARCH_ppc_TRUE@am_ppc_run_OBJECTS = ppc/main.$(OBJEXT)
ppc_run_OBJECTS = $(am_ppc_run_OBJECTS)
-@SIM_ENABLE_ARCH_ppc_TRUE@ppc_run_DEPENDENCIES = ppc/main.o \
-@SIM_ENABLE_ARCH_ppc_TRUE@ ppc/libsim.a $(am__DEPENDENCIES_4)
+@SIM_ENABLE_ARCH_ppc_TRUE@ppc_run_DEPENDENCIES = ppc/libsim.a \
+@SIM_ENABLE_ARCH_ppc_TRUE@ $(am__DEPENDENCIES_4)
am_pru_run_OBJECTS =
pru_run_OBJECTS = $(am_pru_run_OBJECTS)
@SIM_ENABLE_ARCH_pru_TRUE@pru_run_DEPENDENCIES = pru/nrun.o \
@@ -2929,9 +2929,21 @@ testsuite_common_CPPFLAGS = \
@SIM_ENABLE_ARCH_or1k_TRUE@ or1k/mloop.c \
@SIM_ENABLE_ARCH_or1k_TRUE@ or1k/stamp-mloop
-@SIM_ENABLE_ARCH_ppc_TRUE@ppc_run_SOURCES =
+@SIM_ENABLE_ARCH_ppc_TRUE@AM_CPPFLAGS_ppc = \
+@SIM_ENABLE_ARCH_ppc_TRUE@ -DHAVE_COMMON_FPU \
+@SIM_ENABLE_ARCH_ppc_TRUE@ $(sim_ppc_smp) \
+@SIM_ENABLE_ARCH_ppc_TRUE@ $(sim_ppc_xor_endian) \
+@SIM_ENABLE_ARCH_ppc_TRUE@ $(sim_ppc_bitsize) \
+@SIM_ENABLE_ARCH_ppc_TRUE@ $(sim_ppc_timebase) \
+@SIM_ENABLE_ARCH_ppc_TRUE@ $(sim_ppc_float) \
+@SIM_ENABLE_ARCH_ppc_TRUE@ $(sim_ppc_monitor) \
+@SIM_ENABLE_ARCH_ppc_TRUE@ $(sim_ppc_model) $(sim_ppc_default_model) $(sim_ppc_model_issue) \
+@SIM_ENABLE_ARCH_ppc_TRUE@ $(sim_ppc_switch)
+
+@SIM_ENABLE_ARCH_ppc_TRUE@ppc_run_SOURCES = \
+@SIM_ENABLE_ARCH_ppc_TRUE@ ppc/main.c
+
@SIM_ENABLE_ARCH_ppc_TRUE@ppc_run_LDADD = \
-@SIM_ENABLE_ARCH_ppc_TRUE@ ppc/main.o \
@SIM_ENABLE_ARCH_ppc_TRUE@ ppc/libsim.a \
@SIM_ENABLE_ARCH_ppc_TRUE@ $(SIM_COMMON_LIBS)
@@ -4000,6 +4012,7 @@ ppc/ld-decode$(EXEEXT): $(ppc_ld_decode_OBJECTS) $(ppc_ld_decode_DEPENDENCIES) $
ppc/ld-insn$(EXEEXT): $(ppc_ld_insn_OBJECTS) $(ppc_ld_insn_DEPENDENCIES) $(EXTRA_ppc_ld_insn_DEPENDENCIES) ppc/$(am__dirstamp)
@rm -f ppc/ld-insn$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(ppc_ld_insn_OBJECTS) $(ppc_ld_insn_LDADD) $(LIBS)
+ppc/main.$(OBJEXT): ppc/$(am__dirstamp) ppc/$(DEPDIR)/$(am__dirstamp)
ppc/run$(EXEEXT): $(ppc_run_OBJECTS) $(ppc_run_DEPENDENCIES) $(EXTRA_ppc_run_DEPENDENCIES) ppc/$(am__dirstamp)
@rm -f ppc/run$(EXEEXT)
@@ -4168,6 +4181,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@ppc/$(DEPDIR)/ld-decode.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ppc/$(DEPDIR)/ld-insn.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ppc/$(DEPDIR)/lf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ppc/$(DEPDIR)/main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ppc/$(DEPDIR)/table.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@pru/$(DEPDIR)/modules.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/modules.Po@am__quote@
@@ -5805,9 +5819,6 @@ testsuite/common/bits64m63.c: testsuite/common/bits-gen$(EXEEXT) testsuite/commo
@SIM_ENABLE_ARCH_or1k_TRUE@$(srcdir)/or1k/cpu.h $(srcdir)/or1k/cpu.c $(srcdir)/or1k/model.c $(srcdir)/or1k/sem.c $(srcdir)/or1k/sem-switch.c $(srcdir)/or1k/decode.c $(srcdir)/or1k/decode.h: @CGEN_MAINT@ or1k/cgen-cpu-decode
@SIM_ENABLE_ARCH_ppc_TRUE@ppc/libsim.a: common/libcommon.a
@SIM_ENABLE_ARCH_ppc_TRUE@ $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
-@SIM_ENABLE_ARCH_ppc_TRUE@ppc/main.o: ppc/%.o: ppc/%.c | ppc/libsim.a $(SIM_ALL_RECURSIVE_DEPS)
-@SIM_ENABLE_ARCH_ppc_TRUE@ $(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
@SIM_ENABLE_ARCH_ppc_TRUE@ppc/defines.h: ppc/stamp-defines ; @true
@SIM_ENABLE_ARCH_ppc_TRUE@ppc/stamp-defines: config.h Makefile
@SIM_ENABLE_ARCH_ppc_TRUE@ $(AM_V_GEN)sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < config.h > ppc/defines.hin
diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 68be555..7841e75 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -100,7 +100,7 @@ BFD_LIB = ../../bfd/libbfd.la
TARGETLIB = libsim.a
-all: main.o $(TARGETLIB) $(GDB_OBJ)
+all: $(TARGETLIB) $(GDB_OBJ)
.c.o:
$(ECHO_CC) $(CC) -c $(STD_CFLAGS) $<
@@ -388,11 +388,6 @@ LIB_SRC = \
$(HW_SRC) \
$(LIB_INLINE_SRC)
-MAIN_SRC = \
- main.c \
- gdb-sim.c \
- sim_calls.c
-
COMMON_OBJS_NAMES = \
callback.o \
target-newlib-errno.o \
@@ -495,8 +490,6 @@ gdb-sim.o: gdb-sim.c $(PSIM_H) $(OPTIONS_H) $(REGISTERS_H) $(GDB_REMOTE_SIM_H)
spreg.o: spreg.c $(BASICS_H) $(SPREG_H)
-main.o: main.c $(PSIM_H) $(OPTIONS_H) $(DEVICE_H) $(EVENTS_H) $(BFD_H) $(GDB_CALLBACK_H) $(GDB_REMOTE_SIM_H)
-
device.o: device.c $(DEVICE_TABLE_H) $(CAP_H) $(EVENTS_H) $(PSIM_H)
tree.o: tree.c $(BASICS_H) $(DEVICE_H) $(TREE_H)
diff --git a/sim/ppc/local.mk b/sim/ppc/local.mk
index 155d83a..3c36b60 100644
--- a/sim/ppc/local.mk
+++ b/sim/ppc/local.mk
@@ -15,9 +15,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%_run_SOURCES =
+AM_CPPFLAGS_%C% = \
+ -DHAVE_COMMON_FPU \
+ $(sim_ppc_smp) \
+ $(sim_ppc_xor_endian) \
+ $(sim_ppc_bitsize) \
+ $(sim_ppc_timebase) \
+ $(sim_ppc_float) \
+ $(sim_ppc_monitor) \
+ $(sim_ppc_model) $(sim_ppc_default_model) $(sim_ppc_model_issue) \
+ $(sim_ppc_switch)
+
+%C%_run_SOURCES = \
+ %D%/main.c
%C%_run_LDADD = \
- %D%/main.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
@@ -27,10 +38,6 @@ 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%/main.o: %D%/%.o: %D%/%.c | %D%/libsim.a $(SIM_ALL_RECURSIVE_DEPS)
- $(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
noinst_PROGRAMS += %D%/run
SIM_ALL_RECURSIVE_DEPS += %D%/defines.h