sim: run: move linking into top-level

Automake will run each subdir individually before moving on to the next
one.  This means that the linking phase, a single threaded process, will
not run in parallel with anything else.  When we have to link ~32 ports,
that's 32 link steps that don't take advantage of parallel systems.  On
my really old 4-core system, this cuts a multi-target build from ~60 sec
to ~30 sec.  We eventually want to move all compile+link steps to this
common dir anyways, so might as well move linking now for a nice speedup.

We use noinst_PROGRAMS instead of bin_PROGRAMS because we're taking care
of the install ourselves rather than letting automake process it.
This commit is contained in:
Mike Frysinger 2022-11-03 18:19:13 +07:00
parent 59d8576e4f
commit c0c25232da
40 changed files with 1445 additions and 126 deletions

View file

@ -33,6 +33,7 @@ AM_MAKEFLAGS = SIM_PRIMARY_TARGET=$(SIM_PRIMARY_TARGET)
## be used consistently in local.mk files we include below.
pkginclude_HEADERS =
check_PROGRAMS =
noinst_PROGRAMS =
noinst_LIBRARIES =
EXTRA_PROGRAMS =
@ -85,9 +86,19 @@ include igen/local.mk
endif
include testsuite/local.mk
## Arch includes must come after common/local.mk.
if SIM_ENABLE_ARCH_aarch64
include aarch64/local.mk
endif
if SIM_ENABLE_ARCH_arm
include arm/local.mk
endif
if SIM_ENABLE_ARCH_avr
include avr/local.mk
endif
if SIM_ENABLE_ARCH_bfin
include bfin/local.mk
endif
if SIM_ENABLE_ARCH_bpf
include bpf/local.mk
endif
@ -103,9 +114,18 @@ endif
if SIM_ENABLE_ARCH_erc32
include erc32/local.mk
endif
if SIM_ENABLE_ARCH_examples
include example-synacor/local.mk
endif
if SIM_ENABLE_ARCH_frv
include frv/local.mk
endif
if SIM_ENABLE_ARCH_ft32
include ft32/local.mk
endif
if SIM_ENABLE_ARCH_h8300
include h8300/local.mk
endif
if SIM_ENABLE_ARCH_iq2000
include iq2000/local.mk
endif
@ -121,18 +141,39 @@ endif
if SIM_ENABLE_ARCH_m68hc11
include m68hc11/local.mk
endif
if SIM_ENABLE_ARCH_mcore
include mcore/local.mk
endif
if SIM_ENABLE_ARCH_microblaze
include microblaze/local.mk
endif
if SIM_ENABLE_ARCH_mips
include mips/local.mk
endif
if SIM_ENABLE_ARCH_mn10300
include mn10300/local.mk
endif
if SIM_ENABLE_ARCH_moxie
include moxie/local.mk
endif
if SIM_ENABLE_ARCH_msp430
include msp430/local.mk
endif
if SIM_ENABLE_ARCH_or1k
include or1k/local.mk
endif
if SIM_ENABLE_ARCH_ppc
include ppc/local.mk
endif
if SIM_ENABLE_ARCH_pru
include pru/local.mk
endif
if SIM_ENABLE_ARCH_riscv
include riscv/local.mk
endif
if SIM_ENABLE_ARCH_rl78
include rl78/local.mk
endif
if SIM_ENABLE_ARCH_rx
include rx/local.mk
endif
@ -143,6 +184,15 @@ 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.
%/libsim.a: | $(SIM_ALL_RECURSIVE_DEPS)
$(MAKE) -C $(@D) $(@F)
%/nrun.o: common/nrun.c | %/libsim.a $(SIM_ALL_RECURSIVE_DEPS)
$(MAKE) -C $(@D) $(@F)
all-recursive: $(SIM_ALL_RECURSIVE_DEPS)
install-data-local: installdirs $(SIM_INSTALL_DATA_LOCAL_DEPS)

File diff suppressed because it is too large Load diff

25
sim/aarch64/local.mk Normal file
View file

@ -0,0 +1,25 @@
## See sim/Makefile.am
##
## Copyright (C) 2015-2022 Free Software Foundation, Inc.
## Contributed by Red Hat.
##
## 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/>.
%C%_run_SOURCES =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run

View file

@ -1,6 +1,7 @@
## See sim/Makefile.am
##
## Copyright (C) 1995-2022 Free Software Foundation, Inc.
## Written by Cygnus Support.
##
## 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
@ -15,5 +16,13 @@
## 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 =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
%C%docdir = $(docdir)/%C%
%C%doc_DATA = %D%/README

