aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-10-31 02:08:38 -0400
committerMike Frysinger <vapier@gentoo.org>2021-11-02 22:59:07 -0400
commit70ab6bdd55540779cda498611010b61619f1758a (patch)
tree82dd6eefdcfb8439a5435f3e0862e286e1560fc5
parentb50f43349841643ae5fad7110fc37cb432a45208 (diff)
downloadgdb-70ab6bdd55540779cda498611010b61619f1758a.zip
gdb-70ab6bdd55540779cda498611010b61619f1758a.tar.gz
gdb-70ab6bdd55540779cda498611010b61619f1758a.tar.bz2
sim: hoist gencode & opc2c build rules up to common builds
These rules don't depend on the target compiler settings, so hoist the build logic up to the common builds for better parallelization.
-rw-r--r--sim/Makefile.am16
-rw-r--r--sim/Makefile.in387
-rw-r--r--sim/cr16/Makefile.in22
-rw-r--r--sim/cr16/local.mk47
-rw-r--r--sim/d10v/Makefile.in19
-rw-r--r--sim/d10v/local.mk47
-rw-r--r--sim/m32c/Makefile.in23
-rw-r--r--sim/m32c/local.mk53
-rw-r--r--sim/m68hc11/Makefile.in17
-rw-r--r--sim/m68hc11/local.mk44
-rw-r--r--sim/sh/Makefile.in21
-rw-r--r--sim/sh/local.mk48
12 files changed, 625 insertions, 119 deletions
diff --git a/sim/Makefile.am b/sim/Makefile.am
index 8f53aa8..6fa3b62 100644
--- a/sim/Makefile.am
+++ b/sim/Makefile.am
@@ -67,4 +67,20 @@ include igen/local.mk
endif
include testsuite/local.mk
+if SIM_ENABLE_ARCH_cr16
+include cr16/local.mk
+endif
+if SIM_ENABLE_ARCH_d10v
+include d10v/local.mk
+endif
+if SIM_ENABLE_ARCH_m32c
+include m32c/local.mk
+endif
+if SIM_ENABLE_ARCH_m68hc11
+include m68hc11/local.mk
+endif
+if SIM_ENABLE_ARCH_sh
+include sh/local.mk
+endif
+
all-recursive: $(SIM_ALL_RECURSIVE_DEPS)
diff --git a/sim/Makefile.in b/sim/Makefile.in
index 1cea060..e1f4561 100644
--- a/sim/Makefile.in
+++ b/sim/Makefile.in
@@ -101,6 +101,96 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# See sim/Makefile.am
+#
+# Copyright (C) 2008-2021 Free Software Foundation, Inc.
+# Contributed by M Ranga Swami Reddy <MR.Swami.Reddy@nsc.com>
+#
+# 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/>.
+
+# See sim/Makefile.am
+#
+# Copyright (C) 1996-2021 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/>.
+
+# See sim/Makefile.am
+#
+# Copyright (C) 2005-2021 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/>.
+
+# See sim/Makefile.am
+#
+# Copyright (C) 1999-2021 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/>.
+
+# See sim/Makefile.am
+#
+# Copyright (C) 1990-2021 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/>.
+
VPATH = @srcdir@
am__is_gnu_make = { \
@@ -177,9 +267,11 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
-check_PROGRAMS = $(am__EXEEXT_3)
+check_PROGRAMS = $(am__EXEEXT_8)
EXTRA_PROGRAMS = $(am__EXEEXT_2) testsuite/common/bits-gen$(EXEEXT) \
- testsuite/common/fpu-tst$(EXEEXT)
+ testsuite/common/fpu-tst$(EXEEXT) $(am__EXEEXT_3) \
+ $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \
+ $(am__EXEEXT_7)
# This makes sure igen is available before building the arch-subdirs which
# need to run the igen tool.
@@ -192,6 +284,35 @@ TESTS = testsuite/common/bits32m0$(EXEEXT) \
testsuite/common/bits64m0$(EXEEXT) \
testsuite/common/bits64m63$(EXEEXT) \
testsuite/common/alu-tst$(EXEEXT)
+
+# This makes sure build tools are available before building the arch-subdirs.
+@SIM_ENABLE_ARCH_cr16_TRUE@am__append_5 = $(cr16_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_cr16_TRUE@am__append_6 = cr16/gencode
+@SIM_ENABLE_ARCH_cr16_TRUE@am__append_7 = $(cr16_BUILD_OUTPUTS)
+
+# This makes sure build tools are available before building the arch-subdirs.
+@SIM_ENABLE_ARCH_d10v_TRUE@am__append_8 = $(d10v_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_d10v_TRUE@am__append_9 = d10v/gencode
+@SIM_ENABLE_ARCH_d10v_TRUE@am__append_10 = $(d10v_BUILD_OUTPUTS)
+
+# This makes sure build tools are available before building the arch-subdirs.
+@SIM_ENABLE_ARCH_m32c_TRUE@am__append_11 = $(m32c_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_m32c_TRUE@am__append_12 = m32c/opc2c
+@SIM_ENABLE_ARCH_m32c_TRUE@am__append_13 = \
+@SIM_ENABLE_ARCH_m32c_TRUE@ $(m32c_BUILD_OUTPUTS) \
+@SIM_ENABLE_ARCH_m32c_TRUE@ m32c/m32c.c.log \
+@SIM_ENABLE_ARCH_m32c_TRUE@ m32c/r8c.c.log
+
+
+# This makes sure build tools are available before building the arch-subdirs.
+@SIM_ENABLE_ARCH_m68hc11_TRUE@am__append_14 = $(m68hc11_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_m68hc11_TRUE@am__append_15 = m68hc11/gencode
+@SIM_ENABLE_ARCH_m68hc11_TRUE@am__append_16 = $(m68hc11_BUILD_OUTPUTS)
+
+# This makes sure build tools are available before building the arch-subdirs.
+@SIM_ENABLE_ARCH_sh_TRUE@am__append_17 = $(sh_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_sh_TRUE@am__append_18 = sh/gencode
+@SIM_ENABLE_ARCH_sh_TRUE@am__append_19 = $(sh_BUILD_OUTPUTS)
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
@@ -285,19 +406,34 @@ igen_libigen_a_OBJECTS = $(am_igen_libigen_a_OBJECTS)
@SIM_ENABLE_IGEN_TRUE@ igen/ld-insn$(EXEEXT) \
@SIM_ENABLE_IGEN_TRUE@ igen/table$(EXEEXT)
@SIM_ENABLE_IGEN_TRUE@am__EXEEXT_2 = $(am__EXEEXT_1)
-am__EXEEXT_3 = testsuite/common/bits32m0$(EXEEXT) \
+@SIM_ENABLE_ARCH_cr16_TRUE@am__EXEEXT_3 = cr16/gencode$(EXEEXT)
+@SIM_ENABLE_ARCH_d10v_TRUE@am__EXEEXT_4 = d10v/gencode$(EXEEXT)
+@SIM_ENABLE_ARCH_m32c_TRUE@am__EXEEXT_5 = m32c/opc2c$(EXEEXT)
+@SIM_ENABLE_ARCH_m68hc11_TRUE@am__EXEEXT_6 = m68hc11/gencode$(EXEEXT)
+@SIM_ENABLE_ARCH_sh_TRUE@am__EXEEXT_7 = sh/gencode$(EXEEXT)
+am__EXEEXT_8 = testsuite/common/bits32m0$(EXEEXT) \
testsuite/common/bits32m31$(EXEEXT) \
testsuite/common/bits64m0$(EXEEXT) \
testsuite/common/bits64m63$(EXEEXT) \
testsuite/common/alu-tst$(EXEEXT)
-am_igen_filter_OBJECTS =
-igen_filter_OBJECTS = $(am_igen_filter_OBJECTS)
-@SIM_ENABLE_IGEN_TRUE@igen_filter_DEPENDENCIES = igen/filter-main.o \
-@SIM_ENABLE_IGEN_TRUE@ igen/libigen.a
+@SIM_ENABLE_ARCH_cr16_TRUE@am_cr16_gencode_OBJECTS = \
+@SIM_ENABLE_ARCH_cr16_TRUE@ cr16/gencode.$(OBJEXT)
+cr16_gencode_OBJECTS = $(am_cr16_gencode_OBJECTS)
+@SIM_ENABLE_ARCH_cr16_TRUE@cr16_gencode_DEPENDENCIES = \
+@SIM_ENABLE_ARCH_cr16_TRUE@ cr16/cr16-opc.o
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 =
+@SIM_ENABLE_ARCH_d10v_TRUE@am_d10v_gencode_OBJECTS = \
+@SIM_ENABLE_ARCH_d10v_TRUE@ d10v/gencode.$(OBJEXT)
+d10v_gencode_OBJECTS = $(am_d10v_gencode_OBJECTS)
+@SIM_ENABLE_ARCH_d10v_TRUE@d10v_gencode_DEPENDENCIES = \
+@SIM_ENABLE_ARCH_d10v_TRUE@ d10v/d10v-opc.o
+am_igen_filter_OBJECTS =
+igen_filter_OBJECTS = $(am_igen_filter_OBJECTS)
+@SIM_ENABLE_IGEN_TRUE@igen_filter_DEPENDENCIES = igen/filter-main.o \
+@SIM_ENABLE_IGEN_TRUE@ igen/libigen.a
am_igen_gen_OBJECTS =
igen_gen_OBJECTS = $(am_igen_gen_OBJECTS)
@SIM_ENABLE_IGEN_TRUE@igen_gen_DEPENDENCIES = igen/gen-main.o \
@@ -321,6 +457,17 @@ am_igen_table_OBJECTS =
igen_table_OBJECTS = $(am_igen_table_OBJECTS)
@SIM_ENABLE_IGEN_TRUE@igen_table_DEPENDENCIES = igen/table-main.o \
@SIM_ENABLE_IGEN_TRUE@ igen/libigen.a
+@SIM_ENABLE_ARCH_m32c_TRUE@am_m32c_opc2c_OBJECTS = \
+@SIM_ENABLE_ARCH_m32c_TRUE@ m32c/opc2c.$(OBJEXT)
+m32c_opc2c_OBJECTS = $(am_m32c_opc2c_OBJECTS)
+m32c_opc2c_LDADD = $(LDADD)
+@SIM_ENABLE_ARCH_m68hc11_TRUE@am_m68hc11_gencode_OBJECTS = \
+@SIM_ENABLE_ARCH_m68hc11_TRUE@ m68hc11/gencode.$(OBJEXT)
+m68hc11_gencode_OBJECTS = $(am_m68hc11_gencode_OBJECTS)
+m68hc11_gencode_LDADD = $(LDADD)
+@SIM_ENABLE_ARCH_sh_TRUE@am_sh_gencode_OBJECTS = sh/gencode.$(OBJEXT)
+sh_gencode_OBJECTS = $(am_sh_gencode_OBJECTS)
+sh_gencode_LDADD = $(LDADD)
testsuite_common_alu_tst_SOURCES = testsuite/common/alu-tst.c
testsuite_common_alu_tst_OBJECTS = testsuite/common/alu-tst.$(OBJEXT)
testsuite_common_alu_tst_LDADD = $(LDADD)
@@ -382,13 +529,16 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(common_libcommon_a_SOURCES) $(igen_libigen_a_SOURCES) \
+ $(cr16_gencode_SOURCES) $(d10v_gencode_SOURCES) \
$(igen_filter_SOURCES) $(igen_gen_SOURCES) \
$(igen_igen_SOURCES) $(igen_ld_cache_SOURCES) \
$(igen_ld_decode_SOURCES) $(igen_ld_insn_SOURCES) \
- $(igen_table_SOURCES) testsuite/common/alu-tst.c \
- testsuite/common/bits-gen.c testsuite/common/bits32m0.c \
- testsuite/common/bits32m31.c testsuite/common/bits64m0.c \
- testsuite/common/bits64m63.c testsuite/common/fpu-tst.c
+ $(igen_table_SOURCES) $(m32c_opc2c_SOURCES) \
+ $(m68hc11_gencode_SOURCES) $(sh_gencode_SOURCES) \
+ testsuite/common/alu-tst.c testsuite/common/bits-gen.c \
+ testsuite/common/bits32m0.c testsuite/common/bits32m31.c \
+ testsuite/common/bits64m0.c testsuite/common/bits64m63.c \
+ testsuite/common/fpu-tst.c
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
@@ -822,7 +972,8 @@ CLEANFILES = common/version.c common/version.c-stamp \
testsuite/common/bits64m63.c
DISTCLEANFILES =
MOSTLYCLEANFILES = core $(am__append_4) site-srcdir.exp testrun.log \
- testrun.sum
+ testrun.sum $(am__append_7) $(am__append_10) $(am__append_13) \
+ $(am__append_16) $(am__append_19)
AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS)
AM_CPPFLAGS = -I$(srcroot)/include $(SIM_INLINE) -I$(srcdir)/common
COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(AM_CPPFLAGS) $(CFLAGS_FOR_BUILD)
@@ -833,7 +984,9 @@ LINK_FOR_BUILD = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@
# This makes sure common parts are available before building the arch-subdirs
# which will refer to these.
-SIM_ALL_RECURSIVE_DEPS = common/libcommon.a $(am__append_1)
+SIM_ALL_RECURSIVE_DEPS = common/libcommon.a $(am__append_1) \
+ $(am__append_5) $(am__append_8) $(am__append_11) \
+ $(am__append_14) $(am__append_17)
pkginclude_HEADERS = \
$(srcroot)/include/sim/callback.h \
$(srcroot)/include/sim/sim.h
@@ -902,6 +1055,43 @@ testsuite_common_CPPFLAGS = \
-I$(srcroot)/include \
-I../bfd
+@SIM_ENABLE_ARCH_cr16_TRUE@cr16_BUILD_OUTPUTS = \
+@SIM_ENABLE_ARCH_cr16_TRUE@ cr16/gencode$(EXEEXT) \
+@SIM_ENABLE_ARCH_cr16_TRUE@ cr16/simops.h \
+@SIM_ENABLE_ARCH_cr16_TRUE@ cr16/table.c
+
+@SIM_ENABLE_ARCH_cr16_TRUE@cr16_gencode_SOURCES = cr16/gencode.c
+@SIM_ENABLE_ARCH_cr16_TRUE@cr16_gencode_LDADD = cr16/cr16-opc.o
+@SIM_ENABLE_ARCH_d10v_TRUE@d10v_BUILD_OUTPUTS = \
+@SIM_ENABLE_ARCH_d10v_TRUE@ d10v/gencode$(EXEEXT) \
+@SIM_ENABLE_ARCH_d10v_TRUE@ d10v/simops.h \
+@SIM_ENABLE_ARCH_d10v_TRUE@ d10v/table.c
+
+@SIM_ENABLE_ARCH_d10v_TRUE@d10v_gencode_SOURCES = d10v/gencode.c
+@SIM_ENABLE_ARCH_d10v_TRUE@d10v_gencode_LDADD = d10v/d10v-opc.o
+@SIM_ENABLE_ARCH_m32c_TRUE@m32c_BUILD_OUTPUTS = \
+@SIM_ENABLE_ARCH_m32c_TRUE@ m32c/opc2c$(EXEEXT) \
+@SIM_ENABLE_ARCH_m32c_TRUE@ m32c/m32c.c \
+@SIM_ENABLE_ARCH_m32c_TRUE@ m32c/r8c.c
+
+@SIM_ENABLE_ARCH_m32c_TRUE@m32c_opc2c_SOURCES = m32c/opc2c.c
+
+# opc2c leaks memory, and therefore makes AddressSanitizer unhappy. Disable
+# leak detection while running it.
+@SIM_ENABLE_ARCH_m32c_TRUE@m32c_OPC2C_RUN = ASAN_OPTIONS=detect_leaks=0 m32c/opc2c$(EXEEXT)
+@SIM_ENABLE_ARCH_m68hc11_TRUE@m68hc11_BUILD_OUTPUTS = \
+@SIM_ENABLE_ARCH_m68hc11_TRUE@ m68hc11/gencode$(EXEEXT) \
+@SIM_ENABLE_ARCH_m68hc11_TRUE@ m68hc11/m68hc11int.c \
+@SIM_ENABLE_ARCH_m68hc11_TRUE@ m68hc11/m68hc12int.c
+
+@SIM_ENABLE_ARCH_m68hc11_TRUE@m68hc11_gencode_SOURCES = m68hc11/gencode.c
+@SIM_ENABLE_ARCH_sh_TRUE@sh_BUILD_OUTPUTS = \
+@SIM_ENABLE_ARCH_sh_TRUE@ sh/gencode$(EXEEXT) \
+@SIM_ENABLE_ARCH_sh_TRUE@ sh/code.c \
+@SIM_ENABLE_ARCH_sh_TRUE@ sh/ppi.c \
+@SIM_ENABLE_ARCH_sh_TRUE@ sh/table.c
+
+@SIM_ENABLE_ARCH_sh_TRUE@sh_gencode_SOURCES = sh/gencode.c
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -909,7 +1099,7 @@ all: config.h
.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
am--refresh: Makefile
@:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/common/local.mk $(srcdir)/igen/local.mk $(srcdir)/testsuite/local.mk $(srcdir)/testsuite/common/local.mk $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/common/local.mk $(srcdir)/igen/local.mk $(srcdir)/testsuite/local.mk $(srcdir)/testsuite/common/local.mk $(srcdir)/cr16/local.mk $(srcdir)/d10v/local.mk $(srcdir)/m32c/local.mk $(srcdir)/m68hc11/local.mk $(srcdir)/sh/local.mk $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -931,7 +1121,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
-$(srcdir)/common/local.mk $(srcdir)/igen/local.mk $(srcdir)/testsuite/local.mk $(srcdir)/testsuite/common/local.mk $(am__empty):
+$(srcdir)/common/local.mk $(srcdir)/igen/local.mk $(srcdir)/testsuite/local.mk $(srcdir)/testsuite/common/local.mk $(srcdir)/cr16/local.mk $(srcdir)/d10v/local.mk $(srcdir)/m32c/local.mk $(srcdir)/m68hc11/local.mk $(srcdir)/sh/local.mk $(am__empty):
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
@@ -1089,6 +1279,30 @@ clean-checkPROGRAMS:
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
+cr16/$(am__dirstamp):
+ @$(MKDIR_P) cr16
+ @: > cr16/$(am__dirstamp)
+cr16/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) cr16/$(DEPDIR)
+ @: > cr16/$(DEPDIR)/$(am__dirstamp)
+cr16/gencode.$(OBJEXT): cr16/$(am__dirstamp) \
+ cr16/$(DEPDIR)/$(am__dirstamp)
+
+@SIM_ENABLE_ARCH_cr16_FALSE@cr16/gencode$(EXEEXT): $(cr16_gencode_OBJECTS) $(cr16_gencode_DEPENDENCIES) $(EXTRA_cr16_gencode_DEPENDENCIES) cr16/$(am__dirstamp)
+@SIM_ENABLE_ARCH_cr16_FALSE@ @rm -f cr16/gencode$(EXEEXT)
+@SIM_ENABLE_ARCH_cr16_FALSE@ $(AM_V_CCLD)$(LINK) $(cr16_gencode_OBJECTS) $(cr16_gencode_LDADD) $(LIBS)
+d10v/$(am__dirstamp):
+ @$(MKDIR_P) d10v
+ @: > d10v/$(am__dirstamp)
+d10v/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) d10v/$(DEPDIR)
+ @: > d10v/$(DEPDIR)/$(am__dirstamp)
+d10v/gencode.$(OBJEXT): d10v/$(am__dirstamp) \
+ d10v/$(DEPDIR)/$(am__dirstamp)
+
+@SIM_ENABLE_ARCH_d10v_FALSE@d10v/gencode$(EXEEXT): $(d10v_gencode_OBJECTS) $(d10v_gencode_DEPENDENCIES) $(EXTRA_d10v_gencode_DEPENDENCIES) d10v/$(am__dirstamp)
+@SIM_ENABLE_ARCH_d10v_FALSE@ @rm -f d10v/gencode$(EXEEXT)
+@SIM_ENABLE_ARCH_d10v_FALSE@ $(AM_V_CCLD)$(LINK) $(d10v_gencode_OBJECTS) $(d10v_gencode_LDADD) $(LIBS)
igen/filter$(EXEEXT): $(igen_filter_OBJECTS) $(igen_filter_DEPENDENCIES) $(EXTRA_igen_filter_DEPENDENCIES) igen/$(am__dirstamp)
@rm -f igen/filter$(EXEEXT)
@@ -1119,6 +1333,41 @@ igen/ld-insn$(EXEEXT): $(igen_ld_insn_OBJECTS) $(igen_ld_insn_DEPENDENCIES) $(EX
igen/table$(EXEEXT): $(igen_table_OBJECTS) $(igen_table_DEPENDENCIES) $(EXTRA_igen_table_DEPENDENCIES) igen/$(am__dirstamp)
@rm -f igen/table$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(igen_table_OBJECTS) $(igen_table_LDADD) $(LIBS)
+m32c/$(am__dirstamp):
+ @$(MKDIR_P) m32c
+ @: > m32c/$(am__dirstamp)
+m32c/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) m32c/$(DEPDIR)
+ @: > m32c/$(DEPDIR)/$(am__dirstamp)
+m32c/opc2c.$(OBJEXT): m32c/$(am__dirstamp) \
+ m32c/$(DEPDIR)/$(am__dirstamp)
+
+@SIM_ENABLE_ARCH_m32c_FALSE@m32c/opc2c$(EXEEXT): $(m32c_opc2c_OBJECTS) $(m32c_opc2c_DEPENDENCIES) $(EXTRA_m32c_opc2c_DEPENDENCIES) m32c/$(am__dirstamp)
+@SIM_ENABLE_ARCH_m32c_FALSE@ @rm -f m32c/opc2c$(EXEEXT)
+@SIM_ENABLE_ARCH_m32c_FALSE@ $(AM_V_CCLD)$(LINK) $(m32c_opc2c_OBJECTS) $(m32c_opc2c_LDADD) $(LIBS)
+m68hc11/$(am__dirstamp):
+ @$(MKDIR_P) m68hc11
+ @: > m68hc11/$(am__dirstamp)
+m68hc11/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) m68hc11/$(DEPDIR)
+ @: > m68hc11/$(DEPDIR)/$(am__dirstamp)
+m68hc11/gencode.$(OBJEXT): m68hc11/$(am__dirstamp) \
+ m68hc11/$(DEPDIR)/$(am__dirstamp)
+
+@SIM_ENABLE_ARCH_m68hc11_FALSE@m68hc11/gencode$(EXEEXT): $(m68hc11_gencode_OBJECTS) $(m68hc11_gencode_DEPENDENCIES) $(EXTRA_m68hc11_gencode_DEPENDENCIES) m68hc11/$(am__dirstamp)
+@SIM_ENABLE_ARCH_m68hc11_FALSE@ @rm -f m68hc11/gencode$(EXEEXT)
+@SIM_ENABLE_ARCH_m68hc11_FALSE@ $(AM_V_CCLD)$(LINK) $(m68hc11_gencode_OBJECTS) $(m68hc11_gencode_LDADD) $(LIBS)
+sh/$(am__dirstamp):
+ @$(MKDIR_P) sh
+ @: > sh/$(am__dirstamp)
+sh/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) sh/$(DEPDIR)
+ @: > sh/$(DEPDIR)/$(am__dirstamp)
+sh/gencode.$(OBJEXT): sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp)
+
+@SIM_ENABLE_ARCH_sh_FALSE@sh/gencode$(EXEEXT): $(sh_gencode_OBJECTS) $(sh_gencode_DEPENDENCIES) $(EXTRA_sh_gencode_DEPENDENCIES) sh/$(am__dirstamp)
+@SIM_ENABLE_ARCH_sh_FALSE@ @rm -f sh/gencode$(EXEEXT)
+@SIM_ENABLE_ARCH_sh_FALSE@ $(AM_V_CCLD)$(LINK) $(sh_gencode_OBJECTS) $(sh_gencode_LDADD) $(LIBS)
testsuite/common/$(am__dirstamp):
@$(MKDIR_P) testsuite/common
@: > testsuite/common/$(am__dirstamp)
@@ -1145,7 +1394,12 @@ testsuite/common/fpu-tst.$(OBJEXT): testsuite/common/$(am__dirstamp) \
mostlyclean-compile:
-rm -f *.$(OBJEXT)
-rm -f common/*.$(OBJEXT)
+ -rm -f cr16/*.$(OBJEXT)
+ -rm -f d10v/*.$(OBJEXT)
-rm -f igen/*.$(OBJEXT)
+ -rm -f m32c/*.$(OBJEXT)
+ -rm -f m68hc11/*.$(OBJEXT)
+ -rm -f sh/*.$(OBJEXT)
-rm -f testsuite/common/*.$(OBJEXT)
distclean-compile:
@@ -1158,6 +1412,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/common_libcommon_a-target-newlib-open.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/common_libcommon_a-target-newlib-signal.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/common_libcommon_a-version.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@cr16/$(DEPDIR)/gencode.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@d10v/$(DEPDIR)/gencode.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@igen/$(DEPDIR)/filter.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@igen/$(DEPDIR)/filter_host.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@igen/$(DEPDIR)/gen-engine.Po@am__quote@
@@ -1175,6 +1431,9 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@igen/$(DEPDIR)/lf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@igen/$(DEPDIR)/misc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@igen/$(DEPDIR)/table.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@m32c/$(DEPDIR)/opc2c.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@m68hc11/$(DEPDIR)/gencode.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/gencode.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@testsuite/common/$(DEPDIR)/alu-tst.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@testsuite/common/$(DEPDIR)/bits-gen.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@testsuite/common/$(DEPDIR)/bits32m0.Po@am__quote@
@@ -1310,7 +1569,12 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
+ -rm -rf cr16/.libs cr16/_libs
+ -rm -rf d10v/.libs d10v/_libs
-rm -rf igen/.libs igen/_libs
+ -rm -rf m32c/.libs m32c/_libs
+ -rm -rf m68hc11/.libs m68hc11/_libs
+ -rm -rf sh/.libs sh/_libs
-rm -rf testsuite/common/.libs testsuite/common/_libs
distclean-libtool:
@@ -1708,8 +1972,18 @@ distclean-generic:
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-rm -f common/$(DEPDIR)/$(am__dirstamp)
-rm -f common/$(am__dirstamp)
+ -rm -f cr16/$(DEPDIR)/$(am__dirstamp)
+ -rm -f cr16/$(am__dirstamp)
+ -rm -f d10v/$(DEPDIR)/$(am__dirstamp)
+ -rm -f d10v/$(am__dirstamp)
-rm -f igen/$(DEPDIR)/$(am__dirstamp)
-rm -f igen/$(am__dirstamp)
+ -rm -f m32c/$(DEPDIR)/$(am__dirstamp)
+ -rm -f m32c/$(am__dirstamp)
+ -rm -f m68hc11/$(DEPDIR)/$(am__dirstamp)
+ -rm -f m68hc11/$(am__dirstamp)
+ -rm -f sh/$(DEPDIR)/$(am__dirstamp)
+ -rm -f sh/$(am__dirstamp)
-rm -f testsuite/common/$(DEPDIR)/$(am__dirstamp)
-rm -f testsuite/common/$(am__dirstamp)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
@@ -1724,7 +1998,7 @@ clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf common/$(DEPDIR) igen/$(DEPDIR) testsuite/common/$(DEPDIR)
+ -rm -rf common/$(DEPDIR) cr16/$(DEPDIR) d10v/$(DEPDIR) igen/$(DEPDIR) m32c/$(DEPDIR) m68hc11/$(DEPDIR) sh/$(DEPDIR) testsuite/common/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-DEJAGNU distclean-compile \
distclean-generic distclean-hdr distclean-libtool \
@@ -1773,7 +2047,7 @@ installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf common/$(DEPDIR) igen/$(DEPDIR) testsuite/common/$(DEPDIR)
+ -rm -rf common/$(DEPDIR) cr16/$(DEPDIR) d10v/$(DEPDIR) igen/$(DEPDIR) m32c/$(DEPDIR) m68hc11/$(DEPDIR) sh/$(DEPDIR) testsuite/common/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -1908,6 +2182,85 @@ testsuite/common/bits64m63.c: testsuite/common/bits-gen testsuite/common/bits-ts
$(AM_V_at)cat $(srcdir)/testsuite/common/bits-tst.c >> $@.tmp
$(AM_V_at)mv $@.tmp $@
+# These rules are copied from automake, but tweaked to use FOR_BUILD variables.
+@SIM_ENABLE_ARCH_cr16_TRUE@cr16/gencode$(EXEEXT): $(cr16_gencode_OBJECTS) $(cr16_gencode_DEPENDENCIES) cr16/$(am__dirstamp)
+@SIM_ENABLE_ARCH_cr16_TRUE@ $(AM_V_CCLD)$(LINK_FOR_BUILD) $(cr16_gencode_OBJECTS) $(cr16_gencode_LDADD)
+
+# gencode is a build-time only tool. Override the default rules for it.
+@SIM_ENABLE_ARCH_cr16_TRUE@cr16/gencode.o: cr16/gencode.c
+@SIM_ENABLE_ARCH_cr16_TRUE@ $(AM_V_CC)$(COMPILE_FOR_BUILD) -c $< -o $@
+@SIM_ENABLE_ARCH_cr16_TRUE@cr16/cr16-opc.o: ../opcodes/cr16-opc.c
+@SIM_ENABLE_ARCH_cr16_TRUE@ $(AM_V_CC)$(COMPILE_FOR_BUILD) -c $< -o $@
+
+@SIM_ENABLE_ARCH_cr16_TRUE@cr16/simops.h: cr16/gencode$(EXEEXT)
+@SIM_ENABLE_ARCH_cr16_TRUE@ $(AM_V_GEN)$< -h >$@
+
+@SIM_ENABLE_ARCH_cr16_TRUE@cr16/table.c: cr16/gencode$(EXEEXT)
+@SIM_ENABLE_ARCH_cr16_TRUE@ $(AM_V_GEN)$< >$@
+
+# These rules are copied from automake, but tweaked to use FOR_BUILD variables.
+@SIM_ENABLE_ARCH_d10v_TRUE@d10v/gencode$(EXEEXT): $(d10v_gencode_OBJECTS) $(d10v_gencode_DEPENDENCIES) d10v/$(am__dirstamp)
+@SIM_ENABLE_ARCH_d10v_TRUE@ $(AM_V_CCLD)$(LINK_FOR_BUILD) $(d10v_gencode_OBJECTS) $(d10v_gencode_LDADD)
+
+# gencode is a build-time only tool. Override the default rules for it.
+@SIM_ENABLE_ARCH_d10v_TRUE@d10v/gencode.o: d10v/gencode.c
+@SIM_ENABLE_ARCH_d10v_TRUE@ $(AM_V_CC)$(COMPILE_FOR_BUILD) -c $< -o $@
+@SIM_ENABLE_ARCH_d10v_TRUE@d10v/d10v-opc.o: ../opcodes/d10v-opc.c
+@SIM_ENABLE_ARCH_d10v_TRUE@ $(AM_V_CC)$(COMPILE_FOR_BUILD) -c $< -o $@
+
+@SIM_ENABLE_ARCH_d10v_TRUE@d10v/simops.h: d10v/gencode$(EXEEXT)
+@SIM_ENABLE_ARCH_d10v_TRUE@ $(AM_V_GEN)$< -h >$@
+
+@SIM_ENABLE_ARCH_d10v_TRUE@d10v/table.c: d10v/gencode$(EXEEXT)
+@SIM_ENABLE_ARCH_d10v_TRUE@ $(AM_V_GEN)$< >$@
+
+# These rules are copied from automake, but tweaked to use FOR_BUILD variables.
+@SIM_ENABLE_ARCH_m32c_TRUE@m32c/opc2c$(EXEEXT): $(m32c_opc2c_OBJECTS) $(m32c_opc2c_DEPENDENCIES) m32c/$(am__dirstamp)
+@SIM_ENABLE_ARCH_m32c_TRUE@ $(AM_V_CCLD)$(LINK_FOR_BUILD) $(m32c_opc2c_OBJECTS) $(m32c_opc2c_LDADD)
+
+# opc2c is a build-time only tool. Override the default rules for it.
+@SIM_ENABLE_ARCH_m32c_TRUE@m32c/opc2c.o: m32c/opc2c.c
+@SIM_ENABLE_ARCH_m32c_TRUE@ $(AM_V_CC)$(COMPILE_FOR_BUILD) -c $< -o $@
+
+@SIM_ENABLE_ARCH_m32c_TRUE@m32c/m32c.c: m32c/m32c.opc m32c/opc2c$(EXEEXT)
+@SIM_ENABLE_ARCH_m32c_TRUE@ $(AM_V_GEN)$(m32c_OPC2C_RUN) -l $@.log $< > $@.tmp
+@SIM_ENABLE_ARCH_m32c_TRUE@ $(AM_V_at)mv $@.tmp $@
+
+@SIM_ENABLE_ARCH_m32c_TRUE@m32c/r8c.c: m32c/r8c.opc m32c/opc2c$(EXEEXT)
+@SIM_ENABLE_ARCH_m32c_TRUE@ $(AM_V_GEN)$(m32c_OPC2C_RUN) -l $@.log $< > $@.tmp
+@SIM_ENABLE_ARCH_m32c_TRUE@ $(AM_V_at)mv $@.tmp $@
+
+# These rules are copied from automake, but tweaked to use FOR_BUILD variables.
+@SIM_ENABLE_ARCH_m68hc11_TRUE@m68hc11/gencode$(EXEEXT): $(m68hc11_gencode_OBJECTS) $(m68hc11_gencode_DEPENDENCIES) m68hc11/$(am__dirstamp)
+@SIM_ENABLE_ARCH_m68hc11_TRUE@ $(AM_V_CCLD)$(LINK_FOR_BUILD) $(m68hc11_gencode_OBJECTS) $(m68hc11_gencode_LDADD)
+
+# gencode is a build-time only tool. Override the default rules for it.
+@SIM_ENABLE_ARCH_m68hc11_TRUE@m68hc11/gencode.o: m68hc11/gencode.c
+@SIM_ENABLE_ARCH_m68hc11_TRUE@ $(AM_V_CC)$(COMPILE_FOR_BUILD) -c $< -o $@
+
+@SIM_ENABLE_ARCH_m68hc11_TRUE@m68hc11/m68hc11int.c: m68hc11/gencode$(EXEEXT)
+@SIM_ENABLE_ARCH_m68hc11_TRUE@ $(AM_V_GEN)$< -m6811 >$@
+
+@SIM_ENABLE_ARCH_m68hc11_TRUE@m68hc11/m68hc12int.c: m68hc11/gencode$(EXEEXT)
+@SIM_ENABLE_ARCH_m68hc11_TRUE@ $(AM_V_GEN)$< -m6812 >$@
+
+# These rules are copied from automake, but tweaked to use FOR_BUILD variables.
+@SIM_ENABLE_ARCH_sh_TRUE@sh/gencode$(EXEEXT): $(sh_gencode_OBJECTS) $(sh_gencode_DEPENDENCIES) sh/$(am__dirstamp)
+@SIM_ENABLE_ARCH_sh_TRUE@ $(AM_V_CCLD)$(LINK_FOR_BUILD) $(sh_gencode_OBJECTS) $(sh_gencode_LDADD)
+
+# gencode is a build-time only tool. Override the default rules for it.
+@SIM_ENABLE_ARCH_sh_TRUE@sh/gencode.o: sh/gencode.c
+@SIM_ENABLE_ARCH_sh_TRUE@ $(AM_V_CC)$(COMPILE_FOR_BUILD) -c $< -o $@
+
+@SIM_ENABLE_ARCH_sh_TRUE@sh/code.c: sh/gencode$(EXEEXT)
+@SIM_ENABLE_ARCH_sh_TRUE@ $(AM_V_GEN)$< -x >$@
+
+@SIM_ENABLE_ARCH_sh_TRUE@sh/ppi.c: sh/gencode$(EXEEXT)
+@SIM_ENABLE_ARCH_sh_TRUE@ $(AM_V_GEN)$< -p >$@
+
+@SIM_ENABLE_ARCH_sh_TRUE@sh/table.c: sh/gencode$(EXEEXT)
+@SIM_ENABLE_ARCH_sh_TRUE@ $(AM_V_GEN)$< -s >$@
+
all-recursive: $(SIM_ALL_RECURSIVE_DEPS)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/sim/cr16/Makefile.in b/sim/cr16/Makefile.in
index 99b2bec..4d7345a 100644
--- a/sim/cr16/Makefile.in
+++ b/sim/cr16/Makefile.in
@@ -23,32 +23,10 @@ SIM_OBJS = \
interp.o \
table.o \
simops.o
-SIM_EXTRA_CLEAN = clean-extra
SIM_EXTRA_DEPS = simops.h
-INCLUDE = cr16_sim.h $(srcroot)/include/sim/callback.h targ-vals.h \
- $(srcroot)/include/gdb/sim-cr16.h
-
# This selects the cr16 newlib/libgloss syscall definitions.
NL_TARGET = -DNL_TARGET_cr16
## COMMON_POST_CONFIG_FRAG
-
-simops.h: gencode
- $(ECHO_GEN) ./gencode -h >$@
-
-table.c: gencode simops.h
- $(ECHO_GEN) ./gencode >$@
-
-gencode.o: gencode.c $(INCLUDE)
- $(ECHO_CC) $(COMPILE_FOR_BUILD) $(WARN_CFLAGS) -c $(srcdir)/gencode.c
-
-cr16-opc.o: $(srcdir)/../../opcodes/cr16-opc.c
- $(ECHO_CC) $(COMPILE_FOR_BUILD) $(WARN_CFLAGS) -c $(srcdir)/../../opcodes/cr16-opc.c
-
-gencode: gencode.o cr16-opc.o
- $(ECHO_CCLD) $(LINK_FOR_BUILD) gencode.o cr16-opc.o
-
-clean-extra:
- rm -f table.c simops.h gencode
diff --git a/sim/cr16/local.mk b/sim/cr16/local.mk
new file mode 100644
index 0000000..77866c2
--- /dev/null
+++ b/sim/cr16/local.mk
@@ -0,0 +1,47 @@
+# See sim/Makefile.am
+#
+# Copyright (C) 2008-2021 Free Software Foundation, Inc.
+# Contributed by M Ranga Swami Reddy <MR.Swami.Reddy@nsc.com>
+#
+# 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%_BUILD_OUTPUTS = \
+ %D%/gencode$(EXEEXT) \
+ %D%/simops.h \
+ %D%/table.c
+
+# This makes sure build tools are available before building the arch-subdirs.
+SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+
+%C%_gencode_SOURCES = %D%/gencode.c
+%C%_gencode_LDADD = %D%/cr16-opc.o
+
+# These rules are copied from automake, but tweaked to use FOR_BUILD variables.
+%D%/gencode$(EXEEXT): $(%C%_gencode_OBJECTS) $(%C%_gencode_DEPENDENCIES) %D%/$(am__dirstamp)
+ $(AM_V_CCLD)$(LINK_FOR_BUILD) $(%C%_gencode_OBJECTS) $(%C%_gencode_LDADD)
+
+# gencode is a build-time only tool. Override the default rules for it.
+%D%/gencode.o: %D%/gencode.c
+ $(AM_V_CC)$(COMPILE_FOR_BUILD) -c $< -o $@
+%D%/cr16-opc.o: ../opcodes/cr16-opc.c
+ $(AM_V_CC)$(COMPILE_FOR_BUILD) -c $< -o $@
+
+%D%/simops.h: %D%/gencode$(EXEEXT)
+ $(AM_V_GEN)$< -h >$@
+
+%D%/table.c: %D%/gencode$(EXEEXT)
+ $(AM_V_GEN)$< >$@
+
+EXTRA_PROGRAMS += %D%/gencode
+MOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS)
diff --git a/sim/d10v/Makefile.in b/sim/d10v/Makefile.in
index 4f8759b..51fb9eb 100644
--- a/sim/d10v/Makefile.in
+++ b/sim/d10v/Makefile.in
@@ -24,7 +24,6 @@ SIM_OBJS = \
table.o \
simops.o \
endian.o
-SIM_EXTRA_CLEAN = clean-extra
SIM_EXTRA_DEPS = simops.h
@@ -35,21 +34,3 @@ INCLUDE = d10v_sim.h $(srcroot)/include/sim/callback.h targ-vals.h endian.c \
NL_TARGET = -DNL_TARGET_d10v
## COMMON_POST_CONFIG_FRAG
-
-simops.h: gencode
- $(ECHO_GEN) ./gencode -h >$@
-
-table.c: gencode simops.h
- $(ECHO_GEN) ./gencode >$@
-
-gencode.o: gencode.c $(INCLUDE)
- $(ECHO_CC) $(COMPILE_FOR_BUILD) $(WARN_CFLAGS) -c $(srcdir)/gencode.c
-
-d10v-opc.o: $(srcdir)/../../opcodes/d10v-opc.c
- $(ECHO_CC) $(COMPILE_FOR_BUILD) $(WARN_CFLAGS) -c $(srcdir)/../../opcodes/d10v-opc.c
-
-gencode: gencode.o d10v-opc.o
- $(ECHO_CCLD) $(LINK_FOR_BUILD) gencode.o d10v-opc.o
-
-clean-extra:
- rm -f table.c simops.h gencode
diff --git a/sim/d10v/local.mk b/sim/d10v/local.mk
new file mode 100644
index 0000000..1f19eab
--- /dev/null
+++ b/sim/d10v/local.mk
@@ -0,0 +1,47 @@
+# See sim/Makefile.am
+#
+# Copyright (C) 1996-2021 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%_BUILD_OUTPUTS = \
+ %D%/gencode$(EXEEXT) \
+ %D%/simops.h \
+ %D%/table.c
+
+# This makes sure build tools are available before building the arch-subdirs.
+SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+
+%C%_gencode_SOURCES = %D%/gencode.c
+%C%_gencode_LDADD = %D%/d10v-opc.o
+
+# These rules are copied from automake, but tweaked to use FOR_BUILD variables.
+%D%/gencode$(EXEEXT): $(%C%_gencode_OBJECTS) $(%C%_gencode_DEPENDENCIES) %D%/$(am__dirstamp)
+ $(AM_V_CCLD)$(LINK_FOR_BUILD) $(%C%_gencode_OBJECTS) $(%C%_gencode_LDADD)
+
+# gencode is a build-time only tool. Override the default rules for it.
+%D%/gencode.o: %D%/gencode.c
+ $(AM_V_CC)$(COMPILE_FOR_BUILD) -c $< -o $@
+%D%/d10v-opc.o: ../opcodes/d10v-opc.c
+ $(AM_V_CC)$(COMPILE_FOR_BUILD) -c $< -o $@
+
+%D%/simops.h: %D%/gencode$(EXEEXT)
+ $(AM_V_GEN)$< -h >$@
+
+%D%/table.c: %D%/gencode$(EXEEXT)
+ $(AM_V_GEN)$< >$@
+
+EXTRA_PROGRAMS += %D%/gencode
+MOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS)
diff --git a/sim/m32c/Makefile.in b/sim/m32c/Makefile.in
index cfdadd0..c5b1495 100644
--- a/sim/m32c/Makefile.in
+++ b/sim/m32c/Makefile.in
@@ -41,26 +41,3 @@ SIM_OBJS = \
$(ENDLIST)
## COMMON_POST_CONFIG_FRAG
-
-arch = m32c
-
-# opc2c leaks memory, and therefore makes AddressSanitizer unhappy. Disable
-# leak detection while running it.
-OPC2C = ASAN_OPTIONS=detect_leaks=0 ./opc2c
-
-r8c.c : r8c.opc opc2c
- $(ECHO_GEN) $(OPC2C) -l r8c.out $(srcdir)/r8c.opc > r8c.c.tmp
- $(SILENCE) mv r8c.c.tmp r8c.c
-
-m32c.c : m32c.opc opc2c
- $(ECHO_GEN) $(OPC2C) -l m32c.out $(srcdir)/m32c.opc > m32c.c.tmp
- $(SILENCE) mv m32c.c.tmp m32c.c
-
-opc2c : opc2c.o
- $(ECHO_CCLD) $(LINK_FOR_BUILD) $^
-
-encodings:
- grep '/\* [01]' $(srcdir)/r8c.opc | sort
-
-opc2c.o : opc2c.c
- $(ECHO_CC) $(COMPILE_FOR_BUILD) -c $(srcdir)/opc2c.c
diff --git a/sim/m32c/local.mk b/sim/m32c/local.mk
new file mode 100644
index 0000000..f1e86e6
--- /dev/null
+++ b/sim/m32c/local.mk
@@ -0,0 +1,53 @@
+# See sim/Makefile.am
+#
+# Copyright (C) 2005-2021 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%_BUILD_OUTPUTS = \
+ %D%/opc2c$(EXEEXT) \
+ %D%/m32c.c \
+ %D%/r8c.c
+
+# This makes sure build tools are available before building the arch-subdirs.
+SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+
+%C%_opc2c_SOURCES = %D%/opc2c.c
+
+# These rules are copied from automake, but tweaked to use FOR_BUILD variables.
+%D%/opc2c$(EXEEXT): $(%C%_opc2c_OBJECTS) $(%C%_opc2c_DEPENDENCIES) %D%/$(am__dirstamp)
+ $(AM_V_CCLD)$(LINK_FOR_BUILD) $(%C%_opc2c_OBJECTS) $(%C%_opc2c_LDADD)
+
+# opc2c is a build-time only tool. Override the default rules for it.
+%D%/opc2c.o: %D%/opc2c.c
+ $(AM_V_CC)$(COMPILE_FOR_BUILD) -c $< -o $@
+
+# opc2c leaks memory, and therefore makes AddressSanitizer unhappy. Disable
+# leak detection while running it.
+%C%_OPC2C_RUN = ASAN_OPTIONS=detect_leaks=0 %D%/opc2c$(EXEEXT)
+
+%D%/m32c.c: %D%/m32c.opc %D%/opc2c$(EXEEXT)
+ $(AM_V_GEN)$(%C%_OPC2C_RUN) -l $@.log $< > $@.tmp
+ $(AM_V_at)mv $@.tmp $@
+
+%D%/r8c.c: %D%/r8c.opc %D%/opc2c$(EXEEXT)
+ $(AM_V_GEN)$(%C%_OPC2C_RUN) -l $@.log $< > $@.tmp
+ $(AM_V_at)mv $@.tmp $@
+
+EXTRA_PROGRAMS += %D%/opc2c
+MOSTLYCLEANFILES += \
+ $(%C%_BUILD_OUTPUTS) \
+ %D%/m32c.c.log \
+ %D%/r8c.c.log
diff --git a/sim/m68hc11/Makefile.in b/sim/m68hc11/Makefile.in
index f906a7c..0b2c4f1 100644
--- a/sim/m68hc11/Makefile.in
+++ b/sim/m68hc11/Makefile.in
@@ -36,22 +36,5 @@ SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=32 \
-DWITH_TARGET_CELL_BITSIZE=32 \
-DWITH_TARGET_ADDRESS_BITSIZE=32 \
-DWITH_TARGET_WORD_MSB=31
-SIM_EXTRA_CLEAN = clean-extra
-
## COMMON_POST_CONFIG_FRAG
-
-m68hc11int.c: gencode
- $(ECHO_GEN) ./gencode -m6811 > $@
-
-m68hc12int.c: gencode
- $(ECHO_GEN) ./gencode -m6812 > $@
-
-gencode.o: gencode.c
- $(ECHO_CC) $(COMPILE_FOR_BUILD) -c $< -o $@
-
-gencode: gencode.o
- $(ECHO_CCLD) $(LINK_FOR_BUILD) $^
-
-clean-extra:
- rm -f gencode m68hc11int.c
diff --git a/sim/m68hc11/local.mk b/sim/m68hc11/local.mk
new file mode 100644
index 0000000..7596e14
--- /dev/null
+++ b/sim/m68hc11/local.mk
@@ -0,0 +1,44 @@
+# See sim/Makefile.am
+#
+# Copyright (C) 1999-2021 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%_BUILD_OUTPUTS = \
+ %D%/gencode$(EXEEXT) \
+ %D%/m68hc11int.c \
+ %D%/m68hc12int.c
+
+# This makes sure build tools are available before building the arch-subdirs.
+SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+
+%C%_gencode_SOURCES = %D%/gencode.c
+
+# These rules are copied from automake, but tweaked to use FOR_BUILD variables.
+%D%/gencode$(EXEEXT): $(%C%_gencode_OBJECTS) $(%C%_gencode_DEPENDENCIES) %D%/$(am__dirstamp)
+ $(AM_V_CCLD)$(LINK_FOR_BUILD) $(%C%_gencode_OBJECTS) $(%C%_gencode_LDADD)
+
+# gencode is a build-time only tool. Override the default rules for it.
+%D%/gencode.o: %D%/gencode.c
+ $(AM_V_CC)$(COMPILE_FOR_BUILD) -c $< -o $@
+
+%D%/m68hc11int.c: %D%/gencode$(EXEEXT)
+ $(AM_V_GEN)$< -m6811 >$@
+
+%D%/m68hc12int.c: %D%/gencode$(EXEEXT)
+ $(AM_V_GEN)$< -m6812 >$@
+
+EXTRA_PROGRAMS += %D%/gencode
+MOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS)
diff --git a/sim/sh/Makefile.in b/sim/sh/Makefile.in
index e79efd1..4c5b9ad 100644
--- a/sim/sh/Makefile.in
+++ b/sim/sh/Makefile.in
@@ -25,30 +25,9 @@ SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
table.o
SIM_EXTRA_LIBS = -lm
-SIM_EXTRA_CLEAN = sh-clean
SIM_EXTRA_DEPS = table.c code.c ppi.c
# Some modules don't build cleanly yet.
interp.o: SIM_WERROR_CFLAGS =
## COMMON_POST_CONFIG_FRAG
-
-code.c: gencode
- $(ECHO_GEN) ./gencode -x >code.c
-# indent code.c
-
-table.c: gencode
- $(ECHO_GEN) ./gencode -s >table.c
-# indent table.c
-
-ppi.c: gencode
- $(ECHO_GEN) ./gencode -p >ppi.c
-
-gencode.o: gencode.c
- $(ECHO_CC) $(COMPILE_FOR_BUILD) -c $< -o $@
-
-gencode: gencode.o
- $(ECHO_CCLD) $(LINK_FOR_BUILD) $^
-
-sh-clean:
- rm -f gencode code.c table.c
diff --git a/sim/sh/local.mk b/sim/sh/local.mk
new file mode 100644
index 0000000..583899c
--- /dev/null
+++ b/sim/sh/local.mk
@@ -0,0 +1,48 @@
+# See sim/Makefile.am
+#
+# Copyright (C) 1990-2021 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%_BUILD_OUTPUTS = \
+ %D%/gencode$(EXEEXT) \
+ %D%/code.c \
+ %D%/ppi.c \
+ %D%/table.c
+
+# This makes sure build tools are available before building the arch-subdirs.
+SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+
+%C%_gencode_SOURCES = %D%/gencode.c
+
+# These rules are copied from automake, but tweaked to use FOR_BUILD variables.
+%D%/gencode$(EXEEXT): $(%C%_gencode_OBJECTS) $(%C%_gencode_DEPENDENCIES) %D%/$(am__dirstamp)
+ $(AM_V_CCLD)$(LINK_FOR_BUILD) $(%C%_gencode_OBJECTS) $(%C%_gencode_LDADD)
+
+# gencode is a build-time only tool. Override the default rules for it.
+%D%/gencode.o: %D%/gencode.c
+ $(AM_V_CC)$(COMPILE_FOR_BUILD) -c $< -o $@
+
+%D%/code.c: %D%/gencode$(EXEEXT)
+ $(AM_V_GEN)$< -x >$@
+
+%D%/ppi.c: %D%/gencode$(EXEEXT)
+ $(AM_V_GEN)$< -p >$@
+
+%D%/table.c: %D%/gencode$(EXEEXT)
+ $(AM_V_GEN)$< -s >$@
+
+EXTRA_PROGRAMS += %D%/gencode
+MOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS)