* [PATCH/committed 1/5] sim: ppc: move main.o compilation to top-level
@ 2024-01-03 6:21 Mike Frysinger
2024-01-03 6:21 ` [PATCH/committed 2/5] sim: ppc: move libsim.a creation " Mike Frysinger
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Mike Frysinger @ 2024-01-03 6:21 UTC (permalink / raw)
To: gdb-patches
---
sim/Makefile.in | 27 +++++++++++++++++++--------
sim/ppc/Makefile.in | 9 +--------
sim/ppc/local.mk | 19 +++++++++++++------
3 files changed, 33 insertions(+), 22 deletions(-)
diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 68be55597497..7841e75d4ce8 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 155d83a9470a..3c36b60df5a4 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
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH/committed 2/5] sim: ppc: move libsim.a creation to top-level
2024-01-03 6:21 [PATCH/committed 1/5] sim: ppc: move main.o compilation to top-level Mike Frysinger
@ 2024-01-03 6:21 ` Mike Frysinger
2024-01-03 6:21 ` [PATCH/committed 3/5] sim: drop support for automatic subdir recursion Mike Frysinger
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2024-01-03 6:21 UTC (permalink / raw)
To: gdb-patches
The objects are still compiled in the subdir, but the creation of the
archive itself is in the top-level. This is a required step before we
can move compilation itself up, and makes it easier to review.
The downside is that each object compile is a recursive make instead of
a single one. It adds some overhead, so it's not great, but it shouldn't
be a big deal. This will go away once compilation is hoisted up.
---
sim/Makefile.in | 111 ++++++++++++++++++++++++++++++++++++--------
sim/configure | 1 -
sim/configure.ac | 1 -
sim/ppc/Makefile.in | 9 +---
sim/ppc/local.mk | 54 ++++++++++++++++++---
5 files changed, 141 insertions(+), 35 deletions(-)
diff --git a/sim/configure.ac b/sim/configure.ac
index bc51492fd478..cd84040945b7 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -64,7 +64,6 @@ m4_define([SIM_BUILD_TARGET], [dnl
AS_VAR_APPEND([SIM_ENABLED_ARCHES], [" $1"])
m4_if($2, [true], [dnl
AC_CONFIG_FILES($1/Makefile)
- subdirs="$subdirs $1"
])
AC_CONFIG_FILES($1/.gdbinit:common/gdbinit.in)
])
diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 7841e75d4ce8..8c055689e6e1 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -97,10 +97,7 @@ INCLUDES = -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) -I../..
LIBIBERTY_LIB = ../../libiberty/libiberty.a
BFD_LIB = ../../bfd/libbfd.la
-
-TARGETLIB = libsim.a
-
-all: $(TARGETLIB) $(GDB_OBJ)
+all:
.c.o:
$(ECHO_CC) $(CC) -c $(STD_CFLAGS) $<
@@ -444,10 +441,6 @@ PACKAGE_SRC = pk_disklabel.c
PACKAGE_OBJ = $(PACKAGE_SRC:.c=.o)
-$(TARGETLIB): defines.h $(LIB_OBJ) $(GDB_OBJ)
- $(ECHO_AR) $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
- $(ECHO_RANLIB) $(RANLIB) $(TARGETLIB)
-
psim.o: psim.c $(CPU_H) $(IDECODE_H) $(OPTIONS_H) $(TREE_H) $(BFD_H)
bits.o: bits.c $(BASICS_H)
diff --git a/sim/ppc/local.mk b/sim/ppc/local.mk
index 3c36b60df5a4..90f9489e4644 100644
--- a/sim/ppc/local.mk
+++ b/sim/ppc/local.mk
@@ -26,6 +26,53 @@ AM_CPPFLAGS_%C% = \
$(sim_ppc_model) $(sim_ppc_default_model) $(sim_ppc_model_issue) \
$(sim_ppc_switch)
+%C%_libsim_a_SOURCES = \
+ $(common_libcommon_a_SOURCES)
+%C%_libsim_a_LIBADD = \
+ %D%/debug.o \
+ %D%/bits.o \
+ %D%/sim-endian.o \
+ %D%/os_emul.o \
+ %D%/emul_generic.o \
+ %D%/emul_bugapi.o \
+ %D%/emul_chirp.o \
+ %D%/emul_netbsd.o \
+ %D%/emul_unix.o \
+ %D%/registers.o \
+ %D%/vm.o \
+ %D%/corefile.o \
+ %D%/model.o \
+ %D%/spreg.o \
+ %D%/cpu.o \
+ %D%/interrupts.o \
+ %D%/events.o \
+ %D%/cap.o \
+ %D%/device.o \
+ %D%/tree.o \
+ %D%/device_table.o \
+ %D%/itable.o \
+ %D%/mon.o \
+ %D%/icache.o \
+ %D%/semantics.o \
+ %D%/idecode.o \
+ %D%/support.o \
+ %D%/sim-fpu.o \
+ %D%/psim.o \
+ %D%/pk_disklabel.o \
+ $(patsubst %,%D%/%,$(sim_ppc_hw_obj)) \
+ %D%/options.o \
+ %D%/gdb-sim.o \
+ %D%/sim_calls.o
+
+noinst_LIBRARIES += %D%/libsim.a
+
+## common/sim-endian.c is matched before ppc/sim-endian.c due to the pattern
+## rule below. Force the ppc version until we can unify the two properly.
+%D%/sim-endian.o: $(srcdir)/%D%/sim-endian.c ; $(SIM_COMPILE)
+
+%D%/%.o: common/%.c ; $(SIM_COMPILE)
+-@am__include@ %D%/$(DEPDIR)/*.Po
+
%C%_run_SOURCES = \
%D%/main.c
%C%_run_LDADD = \
@@ -34,13 +81,11 @@ AM_CPPFLAGS_%C% = \
## 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
+%D%/%.o: %D%/%.c | common/libcommon.a %D%/defines.h %D%/stamp-igen %D%/hw.c %D%/hw.h
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
noinst_PROGRAMS += %D%/run
-SIM_ALL_RECURSIVE_DEPS += %D%/defines.h
%D%/defines.h: %D%/stamp-defines ; @true
%D%/stamp-defines: config.h Makefile
$(AM_V_GEN)sed -n -e '/^#define HAVE_/s/ 1$$/",/' -e '/^#define HAVE_/s//"HAVE_/p' < config.h > %D%/defines.hin
@@ -120,7 +165,6 @@ BUILT_SOURCES += \
$(%C%_BUILT_SRC_FROM_IGEN) \
%D%/stamp-igen
-SIM_ALL_RECURSIVE_DEPS += %D%/stamp-igen
$(%C%_BUILT_SRC_FROM_IGEN): %D%/stamp-igen
%C%_IGEN_OPCODE_RULES = %D%/@sim_ppc_opcode@
@@ -224,7 +268,6 @@ BUILT_SOURCES += \
%D%/hw.c \
%D%/hw.h \
%D%/stamp-hw
-SIM_ALL_RECURSIVE_DEPS += %D%/stamp-hw
%D%/hw.c %D%/hw.h: %D%/stamp-igen
## Real packages
@@ -249,7 +292,6 @@ $(srcdir)/%D%/pk.h: @MAINT@ %D%/stamp-pk ; @true
$(AM_V_at)touch $@
%C%_BUILD_OUTPUTS += %D%/stamp-pk
-SIM_ALL_RECURSIVE_DEPS += %D%/stamp-pk
%C%docdir = $(docdir)/%C%
%C%doc_DATA = %D%/BUGS %D%/INSTALL %D%/README %D%/RUN
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH/committed 3/5] sim: drop support for automatic subdir recursion
2024-01-03 6:21 [PATCH/committed 1/5] sim: ppc: move main.o compilation to top-level Mike Frysinger
2024-01-03 6:21 ` [PATCH/committed 2/5] sim: ppc: move libsim.a creation " Mike Frysinger
@ 2024-01-03 6:21 ` Mike Frysinger
2024-01-03 6:21 ` [PATCH/committed 4/5] sim: ppc: hoist compilation up to top-level Mike Frysinger
2024-01-03 6:21 ` [PATCH/committed 5/5] sim: drop support for recursive makes entirely Mike Frysinger
3 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2024-01-03 6:21 UTC (permalink / raw)
To: gdb-patches
No port relies on this anymore, so we can scrub it all.
---
sim/Makefile.am | 10 ---
sim/Makefile.in | 154 +++++++++++++----------------------------------
sim/configure | 8 +--
sim/configure.ac | 3 -
4 files changed, 44 insertions(+), 131 deletions(-)
diff --git a/sim/Makefile.am b/sim/Makefile.am
index b42926070dbd..9183b349725e 100644
--- a/sim/Makefile.am
+++ b/sim/Makefile.am
@@ -24,8 +24,6 @@ GNULIB_PARENT_DIR = ..
srccom = $(srcdir)/common
srcroot = $(srcdir)/..
-SUBDIRS = @subdirs@
-
SIM_PRIMARY_TARGET = @SIM_PRIMARY_TARGET@
## We don't set some of these vars here, but we need to define them so they may
@@ -72,9 +70,6 @@ AM_CPPFLAGS_FOR_BUILD = \
COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD)
LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@
-## Deps to add to the all-recursive target. These are built before descending
-## into any subdirs.
-SIM_ALL_RECURSIVE_DEPS =
## Deps to add to the install-data-local target.
SIM_INSTALL_DATA_LOCAL_DEPS =
## Deps to add to the install-exec-local target.
@@ -205,11 +200,6 @@ if SIM_ENABLE_ARCH_v850
include v850/local.mk
endif
-## Helper targets for running make from the top-level when some subdirs still
-## have Makefiles in subdirs.
-
-all-recursive: $(SIM_ALL_RECURSIVE_DEPS)
-
install-data-local: installdirs $(SIM_INSTALL_DATA_LOCAL_DEPS)
$(AM_V_at)$(MKDIR_P) $(DESTDIR)$(libdir)
lib=`echo sim | sed '$(program_transform_name)'`; \
diff --git a/sim/configure.ac b/sim/configure.ac
index cd84040945b7..937571a9957d 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -86,9 +86,6 @@ m4_define([SIM_TARGET], [dnl
AM_CONDITIONAL([SIM_ENABLE_ARCH_$2], [${sim_enable_arch_$2}])
])
-subdirs=""
-AC_SUBST(subdirs)
-
dnl WHEN ADDING ENTRIES TO THIS MATRIX:
dnl Make sure that the left side always has two dashes. Otherwise you can get
dnl spurious matches. Even for unambiguous cases, do this as a convention, else
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH/committed 4/5] sim: ppc: hoist compilation up to top-level
2024-01-03 6:21 [PATCH/committed 1/5] sim: ppc: move main.o compilation to top-level Mike Frysinger
2024-01-03 6:21 ` [PATCH/committed 2/5] sim: ppc: move libsim.a creation " Mike Frysinger
2024-01-03 6:21 ` [PATCH/committed 3/5] sim: drop support for automatic subdir recursion Mike Frysinger
@ 2024-01-03 6:21 ` Mike Frysinger
2024-01-03 6:21 ` [PATCH/committed 5/5] sim: drop support for recursive makes entirely Mike Frysinger
3 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2024-01-03 6:21 UTC (permalink / raw)
To: gdb-patches
This removes all recursive makes from the ppc port.
---
sim/Makefile.in | 30 +--
sim/configure | 3 -
sim/configure.ac | 2 +-
sim/ppc/Makefile.in | 576 --------------------------------------------
sim/ppc/local.mk | 7 +-
5 files changed, 16 insertions(+), 602 deletions(-)
delete mode 100644 sim/ppc/Makefile.in
diff --git a/sim/configure.ac b/sim/configure.ac
index 937571a9957d..0bb7f7d4b5f1 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -119,7 +119,7 @@ if test "${enable_sim}" != no; then
SIM_TARGET([moxie-*-*], [moxie])
SIM_TARGET([msp430*-*-*], [msp430])
SIM_TARGET([or1k*-*-*], [or1k])
- SIM_TARGET([powerpc*-*-*], [ppc], [true])
+ SIM_TARGET([powerpc*-*-*], [ppc])
SIM_TARGET([pru*-*-*], [pru])
SIM_TARGET([riscv*-*-*], [riscv])
SIM_TARGET([rl78-*-*], [rl78])
diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
deleted file mode 100644
index 8c055689e6e1..000000000000
--- a/sim/ppc/Makefile.in
+++ /dev/null
@@ -1,576 +0,0 @@
-#
-# This file is part of the program psim.
-#
-# Copyright 1994, 1995, 1996, 1997, 2003 Andrew Cagney
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-
-default: all
-
-VPATH = @srcdir@
-srcdir = @srcdir@
-srccom = $(srcdir)/../common
-srcroot = $(srcdir)/../..
-srcsim = $(srcdir)/..
-
-include $(srcroot)/gdb/silent-rules.mk
-
-# Helper code from gnulib.
-GNULIB_PARENT_DIR = ../..
-include $(GNULIB_PARENT_DIR)/gnulib/Makefile.gnulib.inc
-
-# Settings from top-level configure.
-include ../arch-subdir.mk
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-datarootdir = @datarootdir@
-datadir = @datadir@
-mandir = @mandir@
-man1dir = $(mandir)/man1
-man2dir = $(mandir)/man2
-man3dir = $(mandir)/man3
-man4dir = $(mandir)/man4
-man5dir = $(mandir)/man5
-man6dir = $(mandir)/man6
-man7dir = $(mandir)/man7
-man8dir = $(mandir)/man8
-man9dir = $(mandir)/man9
-infodir = @infodir@
-includedir = @includedir@
-
-# This can be referenced by the gettext configuration code.
-top_builddir = ..
-
-SHELL = /bin/sh
-
-BISON = bison
-MAKEINFO = makeinfo
-
-INLINE_CFLAGS = $(SIM_INLINE)
-SMP_CFLAGS = @sim_ppc_smp@
-XOR_ENDIAN_CFLAGS = @sim_ppc_xor_endian@
-BITSIZE_CFLAGS = @sim_ppc_bitsize@
-TIMEBASE_CFLAGS = @sim_ppc_timebase@
-FLOAT_CFLAGS = @sim_ppc_float@
-MONITOR_CFLAGS = @sim_ppc_monitor@
-MODEL_CFLAGS = @sim_ppc_model@ @sim_ppc_default_model@ @sim_ppc_model_issue@
-SWITCH_CFLAGS = @sim_ppc_switch@
-CONFIG_CFLAGS = \
- -DHAVE_CONFIG_H \
- $(SMP_CFLAGS) \
- $(XOR_ENDIAN_CFLAGS) \
- $(BITSIZE_CFLAGS) \
- $(TIMEBASE_CFLAGS) \
- $(FLOAT_CFLAGS) \
- $(MONITOR_CFLAGS) \
- $(MODEL_CFLAGS) \
- $(SWITCH_CFLAGS)
-SIM_FPU_CFLAGS = -DHAVE_COMMON_FPU -I../common -I${srcdir}/../common
-
-STD_CFLAGS = $(CFLAGS) $(WERROR_CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(INCGNU) $(SIM_FPU_CFLAGS)
-NOWARN_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(INCLUDES) $(SIM_FPU_CFLAGS)
-
-LIBS = $(COMMON_LIBS) @LIBS@ $(LIBGNU) $(LIBGNU_EXTRA_LIBS)
-
-.NOEXPORT:
-MAKEOVERRIDES=
-
-LIB_INCLUDES = -I$(srcdir)/../../include
-BFD_INCLUDES = -I../../bfd -I$(srcdir)/../../bfd
-
-INCLUDES = -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) -I../..
-
-LIBIBERTY_LIB = ../../libiberty/libiberty.a
-BFD_LIB = ../../bfd/libbfd.la
-
-all:
-
-.c.o:
- $(ECHO_CC) $(CC) -c $(STD_CFLAGS) $<
-
-
-# Headers outside sim/ppc.
-ANSIDECL_H = $(srcroot)/include/ansidecl.h
-BFD_H = ../../bfd/bfd.h
-GDB_CALLBACK_H = $(srcroot)/include/sim/callback.h
-GDB_REMOTE_SIM_H = $(srcroot)/include/sim/sim.h
-GDB_SIM_PPC_H = $(srcroot)/include/sim/sim-ppc.h
-COMMON_SIM_BASE_H = $(srcroot)/sim/common/sim-base.h
-COMMON_SIM_BASICS_H = $(srcroot)/sim/common/sim-basics.h
-COMMON_SIM_FPU_H = $(srcroot)/sim/common/sim-fpu.h
-COMMON_SIM_INLINE_H = $(srcroot)/sim/common/sim-inline.h
-COMMON_SIM_SIGNAL_H = $(srcroot)/sim/common/sim-signal.h
-
-# Headers in sim/ppc.
-ALTIVEC_EXPRESSION_H = \
- altivec_expression.h
-
-ALTIVEC_REGISTERS_H = \
- altivec_registers.h
-
-BASICS_H = \
- basics.h \
- $(INLINE_H) \
- $(SIM_CALLBACKS_H) \
- $(DEBUG_H) \
- $(WORDS_H) \
- $(BITS_H) \
- $(SIM_ENDIAN_H)
-
-BITS_H = \
- bits.h \
- bits.c
-
-CAP_H = \
- cap.h \
- $(BASICS_H)
-
-COREFILE_H = \
- corefile.h
-
-COREFILE_N_H = \
- corefile-n.h
-
-CPU_H = \
- cpu.h \
- $(BASICS_H) \
- $(REGISTERS_H) \
- $(DEVICE_H) \
- $(COREFILE_H) \
- $(VM_H) \
- $(EVENTS_H) \
- $(INTERRUPTS_H) \
- $(PSIM_H) \
- $(IDECODE_H) \
- $(ITABLE_H) \
- $(OS_EMUL_H) \
- $(MON_H) \
- $(MODEL_H) \
- cpu.c
-
-DEBUG_H = \
- debug.h
-
-DEVICE_H = \
- device.h
-
-DEVICE_TABLE_H = \
- device_table.h \
- $(BASICS_H) \
- $(DEVICE_H) \
- $(TREE_H) \
- $(HW_H)
-
-E500_EXPRESSION_H = \
- e500_expression.h
-
-E500_REGISTERS_H = \
- e500_registers.h
-
-EMUL_BUGAPI_H = \
- emul_bugapi.h
-
-EMUL_CHIRP_H = \
- emul_chirp.h
-
-EMUL_GENERIC_H = \
- emul_generic.h \
- $(CPU_H) \
- $(IDECODE_H) \
- $(OS_EMUL_H) \
- $(TREE_H) \
- $(BFD_H)
-
-EMUL_NETBSD_H = \
- emul_netbsd.h
-
-EMUL_UNIX_H = \
- emul_unix.h
-
-EVENTS_H = \
- events.h
-
-FILTER_H = \
- filter.h
-
-GEN_ICACHE_H = \
- gen-icache.h
-
-GEN_IDECODE_H = \
- gen-idecode.h
-
-GEN_ITABLE_H = \
- gen-itable.h
-
-GEN_MODEL_H = \
- gen-model.h
-
-GEN_SEMANTICS_H = \
- gen-semantics.h
-
-GEN_SUPPORT_H = \
- gen-support.h
-
-HW_CPU_H = \
- hw_cpu.h
-
-HW_PHB_H = \
- hw_phb.h
-
-IDECODE_BRANCH_H = \
- idecode_branch.h
-
-IDECODE_EXPRESSION_H = \
- idecode_expression.h \
- $(ALTIVEC_EXPRESSION_H) \
- $(E500_EXPRESSION_H)
-
-IDECODE_FIELDS_H = \
- idecode_fields.h
-
-INLINE_H = \
- inline.h
-
-INTERRUPTS_H = \
- interrupts.h
-
-LD_CACHE_H = \
- ld-cache.h
-
-LD_DECODE_H = \
- ld-decode.h
-
-LD_INSN_H = \
- ld-insn.h
-
-LF_H = \
- lf.h
-
-MISC_H = \
- misc.h
-
-MON_H = \
- mon.h \
- $(BASICS_H) \
- $(ITABLE_H)
-
-OPTIONS_H = \
- options.h
-
-OS_EMUL_H = \
- os_emul.h
-
-PSIM_H = \
- psim.h \
- $(BASICS_H)
-
-REGISTERS_H = \
- registers.h \
- $(E500_REGISTERS_H) \
- $(ALTIVEC_REGISTERS_H) \
- $(SPREG_H)
-
-SIM_CALLBACKS_H = \
- sim_callbacks.h
-
-SIM_ENDIAN_H = \
- sim-endian.h \
- sim-endian.c
-
-SIM_ENDIAN_N_H = \
- sim-endian-n.h
-
-SIM_MAIN_H = \
- sim-main.h \
- $(COMMON_SIM_BASICS_H) \
- $(COMMON_SIM_SIGNAL_H) \
- $(COMMON_SIM_BASE_H)
-
-STD_CONFIG_H = \
- std-config.h
-
-TABLE_H = \
- table.h
-
-TREE_H = \
- tree.h
-
-VM_H = \
- vm.h
-
-VM_N_H = \
- vm_n.h
-
-WORDS_H = \
- words.h
-
-
-# Generated headers.
-DEFINES_H = \
- defines.h
-
-HW_H = \
- hw.h
-
-ICACHE_H = \
- icache.h
-
-IDECODE_H = \
- idecode.h \
- $(IDECODE_EXPRESSION_H) \
- $(IDECODE_FIELDS_H) \
- $(IDECODE_BRANCH_H)
-
-ITABLE_H = \
- itable.h
-
-MODEL_H = \
- model.h
-
-PK_H = \
- pk.h
-
-SEMANTICS_H = \
- semantics.h
-
-SPREG_H = \
- spreg.h
-
-SUPPORT_H = \
- support.h \
- support.c
-
-INLINE = \
- inline.h \
- inline.c
-
-LIB_INLINE_SRC = \
- psim.c \
- bits.c \
- debug.c \
- sim-endian.c \
- sim-endian.h \
- sim-endian-n.h \
- vm.c \
- vm_n.h \
- corefile.c \
- events.c \
- os_emul.c \
- registers.c \
- cpu.c \
- interrupts.c \
- device.c \
- tree.c \
- device_table.c \
- cap.c \
- mon.c \
- options.c
-
-LIB_SRC = \
- $(PACKAGE_SRC) \
- $(HW_SRC) \
- $(LIB_INLINE_SRC)
-
-COMMON_OBJS_NAMES = \
- callback.o \
- target-newlib-errno.o \
- target-newlib-open.o \
- target-newlib-signal.o \
- target-newlib-syscall.o \
- version.o
-COMMON_OBJS = $(COMMON_OBJS_NAMES:%=../common/%)
-
-# NOTE: semantics, idecode and psim put last so smaller files are compiled
-# first
-LIB_OBJ = \
- debug.o \
- bits.o \
- sim-endian.o \
- os_emul.o \
- emul_generic.o \
- emul_bugapi.o \
- emul_chirp.o \
- emul_netbsd.o \
- emul_unix.o \
- registers.o \
- vm.o \
- corefile.o \
- model.o \
- spreg.o \
- cpu.o \
- interrupts.o \
- events.o \
- cap.o \
- device.o \
- tree.o \
- device_table.o \
- itable.o \
- mon.o \
- icache.o \
- semantics.o \
- idecode.o \
- support.o \
- sim-fpu.o \
- psim.o \
- $(COMMON_OBJS) \
- $(PACKAGE_OBJ) \
- $(HW_OBJ) \
- options.o
-
-
-GDB_OBJ = gdb-sim.o sim_calls.o
-
-HW_SRC = @sim_ppc_hw_src@
-HW_OBJ = @sim_ppc_hw_obj@
-
-PACKAGE_SRC = pk_disklabel.c
-PACKAGE_OBJ = $(PACKAGE_SRC:.c=.o)
-
-
-psim.o: psim.c $(CPU_H) $(IDECODE_H) $(OPTIONS_H) $(TREE_H) $(BFD_H)
-
-bits.o: bits.c $(BASICS_H)
-
-debug.o: debug.c $(BASICS_H)
-
-sim-endian.o: sim-endian.c $(BASICS_H) $(SIM_ENDIAN_N_H)
-
-os_emul.o: os_emul.c $(CPU_H) $(IDECODE_H) $(OS_EMUL_H) $(EMUL_GENERIC_H) $(EMUL_NETBSD_H) $(EMUL_UNIX_H) $(EMUL_CHIRP_H) $(EMUL_BUGAPI_H)
-emul_generic.o: emul_generic.c $(EMUL_GENERIC_H)
-
-emul_bugapi.o: emul_bugapi.c $(EMUL_GENERIC_H) $(EMUL_BUGAPI_H)
-emul_chirp.o: emul_chirp.c $(EMUL_GENERIC_H) $(EMUL_CHIRP_H)
-emul_netbsd.o: emul_netbsd.c $(EMUL_GENERIC_H) $(EMUL_NETBSD_H)
-emul_unix.o: emul_unix.c $(EMUL_GENERIC_H) $(EMUL_UNIX_H)
-
-registers.o: registers.c $(BASICS_H) $(REGISTERS_H)
-
-cpu.o: cpu.c $(CPU_H) $(IDECODE_H)
-
-interrupts.o: interrupts.c $(CPU_H) $(IDECODE_H) $(OS_EMUL_H)
-
-# Given that inlines are turned on now, rebuild idecode whenever
-# anything changes.
-idecode.o: idecode.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(LIB_INLINE_SRC)
-
-# double.o: double.c dp-bit.c
-
-vm.o: vm.c $(BASICS_H) $(REGISTERS_H) $(DEVICE_H) $(COREFILE_H) $(VM_H) $(INTERRUPTS_H) $(MON_H) $(CPU_H) $(VM_N_H)
-
-corefile.o: corefile.c $(BASICS_H) $(DEVICE_TABLE_H) $(COREFILE_H) $(COREFILE_N_H)
-
-model.o: model.c $(CPU_H) $(MON_H)
-
-events.o: events.c $(BASICS_H) $(EVENTS_H)
-
-sim_calls.o: sim_calls.c $(PSIM_H) $(OPTIONS_H) $(DEFS_H) $(BFD_H) $(GDB_CALLBACK_H) $(GDB_REMOTE_SIM_H)
-
-gdb-sim.o: gdb-sim.c $(PSIM_H) $(OPTIONS_H) $(REGISTERS_H) $(GDB_REMOTE_SIM_H) $(GDB_SIM_PPC_H) $(SIM_CALLBACK_H)
-
-spreg.o: spreg.c $(BASICS_H) $(SPREG_H)
-
-device.o: device.c $(DEVICE_TABLE_H) $(CAP_H) $(EVENTS_H) $(PSIM_H)
-
-tree.o: tree.c $(BASICS_H) $(DEVICE_H) $(TREE_H)
-
-device_table.o: device_table.c $(DEVICE_TABLE_H) hw.c
-
-cap.o: cap.c $(CAP_H)
-
-semantics.o: semantics.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(COMMON_SIM_INLINE_H) $(COMMON_SIM_FPU_H) $(SUPPORT_H)
-
-icache.o: icache.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(ICACHE_H) $(COMMON_SIM_INLINE_H) $(COMMON_SIM_FPU_H) $(SUPPORT_H)
-
-support.o: support.c $(CPU_H) $(IDECODE_H) $(COMMON_SIM_INLINE_H) $(COMMON_SIM_FPU_H) $(SUPPORT_H)
-
-itable.o: itable.c $(ITABLE_H)
-
-mon.o: mon.c $(BASICS_H) $(CPU_H) $(MON_H)
-
-sim-fpu.o: $(srcdir)/../common/sim-fpu.c
- $(ECHO_CC) $(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $(srcdir)/../common/sim-fpu.c
-
-# Rebuild options whenever something changes so the date/time is up to date.
-options.o: options.c $(CPU_H) $(OPTIONS_H) $(DEFINES_H) $(BASICS_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) ../config.status Makefile
- $(ECHO_CC) $(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_ppc_opcode@"' '-DIGEN_FLAGS="$(ppc_IGEN_FLAGS)"' $(srcdir)/options.c
-
-hw_cpu.o: hw_cpu.c $(DEVICE_TABLE_H) $(HW_CPU_H) $(INTERRUPTS_H) $(CPU_H)
-hw_com.o: hw_com.c $(DEVICE_TABLE_H)
-hw_core.o: hw_core.c $(DEVICE_TABLE_H) $(COREFILE_H)
-hw_disk.o: hw_disk.c $(DEVICE_TABLE_H) $(PK_H)
-hw_eeprom.o: hw_eeprom.c $(DEVICE_TABLE_H)
-hw_glue.o: hw_glue.c $(DEVICE_TABLE_H)
-hw_htab.o: hw_htab.c $(DEVICE_TABLE_H) $(BFD_H)
-hw_ide.o: hw_ide.c $(DEVICE_TABLE_H)
-hw_init.o: hw_init.c $(DEVICE_TABLE_H) $(BFD_H) $(PSIM_H)
-hw_iobus.o: hw_iobus.c $(DEVICE_TABLE_H)
-hw_memory.o: hw_memory.c $(DEVICE_TABLE_H)
-hw_nvram.o: hw_nvram.c $(DEVICE_TABLE_H)
-hw_opic.o: hw_opic.c $(DEVICE_TABLE_H)
-hw_pal.o: hw_pal.c $(DEVICE_TABLE_H) $(CPU_H)
-hw_phb.o: hw_phb.c $(DEVICE_TABLE_H) $(HW_PHB_H) $(COREFILE_H)
-hw_register.o: hw_register.c $(DEVICE_TABLE_H) $(PSIM_H)
-hw_sem.o: hw_sem.c $(DEVICE_TABLE_H) $(PSIM_H)
-hw_shm.o: hw_shm.c $(DEVICE_TABLE_H) $(PSIM_H)
-hw_trace.o: hw_trace.c $(DEVICE_TABLE_H)
-hw_vm.o: hw_vm.c $(DEVICE_TABLE_H) $(CPU_H)
-# ignore this line, it stops make from getting confused
-
-
-
-pk_disklabel.o: pk_disklabel.c $(DEVICE_TABLE_H) $(PK_H)
-# ignore this line, it stops make from getting confused
-
-
-
-tags etags: TAGS
-
-TAGS:
- etags $(srcdir)/*.h $(srcdir)/*.c
-
-clean mostlyclean:
- rm -f tmp-* *.[oasi] core
-
-distclean realclean: clean
- rm -f TAGS Makefile
-
-maintainer-clean: distclean
- rm -f *~ *.log core *.core
-
-Makefile: Makefile.in ../config.status
- cd .. && $(SHELL) ./config.status ppc/Makefile
-
-../config.status: ../configure
- cd .. && $(SHELL) ./config.status --recheck
-
-check:
-
-html:
-clean-html:
-install-html:
-
-info:
-clean-info:
-install-info:
-
-pdf:
-clean-pdf:
-install-pdf:
-
-install:
-installdirs:
-uninstall:
diff --git a/sim/ppc/local.mk b/sim/ppc/local.mk
index 90f9489e4644..01cc1251a89b 100644
--- a/sim/ppc/local.mk
+++ b/sim/ppc/local.mk
@@ -25,6 +25,7 @@ AM_CPPFLAGS_%C% = \
$(sim_ppc_monitor) \
$(sim_ppc_model) $(sim_ppc_default_model) $(sim_ppc_model_issue) \
$(sim_ppc_switch)
+AM_CPPFLAGS_%C%_options.o = '-DOPCODE_RULES="$(IGEN_OPCODE_RULES)"' '-DIGEN_FLAGS="$(ppc_IGEN_FLAGS)"'
%C%_libsim_a_SOURCES = \
$(common_libcommon_a_SOURCES)
@@ -79,11 +80,6 @@ noinst_LIBRARIES += %D%/libsim.a
%D%/libsim.a \
$(SIM_COMMON_LIBS)
-## This makes sure common parts are available before building the arch-subdirs
-## which will refer to these.
-%D%/%.o: %D%/%.c | common/libcommon.a %D%/defines.h %D%/stamp-igen %D%/hw.c %D%/hw.h
- $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
-
noinst_PROGRAMS += %D%/run
%D%/defines.h: %D%/stamp-defines ; @true
@@ -92,6 +88,7 @@ noinst_PROGRAMS += %D%/run
$(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/defines.hin %D%/defines.h
$(AM_V_at)touch $@
+BUILT_SOURCES += %D%/defines.h
MOSTLYCLEANFILES += %D%/defines.h %D%/stamp-defines
%D%/spreg.c: @MAINT@ %D%/ppc-spr-table %D%/spreg-gen.py %D%/$(am__dirstamp)
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH/committed 5/5] sim: drop support for recursive makes entirely
2024-01-03 6:21 [PATCH/committed 1/5] sim: ppc: move main.o compilation to top-level Mike Frysinger
` (2 preceding siblings ...)
2024-01-03 6:21 ` [PATCH/committed 4/5] sim: ppc: hoist compilation up to top-level Mike Frysinger
@ 2024-01-03 6:21 ` Mike Frysinger
3 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2024-01-03 6:21 UTC (permalink / raw)
To: gdb-patches
Now that all ports have been merged to the top-level, we no longer need
this framework to pass settings down to sub-makefiles. Delete it all.
---
sim/Makefile.in | 4 +--
sim/arch-subdir.mk.in | 68 -------------------------------------------
sim/configure | 35 +---------------------
sim/configure.ac | 9 ++----
4 files changed, 4 insertions(+), 112 deletions(-)
delete mode 100644 sim/arch-subdir.mk.in
diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in
deleted file mode 100644
index c3da955668a6..000000000000
--- a/sim/arch-subdir.mk.in
+++ /dev/null
@@ -1,68 +0,0 @@
-## Fragment to pass common settings into arch subdir builds.
-## NB: This should eventually be merged into sim/Makefile.am once there are no
-## subdir configure scripts.
-#
-# Copyright (C) 1993-2023 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-AM_V = @AM_V@
-
-EXEEXT = @EXEEXT@
-
-LN_S = @LN_S@
-
-CC = @CC@
-C_DIALECT = @C_DIALECT@
-CC_FOR_BUILD = @CC_FOR_BUILD@
-CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
-CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-
-AR = @AR@
-AR_FLAGS = rc
-RANLIB = @RANLIB@
-
-LIBTOOL = @LIBTOOL@
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-
-DEPMODE = @CCDEPMODE@
-DEPDIR = @DEPDIR@
-
-SDL_CFLAGS = @SDL_CFLAGS@
-TERMCAP_LIB = @TERMCAP_LIB@
-READLINE_LIB = @READLINE_LIB@
-READLINE_CFLAGS = @READLINE_CFLAGS@
-
-COMMON_LIBS = @LIBS@
-WARN_CFLAGS = @WARN_CFLAGS@
-WERROR_CFLAGS = @WERROR_CFLAGS@
-
-# Maintainer support, enable with --enable-maintainer-mode.
-# Once all subdirs are moved to automake, we can drop this custom logic and
-# switch back to using @MAINTAINER_MODE_TRUE@ directly.
-MAINT = ; @true
-# The following line is commented depending upon --enable-maintainer-mode.
-@MAINTAINER_MODE_TRUE@MAINT =
-
-SIM_INLINE = @SIM_INLINE@
-
-SIM_HW_CFLAGS = @SIM_HW_CFLAGS@
-
-PPC_IGEN_FLAGS = $(ppc_IGEN_FLAGS)
diff --git a/sim/configure.ac b/sim/configure.ac
index 0bb7f7d4b5f1..2a1b3a2f27d9 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -58,19 +58,14 @@ AC_SUBST(SIM_ENABLED_ARCHES)
ENABLE_SIM=no
dnl Build a particular arch subdir.
dnl arg[1] is the arch subdir name.
-dnl arg[2] is whether the arch has a dedicated configure script.
m4_define([SIM_BUILD_TARGET], [dnl
ENABLE_SIM=yes
AS_VAR_APPEND([SIM_ENABLED_ARCHES], [" $1"])
- m4_if($2, [true], [dnl
- AC_CONFIG_FILES($1/Makefile)
- ])
AC_CONFIG_FILES($1/.gdbinit:common/gdbinit.in)
])
dnl Enable a particular arch subdir.
dnl arg[1] is the matching target triple.
dnl arg[2] is the arch subdir name.
-dnl arg[3] is whether the arch has a dedicated configure script.
m4_define([SIM_TARGET], [dnl
sim_enable_arch_$2=false
case "${targ}" in
@@ -78,7 +73,7 @@ m4_define([SIM_TARGET], [dnl
if test "${targ}" = "${target}"; then
SIM_PRIMARY_TARGET=$2
fi
- SIM_BUILD_TARGET($2, $3)
+ SIM_BUILD_TARGET($2)
sim_enable_arch_$2=true
;;
esac
@@ -162,5 +157,5 @@ m4_include([ppc/acinclude.m4])
m4_include([riscv/acinclude.m4])
m4_include([rx/acinclude.m4])
-AC_CONFIG_FILES([arch-subdir.mk Makefile .gdbinit:gdbinit.in])
+AC_CONFIG_FILES([Makefile .gdbinit:gdbinit.in])
AC_OUTPUT
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-01-03 6:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-03 6:21 [PATCH/committed 1/5] sim: ppc: move main.o compilation to top-level Mike Frysinger
2024-01-03 6:21 ` [PATCH/committed 2/5] sim: ppc: move libsim.a creation " Mike Frysinger
2024-01-03 6:21 ` [PATCH/committed 3/5] sim: drop support for automatic subdir recursion Mike Frysinger
2024-01-03 6:21 ` [PATCH/committed 4/5] sim: ppc: hoist compilation up to top-level Mike Frysinger
2024-01-03 6:21 ` [PATCH/committed 5/5] sim: drop support for recursive makes entirely Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).