24
sim/avr/local.mk Normal file
View file

@ -0,0 +1,24 @@
## See sim/Makefile.am
##
## Copyright (C) 2009-2022 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/>.
%C%_run_SOURCES =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run

25
sim/bfin/local.mk Normal file
View file

@ -0,0 +1,25 @@
## See sim/Makefile.am
##
## Copyright (C) 2005-2022 Free Software Foundation, Inc.
## Written by Analog Devices, 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/>.
%C%_run_SOURCES =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run

View file

@ -15,6 +15,14 @@
## 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 =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
%C%_BUILD_OUTPUTS = \
%D%/eng-le.h \
%D%/mloop-le.c \

View file

@ -208,18 +208,13 @@ LINK_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(LDFLAGS_FOR_BUILD) -o $@
RUNTESTFLAGS =
all: libsim.a run$(EXEEXT)
all: libsim.a $(SIM_RUN_OBJS)
libsim.a: $(LIB_OBJS)
$(SILENCE) rm -f libsim.a
$(ECHO_AR) $(AR) $(AR_FLAGS) libsim.a $(LIB_OBJS)
$(ECHO_RANLIB) $(RANLIB) libsim.a
run$(EXEEXT): $(SIM_RUN_OBJS) libsim.a $(LIBDEPS)
$(ECHO_CCLD) $(LIBTOOL) $(AM_V_lt) --tag=CC --mode=link \
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o run$(EXEEXT) \
$(SIM_RUN_OBJS) libsim.a $(EXTRA_LIBS)
#
# Dependency tracking. Most of this is conditional on GNU Make being
# found by configure; if GNU Make is not found, we fall back to a

View file

@ -30,7 +30,8 @@ SIM_ALL_RECURSIVE_DEPS += \
## NB: libcommon.a isn't used directly by ports. We need a target for common
## objects to be a part of, and ports use the individual objects directly.
noinst_LIBRARIES += %D%/libcommon.a
SIM_COMMON_LIB = %D%/libcommon.a
noinst_LIBRARIES += $(SIM_COMMON_LIB)
%C%_libcommon_a_SOURCES = \
%D%/callback.c \
%D%/portability.c \
@ -50,3 +51,19 @@ noinst_LIBRARIES += %D%/libcommon.a
CLEANFILES += \
%D%/version.c %D%/version.c-stamp
##
## For subdirs.
##
LIBIBERTY_LIB = ../libiberty/libiberty.a
BFD_LIB = ../bfd/libbfd.la
OPCODES_LIB = ../opcodes/libopcodes.la
SIM_COMMON_LIBS = \
$(SIM_COMMON_LIB) \
$(BFD_LIB) \
$(OPCODES_LIB) \
$(LIBIBERTY_LIB) \
$(LIBGNU) \
$(LIBGNU_EXTRA_LIBS)

18
sim/configure vendored
View file

@ -655,6 +655,8 @@ ENABLE_SIM_FALSE
ENABLE_SIM_TRUE
SIM_ENABLE_IGEN_FALSE
SIM_ENABLE_IGEN_TRUE
SIM_ENABLE_ARCH_examples_FALSE
SIM_ENABLE_ARCH_examples_TRUE
CC_FOR_TARGET_EXAMPLE_SYNACOR
LD_FOR_TARGET_EXAMPLE_SYNACOR
AS_FOR_TARGET_EXAMPLE_SYNACOR
@ -12426,7 +12428,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 12429 "configure"
#line 12431 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -12532,7 +12534,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 12535 "configure"
#line 12537 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -15680,6 +15682,14 @@ as_fn_append SIM_TOOLCHAIN_VARS " AS_FOR_TARGET_EXAMPLE_SYNACOR LD_FOR_TARGET_EX
fi
if test "${enable_example_sims}" = "yes"; then
SIM_ENABLE_ARCH_examples_TRUE=
SIM_ENABLE_ARCH_examples_FALSE='#'
else
SIM_ENABLE_ARCH_examples_TRUE='#'
SIM_ENABLE_ARCH_examples_FALSE=
fi
fi
if test "$sim_igen" = "yes"; then
SIM_ENABLE_IGEN_TRUE=
@ -16487,6 +16497,10 @@ if test -z "${SIM_ENABLE_ARCH_v850_TRUE}" && test -z "${SIM_ENABLE_ARCH_v850_FAL
as_fn_error $? "conditional \"SIM_ENABLE_ARCH_v850\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${SIM_ENABLE_ARCH_examples_TRUE}" && test -z "${SIM_ENABLE_ARCH_examples_FALSE}"; then
as_fn_error $? "conditional \"SIM_ENABLE_ARCH_examples\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${SIM_ENABLE_IGEN_TRUE}" && test -z "${SIM_ENABLE_IGEN_FALSE}"; then
as_fn_error $? "conditional \"SIM_ENABLE_IGEN\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5

View file

@ -156,6 +156,7 @@ if test "${enable_sim}" != no; then
SIM_AC_TOOLCHAIN_FOR_TARGET(example-synacor)
SIM_BUILD_TARGET([example-synacor])
fi
AM_CONDITIONAL([SIM_ENABLE_ARCH_examples], [test "${enable_example_sims}" = "yes"])
fi
AM_CONDITIONAL([SIM_ENABLE_IGEN], [test "$sim_igen" = "yes"])
AM_CONDITIONAL([ENABLE_SIM], [test -n "$SIM_SUBDIRS"])

View file

@ -16,6 +16,14 @@
## 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 =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
%C%_BUILD_OUTPUTS = \
%D%/gencode$(EXEEXT) \
%D%/simops.h \

View file

@ -16,6 +16,14 @@
## 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 =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
## rvdummy is just used for testing -- it runs on the same host as `run`.
## It does nothing if --enable-sim-hardware isn't active.
%C%_rvdummy_SOURCES = %D%/rvdummy.c

View file

@ -16,6 +16,14 @@
## 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 =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
%C%_BUILD_OUTPUTS = \
%D%/gencode$(EXEEXT) \
%D%/simops.h \

View file

@ -24,7 +24,6 @@ SIM_OBJS = exec.o erc32.o func.o help.o float.o interf.o
SIM_RUN_OBJS = sis.o
SIM_EXTRA_CFLAGS = $(READLINE_CFLAGS)
SIM_EXTRA_LIBS = $(READLINE_LIB) $(TERMCAP_LIB)
SIM_EXTRA_CLEAN = clean-sis
# UARTS run at about 115200 baud (simulator time). Add -DFAST_UART to
# CFLAGS if faster (infinite) UART speed is desired. Might affect the
@ -32,11 +31,3 @@ SIM_EXTRA_CLEAN = clean-sis
SIM_EXTRA_CFLAGS += -DFAST_UART -I$(srcroot)
## COMMON_POST_CONFIG_FRAG
all: sis$(EXEEXT)
sis$(EXEEXT): run$(EXEEXT)
$(SILENCE) rm -f $@
$(ECHO_GEN) ln $< $@ 2>/dev/null || $(LN_S) $< $@ 2>/dev/null || cp -p $< $@
clean-sis:
rm -f sis

View file

@ -1,6 +1,8 @@
## See sim/Makefile.am
##
## Copyright (C) 1993-2022 Free Software Foundation, Inc.
## Written by Cygnus Support
## Modified by J.Gaisler ESA/ESTEC
##
## 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
@ -15,6 +17,21 @@
## 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 =
%C%_run_LDADD = \
%D%/sis.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS) $(READLINE_LIB) $(TERMCAP_LIB)
%D%/sis$(EXEEXT): %D%/run$(EXEEXT)
$(AM_V_GEN)ln $< $@ 2>/dev/null || $(LN_S) $< $@ 2>/dev/null || cp -p $< $@
## Helper targets for running make from the top-level due to run's sis.o.
%D%/%.o: %D%/%.c | %D%/libsim.a $(SIM_ALL_RECURSIVE_DEPS)
$(MAKE) -C $(@D) $(@F)
noinst_PROGRAMS += %D%/run %D%/sis
%C%docdir = $(docdir)/%C%
%C%doc_DATA = %D%/README.erc32 %D%/README.gdb %D%/README.sis

View file

@ -0,0 +1,25 @@
## See sim/Makefile.am
##
## Copyright (C) 2005-2022 Free Software Foundation, Inc.
## Written by Mike Frysinger <vapier@gentoo.org>
##
## 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/>.
%C%_run_SOURCES =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run

View file

@ -16,6 +16,14 @@
## 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 =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
%C%docdir = $(docdir)/%C%
%C%doc_DATA = %D%/README

25
sim/ft32/local.mk Normal file
View file

@ -0,0 +1,25 @@
## See sim/Makefile.am
##
## Copyright (C) 2008-2022 Free Software Foundation, Inc.
## Written by FTDI
##
## 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/>.
%C%_run_SOURCES =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run

25
sim/h8300/local.mk Normal file
View file

@ -0,0 +1,25 @@
## See sim/Makefile.am
##
## Copyright (C) 1990-2022 Free Software Foundation, Inc.
## Written by Cygnus Support.
##
## 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/>.
%C%_run_SOURCES =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run

View file

@ -16,6 +16,14 @@
## 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 =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
%C%_BUILD_OUTPUTS = \
%D%/eng.h \
%D%/mloop.c \

View file

@ -16,6 +16,14 @@
## 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 =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
%C%_BUILD_OUTPUTS = \
%D%/eng.h \
%D%/mloop.c \

View file

@ -16,6 +16,18 @@
## 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 =
%C%_run_LDADD = \
%D%/main.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
## Helper targets for running make from the top-level due to run's main.o.
%D%/%.o: %D%/%.c | %D%/libsim.a $(SIM_ALL_RECURSIVE_DEPS)
$(MAKE) -C $(@D) $(@F)
%C%_BUILD_OUTPUTS = \
%D%/opc2c$(EXEEXT) \
%D%/m32c.c \

View file

@ -16,6 +16,14 @@
## 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 =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
%C%_BUILD_OUTPUTS = \
%D%/eng.h \
%D%/mloop.c \

View file

@ -16,6 +16,14 @@
## 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 =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
%C%_BUILD_OUTPUTS = \
%D%/gencode$(EXEEXT) \
%D%/m68hc11int.c \

25
sim/mcore/local.mk Normal file
View file

@ -0,0 +1,25 @@
## See sim/Makefile.am
##
## Copyright (C) 1990-2022 Free Software Foundation, Inc.
## Written by Cygnus Solutions.
##
## 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/>.
%C%_run_SOURCES =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run

25
sim/microblaze/local.mk Normal file
View file

@ -0,0 +1,25 @@
## See sim/Makefile.am
##
## Copyright (C) 1990-2022 Free Software Foundation, Inc.
## Written by Cygnus Solutions.
##
## 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/>.
%C%_run_SOURCES =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run

25
sim/mips/local.mk Normal file
View file

@ -0,0 +1,25 @@
## See sim/Makefile.am
##
## Copyright (C) 1995-2022 Free Software Foundation, Inc.
## Written by Cygnus Support.
##
## 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/>.
%C%_run_SOURCES =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run

View file

@ -16,6 +16,14 @@
## 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 =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
%C%_BUILT_SRC_FROM_IGEN = \
%D%/icache.h \
%D%/icache.c \

View file

@ -1,6 +1,7 @@
## See sim/Makefile.am
##
## Copyright (C) 1993-2022 Free Software Foundation, Inc.
## Copyright (C) 2008-2022 Free Software Foundation, Inc.
## Written by Anthony Green
##
## 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
@ -15,6 +16,14 @@
## 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 =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
dtbdir = $(datadir)/gdb/dtb
dtb_DATA = %D%/moxie-gdb.dtb
@ -30,10 +39,3 @@ dtb_DATA = %D%/moxie-gdb.dtb
echo "tree compiler tool (dtc) is missing. Install the tool to "; \
echo "update the device tree blob."; \
fi
# Rule to create the .dirstamp file (on which moxie-gdb.dtb depends)
# as automake fails to automatically create this rule for _DATA items.
%D%/$(am__dirstamp):
@$(MKDIR_P) %D%
@: >%D%/$(am__dirstamp)
DISTCLEANFILES += %D%/$(am__dirstamp)

25
sim/msp430/local.mk Normal file
View file

@ -0,0 +1,25 @@
## See sim/Makefile.am
##
## Copyright (C) 2012-2022 Free Software Foundation, Inc.
## Written by Red Hat 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/>.
%C%_run_SOURCES =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run

View file

@ -15,6 +15,14 @@
## 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 =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
%C%docdir = $(docdir)/%C%
%C%doc_DATA = %D%/README

View file

@ -37,10 +37,6 @@ include ../arch-subdir.mk
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
tooldir = $(libdir)/$(target_alias)
datarootdir = @datarootdir@
datadir = @datadir@
mandir = @mandir@
@ -135,7 +131,7 @@ BFD_LIB = ../../bfd/libbfd.la
TARGETLIB = libsim.a
all: run$(EXEEXT) $(TARGETLIB) $(GDB_OBJ)
all: main.o $(TARGETLIB) $(GDB_OBJ)
.c.o:
$(ECHO_CC) $(CC) -c $(STD_CFLAGS) $<
@ -518,14 +514,6 @@ PACKAGE_SRC = pk_disklabel.c
PACKAGE_OBJ = $(PACKAGE_SRC:.c=.o)
psim$(EXEEXT): $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB)
$(ECHO_CCLD) $(LIBTOOL) $(AM_V_lt) --tag=CC --mode=link \
$(CC) $(CFLAGS) $(LDFLAGS) -o psim$(EXEEXT) main.o $(TARGETLIB) $(BFD_LIB) $(LIBIBERTY_LIB) $(LIBS)
run$(EXEEXT): psim$(EXEEXT)
$(SILENCE) rm -f $@
$(ECHO_GEN) ln $< $@ 2>/dev/null || $(LN_S) $< $@ 2>/dev/null || cp -p $< $@
$(TARGETLIB): tmp-igen tmp-dgen tmp-hw tmp-defines $(LIB_OBJ) $(GDB_OBJ)
$(ECHO_AR) $(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
$(ECHO_RANLIB) $(RANLIB) $(TARGETLIB)
@ -811,7 +799,7 @@ TAGS: $(BUILT_SRC)
etags $(srcdir)/*.h $(srcdir)/*.c $(BUILT_SRC)
clean mostlyclean:
rm -f tmp-* *.[oasi] core psim$(EXEEXT) run$(EXEEXT) igen dgen $(BUILT_SRC_WO_CONFIG)
rm -f tmp-* *.[oasi] core igen dgen $(BUILT_SRC_WO_CONFIG)
distclean realclean: clean
rm -f TAGS Makefile config.cache config.status config.h defines.h stamp-h config.log

View file

@ -15,5 +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 =
%C%_run_LDADD = \
%D%/main.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
%D%/psim$(EXEEXT): %D%/run$(EXEEXT)
$(AM_V_GEN)ln $< $@ 2>/dev/null || $(LN_S) $< $@ 2>/dev/null || cp -p $< $@
## Helper targets for running make from the top-level due to run's sis.o.
%D%/%.o: %D%/%.c | %D%/libsim.a $(SIM_ALL_RECURSIVE_DEPS)
$(MAKE) -C $(@D) $(@F)
noinst_PROGRAMS += %D%/run %D%/psim
%C%docdir = $(docdir)/%C%
%C%doc_DATA = %D%/BUGS %D%/INSTALL %D%/README %D%/RUN

25
sim/pru/local.mk Normal file
View file

@ -0,0 +1,25 @@
## See sim/Makefile.am
##
## Copyright (C) 1990-2022 Free Software Foundation, Inc.
## Written by Dimitar Dimitrov <dimitar@dinux.eu>
##
## 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/>.
%C%_run_SOURCES =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run

25
sim/riscv/local.mk Normal file
View file

@ -0,0 +1,25 @@
## See sim/Makefile.am
##
## Copyright (C) 2005-2022 Free Software Foundation, Inc.
## Written by Mike Frysinger.
##
## 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/>.
%C%_run_SOURCES =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run

29
sim/rl78/local.mk Normal file
View file

@ -0,0 +1,29 @@
## See sim/Makefile.am
##
## Copyright (C) 2008-2022 Free Software Foundation, Inc.
## Contributed by Red Hat, 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/>.
%C%_run_SOURCES =
%C%_run_LDADD = \
%D%/main.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
## Helper targets for running make from the top-level due to run's main.o.
%D%/%.o: %D%/%.c | %D%/libsim.a $(SIM_ALL_RECURSIVE_DEPS)
$(MAKE) -C $(@D) $(@F)

View file

@ -1,6 +1,7 @@
## See sim/Makefile.am
##
## Copyright (C) 2008-2022 Free Software Foundation, Inc.
## Contributed by Red Hat, 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
@ -15,5 +16,17 @@
## 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 =
%C%_run_LDADD = \
%D%/main.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
## Helper targets for running make from the top-level due to run's main.o.
%D%/%.o: %D%/%.c | %D%/libsim.a $(SIM_ALL_RECURSIVE_DEPS)
$(MAKE) -C $(@D) $(@F)
%C%docdir = $(docdir)/%C%
%C%doc_DATA = %D%/README.txt

View file

@ -16,6 +16,14 @@
## 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 =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
%C%_BUILD_OUTPUTS = \
%D%/gencode$(EXEEXT) \
%D%/code.c \

View file

@ -16,6 +16,14 @@
## 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 =
%C%_run_LDADD = \
%D%/nrun.o \
%D%/libsim.a \
$(SIM_COMMON_LIBS)
noinst_PROGRAMS += %D%/run
%C%_BUILT_SRC_FROM_IGEN = \
%D%/icache.h \
%D%/icache.c \