]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: hoist cgen mloop rules up to common builds
authorMike Frysinger <vapier@gentoo.org>
Sun, 31 Oct 2021 07:29:36 +0000 (03:29 -0400)
committerMike Frysinger <vapier@gentoo.org>
Wed, 3 Nov 2021 02:59:07 +0000 (22:59 -0400)
These rules don't depend on the target compiler settings, so hoist
the build logic up to the common builds for better parallelization.

We have to extend the genmloop.sh logic a bit to allow outputting
to a subdir since it always assumed cwd was the right place.

We leave the cgen maintainer rules in the subdirs for now as they
aren't normally run, and they rely on cgen logic that has not yet
been generalized.

17 files changed:
sim/Makefile.am
sim/Makefile.in
sim/bpf/Makefile.in
sim/bpf/local.mk [new file with mode: 0644]
sim/common/genmloop.sh
sim/cris/Makefile.in
sim/cris/local.mk [new file with mode: 0644]
sim/frv/Makefile.in
sim/frv/local.mk [new file with mode: 0644]
sim/iq2000/Makefile.in
sim/iq2000/local.mk [new file with mode: 0644]
sim/lm32/Makefile.in
sim/lm32/local.mk [new file with mode: 0644]
sim/m32r/Makefile.in
sim/m32r/local.mk [new file with mode: 0644]
sim/or1k/Makefile.in
sim/or1k/local.mk [new file with mode: 0644]

index c04f94817e4fabe5eff5b72c1959ea29f899f131..fd4b768774342695fca6360d34a88f7b1256c864 100644 (file)
@@ -18,6 +18,7 @@
 AUTOMAKE_OPTIONS = dejagnu foreign no-dist subdir-objects
 ACLOCAL_AMFLAGS = -Im4 -I.. -I../config
 
+srccom = $(srcdir)/common
 srcroot = $(srcdir)/..
 
 SUBDIRS = @subdirs@ $(SIM_SUBDIRS)
@@ -55,7 +56,7 @@ SIM_ALL_RECURSIVE_DEPS =
 # An alternative is to slurp in the tables at runtime.
 .PHONY: nltvals
 nltvals:
-       $(srcdir)/common/gennltvals.py --cpp "$(CPP)"
+       $(srccom)/gennltvals.py --cpp "$(CPP)"
 
 pkginclude_HEADERS = \
        $(srcroot)/include/sim/callback.h \
@@ -67,21 +68,42 @@ include igen/local.mk
 endif
 include testsuite/local.mk
 
+if SIM_ENABLE_ARCH_bpf
+include bpf/local.mk
+endif
 if SIM_ENABLE_ARCH_cr16
 include cr16/local.mk
 endif
+if SIM_ENABLE_ARCH_cris
+include cris/local.mk
+endif
 if SIM_ENABLE_ARCH_d10v
 include d10v/local.mk
 endif
+if SIM_ENABLE_ARCH_frv
+include frv/local.mk
+endif
+if SIM_ENABLE_ARCH_iq2000
+include iq2000/local.mk
+endif
+if SIM_ENABLE_ARCH_lm32
+include lm32/local.mk
+endif
 if SIM_ENABLE_ARCH_m32c
 include m32c/local.mk
 endif
+if SIM_ENABLE_ARCH_m32r
+include m32r/local.mk
+endif
 if SIM_ENABLE_ARCH_m68hc11
 include m68hc11/local.mk
 endif
 if SIM_ENABLE_ARCH_mn10300
 include mn10300/local.mk
 endif
+if SIM_ENABLE_ARCH_or1k
+include or1k/local.mk
+endif
 if SIM_ENABLE_ARCH_sh
 include sh/local.mk
 endif
index 1812f1508f9c549f319824b28f1651e1e26d6957..07c89377e97425ca19703e4206a4efa43ce41399 100644 (file)
 # 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) 2020-2021 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/>.
+
 # See sim/Makefile.am
 #
 # Copyright (C) 2008-2021 Free Software Foundation, Inc.
 # 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) 2004-2021 Free Software Foundation, Inc.
+# Contributed by Axis Communications.
+#
+# 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.
 # 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) 1998-2021 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/>.
+
+# See sim/Makefile.am
+#
+# Copyright (C) 1998-2021 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/>.
+
+# See sim/Makefile.am
+#
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
+# Contributed by Jon Beniston <jon@beniston.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) 2005-2021 Free Software Foundation, Inc.
 # 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.
+# Contributed 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) 1999-2021 Free Software Foundation, Inc.
 # 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) 2017-2021 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/>.
+
 # See sim/Makefile.am
 #
 # Copyright (C) 1990-2021 Free Software Foundation, Inc.
@@ -322,41 +446,69 @@ TESTS = testsuite/common/bits32m0$(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_bpf_TRUE@am__append_5 = $(bpf_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_bpf_TRUE@am__append_6 = $(bpf_BUILD_OUTPUTS)
+
+# This makes sure build tools are available before building the arch-subdirs.
 @SIM_ENABLE_ARCH_cr16_TRUE@am__append_7 = $(cr16_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_cr16_TRUE@am__append_8 = cr16/gencode
+@SIM_ENABLE_ARCH_cr16_TRUE@am__append_9 = $(cr16_BUILD_OUTPUTS)
+
+# This makes sure build tools are available before building the arch-subdirs.
+@SIM_ENABLE_ARCH_cris_TRUE@am__append_10 = $(cris_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_cris_TRUE@am__append_11 = $(cris_BUILD_OUTPUTS)
+
+# This makes sure build tools are available before building the arch-subdirs.
+@SIM_ENABLE_ARCH_d10v_TRUE@am__append_12 = $(d10v_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_d10v_TRUE@am__append_13 = d10v/gencode
+@SIM_ENABLE_ARCH_d10v_TRUE@am__append_14 = $(d10v_BUILD_OUTPUTS)
+
+# This makes sure build tools are available before building the arch-subdirs.
+@SIM_ENABLE_ARCH_frv_TRUE@am__append_15 = $(frv_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_frv_TRUE@am__append_16 = $(frv_BUILD_OUTPUTS)
+
+# This makes sure build tools are available before building the arch-subdirs.
+@SIM_ENABLE_ARCH_iq2000_TRUE@am__append_17 = $(iq2000_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_iq2000_TRUE@am__append_18 = $(iq2000_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)
+@SIM_ENABLE_ARCH_lm32_TRUE@am__append_19 = $(lm32_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_lm32_TRUE@am__append_20 = $(lm32_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@am__append_21 = $(m32c_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_m32c_TRUE@am__append_22 = m32c/opc2c
+@SIM_ENABLE_ARCH_m32c_TRUE@am__append_23 = \
 @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)
+@SIM_ENABLE_ARCH_m32r_TRUE@am__append_24 = $(m32r_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_m32r_TRUE@am__append_25 = $(m32r_BUILD_OUTPUTS)
+
+# This makes sure build tools are available before building the arch-subdirs.
+@SIM_ENABLE_ARCH_m68hc11_TRUE@am__append_26 = $(m68hc11_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_m68hc11_TRUE@am__append_27 = m68hc11/gencode
+@SIM_ENABLE_ARCH_m68hc11_TRUE@am__append_28 = $(m68hc11_BUILD_OUTPUTS)
+
+# This makes sure build tools are available before building the arch-subdirs.
+@SIM_ENABLE_ARCH_mn10300_TRUE@am__append_29 = $(mn10300_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_mn10300_TRUE@am__append_30 = $(mn10300_BUILD_OUTPUTS)
 
 # This makes sure build tools are available before building the arch-subdirs.
-@SIM_ENABLE_ARCH_mn10300_TRUE@am__append_17 = $(mn10300_BUILD_OUTPUTS)
-@SIM_ENABLE_ARCH_mn10300_TRUE@am__append_18 = $(mn10300_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_or1k_TRUE@am__append_31 = $(or1k_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_or1k_TRUE@am__append_32 = $(or1k_BUILD_OUTPUTS)
 
 # This makes sure build tools are available before building the arch-subdirs.
-@SIM_ENABLE_ARCH_sh_TRUE@am__append_19 = $(sh_BUILD_OUTPUTS)
-@SIM_ENABLE_ARCH_sh_TRUE@am__append_20 = sh/gencode
-@SIM_ENABLE_ARCH_sh_TRUE@am__append_21 = $(sh_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_sh_TRUE@am__append_33 = $(sh_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_sh_TRUE@am__append_34 = sh/gencode
+@SIM_ENABLE_ARCH_sh_TRUE@am__append_35 = $(sh_BUILD_OUTPUTS)
 
 # This makes sure build tools are available before building the arch-subdirs.
-@SIM_ENABLE_ARCH_v850_TRUE@am__append_22 = $(v850_BUILD_OUTPUTS)
-@SIM_ENABLE_ARCH_v850_TRUE@am__append_23 = $(v850_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_v850_TRUE@am__append_36 = $(v850_BUILD_OUTPUTS)
+@SIM_ENABLE_ARCH_v850_TRUE@am__append_37 = $(v850_BUILD_OUTPUTS)
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
@@ -1002,6 +1154,7 @@ zlibdir = @zlibdir@
 zlibinc = @zlibinc@
 AUTOMAKE_OPTIONS = dejagnu foreign no-dist subdir-objects
 ACLOCAL_AMFLAGS = -Im4 -I.. -I../config
+srccom = $(srcdir)/common
 srcroot = $(srcdir)/..
 SUBDIRS = @subdirs@ $(SIM_SUBDIRS)
 AM_MAKEFLAGS = SIM_PRIMARY_TARGET=$(SIM_PRIMARY_TARGET)
@@ -1015,9 +1168,11 @@ 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 $(am__append_7) $(am__append_10) $(am__append_13) \
-       $(am__append_16) $(am__append_18) $(am__append_21) \
-       $(am__append_23)
+       testrun.sum $(am__append_6) $(am__append_9) $(am__append_11) \
+       $(am__append_14) $(am__append_16) $(am__append_18) \
+       $(am__append_20) $(am__append_23) $(am__append_25) \
+       $(am__append_28) $(am__append_30) $(am__append_32) \
+       $(am__append_35) $(am__append_37)
 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)
@@ -1029,9 +1184,11 @@ 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) \
-       $(am__append_5) $(am__append_8) $(am__append_11) \
-       $(am__append_14) $(am__append_17) $(am__append_19) \
-       $(am__append_22)
+       $(am__append_5) $(am__append_7) $(am__append_10) \
+       $(am__append_12) $(am__append_15) $(am__append_17) \
+       $(am__append_19) $(am__append_21) $(am__append_24) \
+       $(am__append_26) $(am__append_29) $(am__append_31) \
+       $(am__append_33) $(am__append_36)
 pkginclude_HEADERS = \
        $(srcroot)/include/sim/callback.h \
        $(srcroot)/include/sim/sim.h
@@ -1105,6 +1262,14 @@ testsuite_common_CPPFLAGS = \
        -I$(srcroot)/include \
        -I../bfd
 
+@SIM_ENABLE_ARCH_bpf_TRUE@bpf_BUILD_OUTPUTS = \
+@SIM_ENABLE_ARCH_bpf_TRUE@     bpf/eng-le.h \
+@SIM_ENABLE_ARCH_bpf_TRUE@     bpf/mloop-le.c \
+@SIM_ENABLE_ARCH_bpf_TRUE@     bpf/stamp-mloop-le \
+@SIM_ENABLE_ARCH_bpf_TRUE@     bpf/eng-be.h \
+@SIM_ENABLE_ARCH_bpf_TRUE@     bpf/mloop-be.c \
+@SIM_ENABLE_ARCH_bpf_TRUE@     bpf/stamp-mloop-be
+
 @SIM_ENABLE_ARCH_cr16_TRUE@cr16_BUILD_OUTPUTS = \
 @SIM_ENABLE_ARCH_cr16_TRUE@    cr16/gencode$(EXEEXT) \
 @SIM_ENABLE_ARCH_cr16_TRUE@    cr16/simops.h \
@@ -1112,6 +1277,14 @@ testsuite_common_CPPFLAGS = \
 
 @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_cris_TRUE@cris_BUILD_OUTPUTS = \
+@SIM_ENABLE_ARCH_cris_TRUE@    cris/engv10.h \
+@SIM_ENABLE_ARCH_cris_TRUE@    cris/mloopv10f.c \
+@SIM_ENABLE_ARCH_cris_TRUE@    cris/stamp-mloop-v10f \
+@SIM_ENABLE_ARCH_cris_TRUE@    cris/engv32.h \
+@SIM_ENABLE_ARCH_cris_TRUE@    cris/mloopv32f.c \
+@SIM_ENABLE_ARCH_cris_TRUE@    cris/stamp-mloop-v32f
+
 @SIM_ENABLE_ARCH_d10v_TRUE@d10v_BUILD_OUTPUTS = \
 @SIM_ENABLE_ARCH_d10v_TRUE@    d10v/gencode$(EXEEXT) \
 @SIM_ENABLE_ARCH_d10v_TRUE@    d10v/simops.h \
@@ -1119,6 +1292,21 @@ testsuite_common_CPPFLAGS = \
 
 @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_frv_TRUE@frv_BUILD_OUTPUTS = \
+@SIM_ENABLE_ARCH_frv_TRUE@     frv/eng.h \
+@SIM_ENABLE_ARCH_frv_TRUE@     frv/mloop.c \
+@SIM_ENABLE_ARCH_frv_TRUE@     frv/stamp-mloop
+
+@SIM_ENABLE_ARCH_iq2000_TRUE@iq2000_BUILD_OUTPUTS = \
+@SIM_ENABLE_ARCH_iq2000_TRUE@  iq2000/eng.h \
+@SIM_ENABLE_ARCH_iq2000_TRUE@  iq2000/mloop.c \
+@SIM_ENABLE_ARCH_iq2000_TRUE@  iq2000/stamp-mloop
+
+@SIM_ENABLE_ARCH_lm32_TRUE@lm32_BUILD_OUTPUTS = \
+@SIM_ENABLE_ARCH_lm32_TRUE@    lm32/eng.h \
+@SIM_ENABLE_ARCH_lm32_TRUE@    lm32/mloop.c \
+@SIM_ENABLE_ARCH_lm32_TRUE@    lm32/stamp-mloop
+
 @SIM_ENABLE_ARCH_m32c_TRUE@m32c_BUILD_OUTPUTS = \
 @SIM_ENABLE_ARCH_m32c_TRUE@    m32c/opc2c$(EXEEXT) \
 @SIM_ENABLE_ARCH_m32c_TRUE@    m32c/m32c.c \
@@ -1129,6 +1317,17 @@ testsuite_common_CPPFLAGS = \
 # 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_m32r_TRUE@m32r_BUILD_OUTPUTS = \
+@SIM_ENABLE_ARCH_m32r_TRUE@    m32r/eng.h \
+@SIM_ENABLE_ARCH_m32r_TRUE@    m32r/mloop.c \
+@SIM_ENABLE_ARCH_m32r_TRUE@    m32r/stamp-mloop \
+@SIM_ENABLE_ARCH_m32r_TRUE@    m32r/engx.h \
+@SIM_ENABLE_ARCH_m32r_TRUE@    m32r/mloopx.c \
+@SIM_ENABLE_ARCH_m32r_TRUE@    m32r/stamp-mloop-x \
+@SIM_ENABLE_ARCH_m32r_TRUE@    m32r/eng2.h \
+@SIM_ENABLE_ARCH_m32r_TRUE@    m32r/mloop2.c \
+@SIM_ENABLE_ARCH_m32r_TRUE@    m32r/stamp-mloop-2
+
 @SIM_ENABLE_ARCH_m68hc11_TRUE@m68hc11_BUILD_OUTPUTS = \
 @SIM_ENABLE_ARCH_m68hc11_TRUE@ m68hc11/gencode$(EXEEXT) \
 @SIM_ENABLE_ARCH_m68hc11_TRUE@ m68hc11/m68hc11int.c \
@@ -1160,6 +1359,11 @@ testsuite_common_CPPFLAGS = \
 @SIM_ENABLE_ARCH_mn10300_TRUE@mn10300_IGEN_INSN = $(srcdir)/mn10300/mn10300.igen
 @SIM_ENABLE_ARCH_mn10300_TRUE@mn10300_IGEN_INSN_INC = mn10300/am33.igen mn10300/am33-2.igen
 @SIM_ENABLE_ARCH_mn10300_TRUE@mn10300_IGEN_DC = $(srcdir)/mn10300/mn10300.dc
+@SIM_ENABLE_ARCH_or1k_TRUE@or1k_BUILD_OUTPUTS = \
+@SIM_ENABLE_ARCH_or1k_TRUE@    or1k/eng.h \
+@SIM_ENABLE_ARCH_or1k_TRUE@    or1k/mloop.c \
+@SIM_ENABLE_ARCH_or1k_TRUE@    or1k/stamp-mloop
+
 @SIM_ENABLE_ARCH_sh_TRUE@sh_BUILD_OUTPUTS = \
 @SIM_ENABLE_ARCH_sh_TRUE@      sh/gencode$(EXEEXT) \
 @SIM_ENABLE_ARCH_sh_TRUE@      sh/code.c \
@@ -1198,7 +1402,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 $(srcdir)/cr16/local.mk $(srcdir)/d10v/local.mk $(srcdir)/m32c/local.mk $(srcdir)/m68hc11/local.mk $(srcdir)/mn10300/local.mk $(srcdir)/sh/local.mk $(srcdir)/v850/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)/bpf/local.mk $(srcdir)/cr16/local.mk $(srcdir)/cris/local.mk $(srcdir)/d10v/local.mk $(srcdir)/frv/local.mk $(srcdir)/iq2000/local.mk $(srcdir)/lm32/local.mk $(srcdir)/m32c/local.mk $(srcdir)/m32r/local.mk $(srcdir)/m68hc11/local.mk $(srcdir)/mn10300/local.mk $(srcdir)/or1k/local.mk $(srcdir)/sh/local.mk $(srcdir)/v850/local.mk $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
            *$$dep*) \
@@ -1220,7 +1424,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 $(srcdir)/cr16/local.mk $(srcdir)/d10v/local.mk $(srcdir)/m32c/local.mk $(srcdir)/m68hc11/local.mk $(srcdir)/mn10300/local.mk $(srcdir)/sh/local.mk $(srcdir)/v850/local.mk $(am__empty):
+$(srcdir)/common/local.mk $(srcdir)/igen/local.mk $(srcdir)/testsuite/local.mk $(srcdir)/testsuite/common/local.mk $(srcdir)/bpf/local.mk $(srcdir)/cr16/local.mk $(srcdir)/cris/local.mk $(srcdir)/d10v/local.mk $(srcdir)/frv/local.mk $(srcdir)/iq2000/local.mk $(srcdir)/lm32/local.mk $(srcdir)/m32c/local.mk $(srcdir)/m32r/local.mk $(srcdir)/m68hc11/local.mk $(srcdir)/mn10300/local.mk $(srcdir)/or1k/local.mk $(srcdir)/sh/local.mk $(srcdir)/v850/local.mk $(am__empty):
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
        $(SHELL) ./config.status --recheck
@@ -2196,7 +2400,7 @@ uninstall-am: uninstall-pkgincludeHEADERS
 # An alternative is to slurp in the tables at runtime.
 .PHONY: nltvals
 nltvals:
-       $(srcdir)/common/gennltvals.py --cpp "$(CPP)"
+       $(srccom)/gennltvals.py --cpp "$(CPP)"
 
 common/version.c: common/version.c-stamp ; @true
 common/version.c-stamp: $(srcroot)/gdb/version.in $(srcroot)/bfd/version.h $(srcdir)/common/create-version.sh
@@ -2281,6 +2485,26 @@ 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 $@
 
+@SIM_ENABLE_ARCH_bpf_TRUE@bpf/mloop-le.c bpf/eng-le.h: bpf/stamp-mloop-le ; @true
+@SIM_ENABLE_ARCH_bpf_TRUE@bpf/stamp-mloop-le: $(srccom)/genmloop.sh bpf/mloop.in
+@SIM_ENABLE_ARCH_bpf_TRUE@     $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+@SIM_ENABLE_ARCH_bpf_TRUE@             -mono -scache -prefix bpfbf_ebpfle -cpu bpfbf \
+@SIM_ENABLE_ARCH_bpf_TRUE@             -infile $(srcdir)/bpf/mloop.in \
+@SIM_ENABLE_ARCH_bpf_TRUE@             -outfile-prefix bpf/ -outfile-suffix -le
+@SIM_ENABLE_ARCH_bpf_TRUE@     $(AM_V_at)$(SHELL) $(srcroot)/move-if-change bpf/eng-le.hin bpf/eng-le.h
+@SIM_ENABLE_ARCH_bpf_TRUE@     $(AM_V_at)$(SHELL) $(srcroot)/move-if-change bpf/mloop-le.cin bpf/mloop-le.c
+@SIM_ENABLE_ARCH_bpf_TRUE@     $(AM_V_at)touch $@
+
+@SIM_ENABLE_ARCH_bpf_TRUE@bpf/mloop-be.c bpf/eng-be.h: bpf/stamp-mloop-be ; @true
+@SIM_ENABLE_ARCH_bpf_TRUE@bpf/stamp-mloop-be: $(srccom)/genmloop.sh bpf/mloop.in
+@SIM_ENABLE_ARCH_bpf_TRUE@     $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+@SIM_ENABLE_ARCH_bpf_TRUE@             -mono -scache -prefix bpfbf_ebpfbe -cpu bpfbf \
+@SIM_ENABLE_ARCH_bpf_TRUE@             -infile $(srcdir)/bpf/mloop.in \
+@SIM_ENABLE_ARCH_bpf_TRUE@             -outfile-prefix bpf/ -outfile-suffix -be
+@SIM_ENABLE_ARCH_bpf_TRUE@     $(AM_V_at)$(SHELL) $(srcroot)/move-if-change bpf/eng-be.hin bpf/eng-be.h
+@SIM_ENABLE_ARCH_bpf_TRUE@     $(AM_V_at)$(SHELL) $(srcroot)/move-if-change bpf/mloop-be.cin bpf/mloop-be.c
+@SIM_ENABLE_ARCH_bpf_TRUE@     $(AM_V_at)touch $@
+
 # 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)
@@ -2297,6 +2521,30 @@ testsuite/common/bits64m63.c: testsuite/common/bits-gen testsuite/common/bits-ts
 @SIM_ENABLE_ARCH_cr16_TRUE@cr16/table.c: cr16/gencode$(EXEEXT)
 @SIM_ENABLE_ARCH_cr16_TRUE@    $(AM_V_GEN)$< >$@
 
+# FIXME: What is mono and what does "Use of `mono' is wip" mean (other
+# than the apparent; some "mono" feature is work in progress)?
+@SIM_ENABLE_ARCH_cris_TRUE@cris/mloopv10f.c cris/engv10.h: cris/stamp-mloop-v10f ; @true
+@SIM_ENABLE_ARCH_cris_TRUE@cris/stamp-mloop-v10f: $(srccom)/genmloop.sh cris/mloop.in
+@SIM_ENABLE_ARCH_cris_TRUE@    $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+@SIM_ENABLE_ARCH_cris_TRUE@            -mono -no-fast -pbb -switch semcrisv10f-switch.c \
+@SIM_ENABLE_ARCH_cris_TRUE@            -cpu crisv10f \
+@SIM_ENABLE_ARCH_cris_TRUE@            -infile $(srcdir)/cris/mloop.in -outfile-prefix cris/ -outfile-suffix -v10f
+@SIM_ENABLE_ARCH_cris_TRUE@    $(AM_V_at)$(SHELL) $(srcroot)/move-if-change cris/eng-v10f.hin cris/engv10.h
+@SIM_ENABLE_ARCH_cris_TRUE@    $(AM_V_at)$(SHELL) $(srcroot)/move-if-change cris/mloop-v10f.cin cris/mloopv10f.c
+@SIM_ENABLE_ARCH_cris_TRUE@    $(AM_V_at)touch $@
+
+# FIXME: What is mono and what does "Use of `mono' is wip" mean (other
+# than the apparent; some "mono" feature is work in progress)?
+@SIM_ENABLE_ARCH_cris_TRUE@cris/mloopv32f.c cris/engv32.h: cris/stamp-mloop-v32f ; @true
+@SIM_ENABLE_ARCH_cris_TRUE@cris/stamp-mloop-v32f: $(srccom)/genmloop.sh cris/mloop.in
+@SIM_ENABLE_ARCH_cris_TRUE@    $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+@SIM_ENABLE_ARCH_cris_TRUE@            -mono -no-fast -pbb -switch semcrisv32f-switch.c \
+@SIM_ENABLE_ARCH_cris_TRUE@            -cpu crisv32f \
+@SIM_ENABLE_ARCH_cris_TRUE@            -infile $(srcdir)/cris/mloop.in -outfile-prefix cris/ -outfile-suffix -v32f
+@SIM_ENABLE_ARCH_cris_TRUE@    $(AM_V_at)$(SHELL) $(srcroot)/move-if-change cris/eng-v32f.hin cris/engv32.h
+@SIM_ENABLE_ARCH_cris_TRUE@    $(AM_V_at)$(SHELL) $(srcroot)/move-if-change cris/mloop-v32f.cin cris/mloopv32f.c
+@SIM_ENABLE_ARCH_cris_TRUE@    $(AM_V_at)touch $@
+
 # 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)
@@ -2313,6 +2561,39 @@ testsuite/common/bits64m63.c: testsuite/common/bits-gen testsuite/common/bits-ts
 @SIM_ENABLE_ARCH_d10v_TRUE@d10v/table.c: d10v/gencode$(EXEEXT)
 @SIM_ENABLE_ARCH_d10v_TRUE@    $(AM_V_GEN)$< >$@
 
+# FIXME: Use of `mono' is wip.
+@SIM_ENABLE_ARCH_frv_TRUE@frv/mloop.c frv/eng.h: frv/stamp-mloop ; @true
+@SIM_ENABLE_ARCH_frv_TRUE@frv/stamp-mloop: $(srccom)/genmloop.sh frv/mloop.in
+@SIM_ENABLE_ARCH_frv_TRUE@     $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+@SIM_ENABLE_ARCH_frv_TRUE@             -mono -scache -parallel-generic-write -parallel-only \
+@SIM_ENABLE_ARCH_frv_TRUE@             -cpu frvbf \
+@SIM_ENABLE_ARCH_frv_TRUE@             -infile $(srcdir)/frv/mloop.in -outfile-prefix frv/
+@SIM_ENABLE_ARCH_frv_TRUE@     $(AM_V_at)$(SHELL) $(srcroot)/move-if-change frv/eng.hin frv/eng.h
+@SIM_ENABLE_ARCH_frv_TRUE@     $(AM_V_at)$(SHELL) $(srcroot)/move-if-change frv/mloop.cin frv/mloop.c
+@SIM_ENABLE_ARCH_frv_TRUE@     $(AM_V_at)touch $@
+
+# FIXME: Use of `mono' is wip.
+@SIM_ENABLE_ARCH_iq2000_TRUE@iq2000/mloop.c iq2000/eng.h: iq2000/stamp-mloop ; @true
+@SIM_ENABLE_ARCH_iq2000_TRUE@iq2000/stamp-mloop: $(srccom)/genmloop.sh iq2000/mloop.in
+@SIM_ENABLE_ARCH_iq2000_TRUE@  $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+@SIM_ENABLE_ARCH_iq2000_TRUE@          -mono -fast -pbb -switch sem-switch.c \
+@SIM_ENABLE_ARCH_iq2000_TRUE@          -cpu iq2000bf \
+@SIM_ENABLE_ARCH_iq2000_TRUE@          -infile $(srcdir)/iq2000/mloop.in -outfile-prefix iq2000/
+@SIM_ENABLE_ARCH_iq2000_TRUE@  $(AM_V_at)$(SHELL) $(srcroot)/move-if-change iq2000/eng.hin iq2000/eng.h
+@SIM_ENABLE_ARCH_iq2000_TRUE@  $(AM_V_at)$(SHELL) $(srcroot)/move-if-change iq2000/mloop.cin iq2000/mloop.c
+@SIM_ENABLE_ARCH_iq2000_TRUE@  $(AM_V_at)touch $@
+
+# FIXME: Use of `mono' is wip.
+@SIM_ENABLE_ARCH_lm32_TRUE@lm32/mloop.c lm32/eng.h: lm32/stamp-mloop ; @true
+@SIM_ENABLE_ARCH_lm32_TRUE@lm32/stamp-mloop: $(srccom)/genmloop.sh lm32/mloop.in
+@SIM_ENABLE_ARCH_lm32_TRUE@    $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+@SIM_ENABLE_ARCH_lm32_TRUE@            -mono -fast -pbb -switch sem-switch.c \
+@SIM_ENABLE_ARCH_lm32_TRUE@            -cpu lm32bf \
+@SIM_ENABLE_ARCH_lm32_TRUE@            -infile $(srcdir)/lm32/mloop.in -outfile-prefix lm32/
+@SIM_ENABLE_ARCH_lm32_TRUE@    $(AM_V_at)$(SHELL) $(srcroot)/move-if-change lm32/eng.hin lm32/eng.h
+@SIM_ENABLE_ARCH_lm32_TRUE@    $(AM_V_at)$(SHELL) $(srcroot)/move-if-change lm32/mloop.cin lm32/mloop.c
+@SIM_ENABLE_ARCH_lm32_TRUE@    $(AM_V_at)touch $@
+
 # 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)
@@ -2329,6 +2610,39 @@ testsuite/common/bits64m63.c: testsuite/common/bits-gen testsuite/common/bits-ts
 @SIM_ENABLE_ARCH_m32c_TRUE@    $(AM_V_GEN)$(m32c_OPC2C_RUN) -l $@.log $< > $@.tmp
 @SIM_ENABLE_ARCH_m32c_TRUE@    $(AM_V_at)mv $@.tmp $@
 
+# FIXME: Use of `mono' is wip.
+@SIM_ENABLE_ARCH_m32r_TRUE@m32r/mloop.c m32r/eng.h: m32r/stamp-mloop ; @true
+@SIM_ENABLE_ARCH_m32r_TRUE@m32r/stamp-mloop: $(srccom)/genmloop.sh m32r/mloop.in
+@SIM_ENABLE_ARCH_m32r_TRUE@    $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+@SIM_ENABLE_ARCH_m32r_TRUE@            -mono -fast -pbb -switch sem-switch.c \
+@SIM_ENABLE_ARCH_m32r_TRUE@            -cpu m32rbf \
+@SIM_ENABLE_ARCH_m32r_TRUE@            -infile $(srcdir)/m32r/mloop.in -outfile-prefix m32r/
+@SIM_ENABLE_ARCH_m32r_TRUE@    $(AM_V_at)$(SHELL) $(srcroot)/move-if-change m32r/eng.hin m32r/eng.h
+@SIM_ENABLE_ARCH_m32r_TRUE@    $(AM_V_at)$(SHELL) $(srcroot)/move-if-change m32r/mloop.cin m32r/mloop.c
+@SIM_ENABLE_ARCH_m32r_TRUE@    $(AM_V_at)touch $@
+
+# FIXME: Use of `mono' is wip.
+@SIM_ENABLE_ARCH_m32r_TRUE@m32r/mloopx.c m32r/engx.h: m32r/stamp-mloop ; @true
+@SIM_ENABLE_ARCH_m32r_TRUE@m32r/stamp-mloop-x: $(srccom)/genmloop.sh m32r/mloop.in
+@SIM_ENABLE_ARCH_m32r_TRUE@    $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+@SIM_ENABLE_ARCH_m32r_TRUE@            -mono -no-fast -pbb -parallel-write -switch semx-switch.c \
+@SIM_ENABLE_ARCH_m32r_TRUE@            -cpu m32rxf \
+@SIM_ENABLE_ARCH_m32r_TRUE@            -infile $(srcdir)/m32r/mloopx.in -outfile-prefix m32r/ -outfile-suffix x
+@SIM_ENABLE_ARCH_m32r_TRUE@    $(AM_V_at)$(SHELL) $(srcroot)/move-if-change m32r/engx.hin m32r/engx.h
+@SIM_ENABLE_ARCH_m32r_TRUE@    $(AM_V_at)$(SHELL) $(srcroot)/move-if-change m32r/mloopx.cin m32r/mloopx.c
+@SIM_ENABLE_ARCH_m32r_TRUE@    $(AM_V_at)touch $@
+
+# FIXME: Use of `mono' is wip.
+@SIM_ENABLE_ARCH_m32r_TRUE@m32r/mloop2.c m32r/eng2.h: m32r/stamp-mloop ; @true
+@SIM_ENABLE_ARCH_m32r_TRUE@m32r/stamp-mloop-2: $(srccom)/genmloop.sh m32r/mloop.in
+@SIM_ENABLE_ARCH_m32r_TRUE@    $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+@SIM_ENABLE_ARCH_m32r_TRUE@            -mono -no-fast -pbb -parallel-write -switch sem2-switch.c \
+@SIM_ENABLE_ARCH_m32r_TRUE@            -cpu m32r2f \
+@SIM_ENABLE_ARCH_m32r_TRUE@            -infile $(srcdir)/m32r/mloop2.in -outfile-prefix m32r/ -outfile-suffix 2
+@SIM_ENABLE_ARCH_m32r_TRUE@    $(AM_V_at)$(SHELL) $(srcroot)/move-if-change m32r/eng2.hin m32r/eng2.h
+@SIM_ENABLE_ARCH_m32r_TRUE@    $(AM_V_at)$(SHELL) $(srcroot)/move-if-change m32r/mloop2.cin m32r/mloop2.c
+@SIM_ENABLE_ARCH_m32r_TRUE@    $(AM_V_at)touch $@
+
 # 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)
@@ -2386,6 +2700,17 @@ testsuite/common/bits64m63.c: testsuite/common/bits-gen testsuite/common/bits-ts
 @SIM_ENABLE_ARCH_mn10300_TRUE@ $(AM_V_at)$(SHELL) $(srcroot)/move-if-change mn10300/tmp-irun.c mn10300/irun.c
 @SIM_ENABLE_ARCH_mn10300_TRUE@ $(AM_V_at)touch $@
 
+# FIXME: Use of `mono' is wip.
+@SIM_ENABLE_ARCH_or1k_TRUE@or1k/mloop.c or1k/eng.h: or1k/stamp-mloop ; @true
+@SIM_ENABLE_ARCH_or1k_TRUE@or1k/stamp-mloop: $(srccom)/genmloop.sh or1k/mloop.in
+@SIM_ENABLE_ARCH_or1k_TRUE@    $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+@SIM_ENABLE_ARCH_or1k_TRUE@            -mono -fast -pbb -switch sem-switch.c \
+@SIM_ENABLE_ARCH_or1k_TRUE@            -cpu or1k32bf \
+@SIM_ENABLE_ARCH_or1k_TRUE@            -infile $(srcdir)/or1k/mloop.in -outfile-prefix or1k/
+@SIM_ENABLE_ARCH_or1k_TRUE@    $(AM_V_at)$(SHELL) $(srcroot)/move-if-change or1k/eng.hin or1k/eng.h
+@SIM_ENABLE_ARCH_or1k_TRUE@    $(AM_V_at)$(SHELL) $(srcroot)/move-if-change or1k/mloop.cin or1k/mloop.c
+@SIM_ENABLE_ARCH_or1k_TRUE@    $(AM_V_at)touch $@
+
 # 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)
index 05a246e670acc6ce119a317d19d6978143623841..b12c18d6520bc0283ac4828873456095d7265ab6 100644 (file)
@@ -161,33 +161,7 @@ $(srcdir)/sem-be.c $(srcdir)/decode-be.c $(srcdir)/decode-be.h: \
               $(CGEN_MAINT) stamp-decode-be
        @true
 
-# Note the following files are generated in objdir, not srcdir.
-
-stamp-mloop: stamp-mloop-le stamp-mloop-be
-
-stamp-mloop-le: $(srcdir)/../common/genmloop.sh mloop.in Makefile
-       $(ECHO_STAMP) mloop-le.c eng-le.h
-       $(SILENCE) $(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
-               -mono -scache -prefix bpfbf_ebpfle -cpu bpfbf \
-                -infile $(srcdir)/mloop.in -outfile-suffix -le
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change eng-le.hin eng-le.h
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change mloop-le.cin mloop-le.c
-       $(SILENCE) touch $@
-mloop-le.c eng-le.h: stamp-mloop-le
-       @true
-
-stamp-mloop-be: $(srcdir)/../common/genmloop.sh mloop.in Makefile
-       $(ECHO_STAMP) mloop-be.c eng-be.h
-       $(SILENCE) $(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
-               -mono -scache -prefix bpfbf_ebpfbe -cpu bpfbf \
-                -infile $(srcdir)/mloop.in -outfile-suffix -be
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change eng-be.hin eng-be.h
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change mloop-be.cin mloop-be.c
-       $(SILENCE) touch $@
-mloop-be.c eng-be.h: stamp-mloop-be
-       @true
-
 .PHONY = bpf-clean
 
 bpf-clean:
-       rm -f stamp-arch stamp-cpu stamp-decode stamp-defs stamp-mloop
+       rm -f stamp-arch stamp-cpu stamp-decode stamp-defs
diff --git a/sim/bpf/local.mk b/sim/bpf/local.mk
new file mode 100644 (file)
index 0000000..ebca133
--- /dev/null
@@ -0,0 +1,49 @@
+# See sim/Makefile.am
+#
+# Copyright (C) 2020-2021 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%_BUILD_OUTPUTS = \
+       %D%/eng-le.h \
+       %D%/mloop-le.c \
+       %D%/stamp-mloop-le \
+       %D%/eng-be.h \
+       %D%/mloop-be.c \
+       %D%/stamp-mloop-be
+
+# This makes sure build tools are available before building the arch-subdirs.
+SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+
+%D%/mloop-le.c %D%/eng-le.h: %D%/stamp-mloop-le ; @true
+%D%/stamp-mloop-le: $(srccom)/genmloop.sh %D%/mloop.in
+       $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+               -mono -scache -prefix bpfbf_ebpfle -cpu bpfbf \
+               -infile $(srcdir)/%D%/mloop.in \
+               -outfile-prefix %D%/ -outfile-suffix -le
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/eng-le.hin %D%/eng-le.h
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/mloop-le.cin %D%/mloop-le.c
+       $(AM_V_at)touch $@
+
+%D%/mloop-be.c %D%/eng-be.h: %D%/stamp-mloop-be ; @true
+%D%/stamp-mloop-be: $(srccom)/genmloop.sh %D%/mloop.in
+       $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+               -mono -scache -prefix bpfbf_ebpfbe -cpu bpfbf \
+               -infile $(srcdir)/%D%/mloop.in \
+               -outfile-prefix %D%/ -outfile-suffix -be
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/eng-be.hin %D%/eng-be.h
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/mloop-be.cin %D%/mloop-be.c
+       $(AM_V_at)touch $@
+
+MOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS)
index fa4e7b90a516ba17bfb2da9ffb8ad3d3b4f5205e..572dc8a9ed4b74522cbdb2ef95f1708372c9f7f3 100755 (executable)
@@ -140,6 +140,7 @@ switch=
 cpu="unknown"
 infile=""
 prefix="unknown"
+outprefix=""
 outsuffix=""
 
 while test $# -gt 0
@@ -154,6 +155,7 @@ do
        -scache) scache=yes ;;
        -pbb) pbb=yes ;;
        -no-parallel) ;;
+       -outfile-prefix) shift ; outprefix=$1 ;;
        -outfile-suffix) shift ; outsuffix=$1 ;;
        -parallel-read) parallel=read ;;
        -parallel-write) parallel=write ;;
@@ -197,8 +199,8 @@ PREFIX=`echo ${prefix} | tr "${lowercase}" "${uppercase}"`
 
 ##########################################################################
 
-rm -f eng${outsuffix}.hin
-exec 1>eng${outsuffix}.hin
+rm -f ${outprefix}eng${outsuffix}.hin
+exec 1>${outprefix}eng${outsuffix}.hin
 
 echo "/* engine configuration for ${cpu} */"
 echo ""
@@ -291,8 +293,8 @@ fi
 
 ##########################################################################
 
-rm -f tmp-mloop-$$.cin mloop${outsuffix}.cin
-exec 1>tmp-mloop-$$.cin
+rm -f ${outprefix}tmp-mloop-$$.cin ${outprefix}mloop${outsuffix}.cin
+exec 1>${outprefix}tmp-mloop-$$.cin
 
 # We use @cpu@ instead of ${cpu} because we still need to run sed to handle
 # transformation of @cpu@ for mainloop.in, so there's no need to use ${cpu}
@@ -1334,8 +1336,9 @@ fi # -pbb
 # Expand @..@ macros appearing in tmp-mloop-{pid}.cin.
 sed \
   -e "s/@cpu@/$cpu/g" -e "s/@CPU@/$CPU/g" \
-  -e "s/@prefix@/$prefix/g" -e "s/@PREFIX@/$PREFIX/g" < tmp-mloop-$$.cin > mloop${outsuffix}.cin
+  -e "s/@prefix@/$prefix/g" -e "s/@PREFIX@/$PREFIX/g" \
+  < ${outprefix}tmp-mloop-$$.cin > ${outprefix}mloop${outsuffix}.cin
 rc=$?
-rm -f tmp-mloop-$$.cin
+rm -f ${outprefix}tmp-mloop-$$.cin
 
 exit $rc
index 18dd2f451b55d2a651b2e1d6fac087c936c5aaca..8e6bb2ec79bd47dc96c4dc60f18ca40af8062c5f 100644 (file)
@@ -66,48 +66,18 @@ CRISV10F_INCLUDE_DEPS = \
        $(CGEN_MAIN_CPU_DEPS) \
        cpuv10.h decodev10.h engv10.h
 
-# FIXME: What is mono and what does "Use of `mono' is wip" mean (other
-# than the apparent; some "mono" feature is work in progress)?
-mloopv10f.c engv10.h: stamp-v10fmloop
-stamp-v10fmloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
-       $(ECHO_STAMP) mloopv10f.c engv10.h
-       $(SILENCE) $(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
-               -mono -no-fast -pbb -switch semcrisv10f-switch.c \
-               -cpu crisv10f -infile $(srcdir)/mloop.in
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change eng.hin engv10.h
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change mloop.cin mloopv10f.c
-       $(SILENCE) touch $@
-
 # CRISV32 objs
 
 CRISV32F_INCLUDE_DEPS = \
        $(CGEN_MAIN_CPU_DEPS) \
        cpuv32.h decodev32.h engv32.h
 
-# FIXME: What is mono and what does "Use of `mono' is wip" mean (other
-# than the apparent; some "mono" feature is work in progress)?
-mloopv32f.c engv32.h: stamp-v32fmloop
-# We depend on stamp-v10fmloop to get serialization to avoid
-# racing with it for the same temporary file-names when "make -j".
-stamp-v32fmloop: stamp-v10fmloop $(srcdir)/../common/genmloop.sh mloop.in Makefile
-       $(ECHO_STAMP) mloopv32f.c engv32.h
-       $(SILENCE) $(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
-               -mono -no-fast -pbb -switch semcrisv32f-switch.c \
-               -cpu crisv32f -infile $(srcdir)/mloop.in
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change eng.hin engv32.h
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change mloop.cin mloopv32f.c
-       $(SILENCE) touch $@
-
 cris-clean:
-       for v in 10 32; do \
-         rm -f mloopv$${v}f.c engv$${v}.h stamp-v$${v}fmloop; \
-         rm -f stamp-v$${v}fcpu; \
-       done
        -rm -f stamp-arch
        -rm -f tmp-*
 
 # Useful when making CGEN-generated files manually, without --enable-cgen-maint.
-stamps: stamp-v10fmloop stamp-v32fmloop stamp-arch stamp-v10fcpu stamp-v32fcpu
+stamps: stamp-arch stamp-v10fcpu stamp-v32fcpu
 
 stamp-arch: $(CGEN_READ_SCM) $(CGEN_ARCH_SCM) $(CPU_DIR)/cris.cpu Makefile
        $(MAKE) cgen-arch $(CGEN_FLAGS_TO_PASS) mach=crisv10,crisv32 \
diff --git a/sim/cris/local.mk b/sim/cris/local.mk
new file mode 100644 (file)
index 0000000..c810bcd
--- /dev/null
@@ -0,0 +1,54 @@
+# See sim/Makefile.am
+#
+# Copyright (C) 2004-2021 Free Software Foundation, Inc.
+# Contributed by Axis Communications.
+#
+# 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%/engv10.h \
+       %D%/mloopv10f.c \
+       %D%/stamp-mloop-v10f \
+       %D%/engv32.h \
+       %D%/mloopv32f.c \
+       %D%/stamp-mloop-v32f
+
+# This makes sure build tools are available before building the arch-subdirs.
+SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+
+# FIXME: What is mono and what does "Use of `mono' is wip" mean (other
+# than the apparent; some "mono" feature is work in progress)?
+%D%/mloopv10f.c %D%/engv10.h: %D%/stamp-mloop-v10f ; @true
+%D%/stamp-mloop-v10f: $(srccom)/genmloop.sh %D%/mloop.in
+       $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+               -mono -no-fast -pbb -switch semcrisv10f-switch.c \
+               -cpu crisv10f \
+               -infile $(srcdir)/%D%/mloop.in -outfile-prefix %D%/ -outfile-suffix -v10f
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/eng-v10f.hin %D%/engv10.h
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/mloop-v10f.cin %D%/mloopv10f.c
+       $(AM_V_at)touch $@
+
+# FIXME: What is mono and what does "Use of `mono' is wip" mean (other
+# than the apparent; some "mono" feature is work in progress)?
+%D%/mloopv32f.c %D%/engv32.h: %D%/stamp-mloop-v32f ; @true
+%D%/stamp-mloop-v32f: $(srccom)/genmloop.sh %D%/mloop.in
+       $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+               -mono -no-fast -pbb -switch semcrisv32f-switch.c \
+               -cpu crisv32f \
+               -infile $(srcdir)/%D%/mloop.in -outfile-prefix %D%/ -outfile-suffix -v32f
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/eng-v32f.hin %D%/engv32.h
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/mloop-v32f.cin %D%/mloopv32f.c
+       $(AM_V_at)touch $@
+
+MOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS)
index 2c17075432c691e3fc5820f5c22aa5280b186d7f..1159f638c3290324c41eee203274349641ef75fa 100644 (file)
@@ -54,19 +54,7 @@ FRVBF_INCLUDE_DEPS = \
        $(SIM_EXTRA_DEPS) \
        cpu.h decode.h eng.h
 
-# FIXME: Use of `mono' is wip.
-mloop.c eng.h: stamp-mloop
-stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
-       $(ECHO_STAMP) mloop.c eng.h
-       $(SILENCE) $(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
-               -mono -scache -parallel-generic-write -parallel-only \
-               -cpu frvbf -infile $(srcdir)/mloop.in
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change eng.hin eng.h
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
-       $(SILENCE) touch $@
-
 frv-clean:
-       rm -f mloop.c eng.h stamp-mloop
        rm -f tmp-*
        rm -f stamp-arch stamp-cpu
 
diff --git a/sim/frv/local.mk b/sim/frv/local.mk
new file mode 100644 (file)
index 0000000..378120c
--- /dev/null
@@ -0,0 +1,38 @@
+# See sim/Makefile.am
+#
+# Copyright (C) 1998-2021 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%_BUILD_OUTPUTS = \
+       %D%/eng.h \
+       %D%/mloop.c \
+       %D%/stamp-mloop
+
+# This makes sure build tools are available before building the arch-subdirs.
+SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+
+# FIXME: Use of `mono' is wip.
+%D%/mloop.c %D%/eng.h: %D%/stamp-mloop ; @true
+%D%/stamp-mloop: $(srccom)/genmloop.sh %D%/mloop.in
+       $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+               -mono -scache -parallel-generic-write -parallel-only \
+               -cpu frvbf \
+               -infile $(srcdir)/%D%/mloop.in -outfile-prefix %D%/
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/eng.hin %D%/eng.h
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/mloop.cin %D%/mloop.c
+       $(AM_V_at)touch $@
+
+MOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS)
index b47d15ac4772c7b663a0130fc420b199784db794..c98fb78e7ff5287cc0afd351febab1f32fb60d76 100644 (file)
@@ -54,19 +54,7 @@ IQ2000BF_INCLUDE_DEPS = \
        $(CGEN_MAIN_CPU_DEPS) \
        cpu.h decode.h eng.h
 
-# FIXME: Use of `mono' is wip.
-mloop.c eng.h: stamp-mloop
-stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
-       $(ECHO_STAMP) mloop.c eng.h
-       $(SILENCE) $(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
-               -mono -fast -pbb -switch sem-switch.c \
-               -cpu iq2000bf -infile $(srcdir)/mloop.in
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change eng.hin eng.h
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
-       $(SILENCE) touch $@
-
 iq2000-clean:
-       rm -f mloop.c eng.h stamp-mloop
        rm -f tmp-*
        rm -f stamp-arch stamp-cpu
 
diff --git a/sim/iq2000/local.mk b/sim/iq2000/local.mk
new file mode 100644 (file)
index 0000000..00b2af1
--- /dev/null
@@ -0,0 +1,38 @@
+# See sim/Makefile.am
+#
+# Copyright (C) 1998-2021 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%_BUILD_OUTPUTS = \
+       %D%/eng.h \
+       %D%/mloop.c \
+       %D%/stamp-mloop
+
+# This makes sure build tools are available before building the arch-subdirs.
+SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+
+# FIXME: Use of `mono' is wip.
+%D%/mloop.c %D%/eng.h: %D%/stamp-mloop ; @true
+%D%/stamp-mloop: $(srccom)/genmloop.sh %D%/mloop.in
+       $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+               -mono -fast -pbb -switch sem-switch.c \
+               -cpu iq2000bf \
+               -infile $(srcdir)/%D%/mloop.in -outfile-prefix %D%/
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/eng.hin %D%/eng.h
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/mloop.cin %D%/mloop.c
+       $(AM_V_at)touch $@
+
+MOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS)
index 642c483acd26c9f22de97a1aa8ea3991afc3ed53..d827b711d45ece50e1d005953f99ac3a2f2c0b59 100644 (file)
@@ -35,19 +35,7 @@ LM32BF_INCLUDE_DEPS = \
        $(CGEN_MAIN_CPU_DEPS) \
        cpu.h decode.h eng.h
 
-# FIXME: Use of `mono' is wip.
-mloop.c eng.h: stamp-mloop
-stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
-       $(ECHO_STAMP) mloop.c eng.h
-       $(SILENCE) $(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
-               -mono -fast -pbb -switch sem-switch.c \
-               -cpu lm32bf -infile $(srcdir)/mloop.in
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change eng.hin eng.h
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
-       $(SILENCE) touch $@
-
 lm32-clean:
-       rm -f mloop.c eng.h stamp-mloop
        rm -f stamp-arch stamp-cpu 
        rm -f tmp-*
 
diff --git a/sim/lm32/local.mk b/sim/lm32/local.mk
new file mode 100644 (file)
index 0000000..2d7ebc2
--- /dev/null
@@ -0,0 +1,38 @@
+# See sim/Makefile.am
+#
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
+# Contributed by Jon Beniston <jon@beniston.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%/eng.h \
+       %D%/mloop.c \
+       %D%/stamp-mloop
+
+# This makes sure build tools are available before building the arch-subdirs.
+SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+
+# FIXME: Use of `mono' is wip.
+%D%/mloop.c %D%/eng.h: %D%/stamp-mloop ; @true
+%D%/stamp-mloop: $(srccom)/genmloop.sh %D%/mloop.in
+       $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+               -mono -fast -pbb -switch sem-switch.c \
+               -cpu lm32bf \
+               -infile $(srcdir)/%D%/mloop.in -outfile-prefix %D%/
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/eng.hin %D%/eng.h
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/mloop.cin %D%/mloop.c
+       $(AM_V_at)touch $@
+
+MOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS)
index d9d8acfc30fdc2147058ee6fa212222877a3b2f7..df4f5bf0209fd49abc4001097287676b269899da 100644 (file)
@@ -50,63 +50,7 @@ cpu.o cpu2.o cpux.o m32r.o m32r2.o m32rx.o mloop.o mloop2.o mloopx.o sem.o sim-i
 
 arch = m32r
 
-# M32R objs
-
-M32RBF_INCLUDE_DEPS = \
-       $(CGEN_MAIN_CPU_DEPS) \
-       cpu.h decode.h eng.h
-
-# FIXME: Use of `mono' is wip.
-mloop.c eng.h: stamp-mloop ; @true
-stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
-       $(ECHO_STAMP) mloop.c eng.h
-       $(SILENCE) $(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
-               -mono -fast -pbb -switch sem-switch.c \
-               -cpu m32rbf -infile $(srcdir)/mloop.in
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change eng.hin eng.h
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
-       $(SILENCE) touch $@
-
-# M32RX objs
-
-M32RXF_INCLUDE_DEPS = \
-       $(CGEN_MAIN_CPU_DEPS) \
-       cpux.h decodex.h engx.h
-
-# FIXME: Use of `mono' is wip.
-mloopx.c engx.h: stamp-xmloop ; @true
-stamp-xmloop: $(srcdir)/../common/genmloop.sh mloopx.in Makefile
-       $(ECHO_STAMP) mloopx.c engx.h
-       $(SILENCE) $(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
-               -mono -no-fast -pbb -parallel-write -switch semx-switch.c \
-               -cpu m32rxf -infile $(srcdir)/mloopx.in \
-               -outfile-suffix x
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change engx.hin engx.h
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change mloopx.cin mloopx.c
-       $(SILENCE) touch $@
-
-# M32R2 objs
-
-M32R2F_INCLUDE_DEPS = \
-       $(CGEN_MAIN_CPU_DEPS) \
-       cpu2.h decode2.h eng2.h
-
-# FIXME: Use of `mono' is wip.
-mloop2.c eng2.h: stamp-2mloop ; @true
-stamp-2mloop: $(srcdir)/../common/genmloop.sh mloop2.in Makefile
-       $(ECHO_STAMP) mloop2.c eng2.h
-       $(SILENCE) $(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
-               -mono -no-fast -pbb -parallel-write -switch sem2-switch.c \
-               -cpu m32r2f -infile $(srcdir)/mloop2.in \
-               -outfile-suffix 2
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change eng2.hin eng2.h
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change mloop2.cin mloop2.c
-       $(SILENCE) touch $@
-
 m32r-clean:
-       rm -f mloop.c eng.h stamp-mloop
-       rm -f mloopx.c engx.h stamp-xmloop
-       rm -f mloop2.c eng2.h stamp-2mloop
        rm -f stamp-arch stamp-cpu stamp-xcpu stamp-2cpu
        rm -f tmp-*
 
diff --git a/sim/m32r/local.mk b/sim/m32r/local.mk
new file mode 100644 (file)
index 0000000..ab4abb7
--- /dev/null
@@ -0,0 +1,66 @@
+# See sim/Makefile.am
+#
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
+# Contributed 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%/eng.h \
+       %D%/mloop.c \
+       %D%/stamp-mloop \
+       %D%/engx.h \
+       %D%/mloopx.c \
+       %D%/stamp-mloop-x \
+       %D%/eng2.h \
+       %D%/mloop2.c \
+       %D%/stamp-mloop-2
+
+# This makes sure build tools are available before building the arch-subdirs.
+SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+
+# FIXME: Use of `mono' is wip.
+%D%/mloop.c %D%/eng.h: %D%/stamp-mloop ; @true
+%D%/stamp-mloop: $(srccom)/genmloop.sh %D%/mloop.in
+       $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+               -mono -fast -pbb -switch sem-switch.c \
+               -cpu m32rbf \
+               -infile $(srcdir)/%D%/mloop.in -outfile-prefix %D%/
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/eng.hin %D%/eng.h
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/mloop.cin %D%/mloop.c
+       $(AM_V_at)touch $@
+
+# FIXME: Use of `mono' is wip.
+%D%/mloopx.c %D%/engx.h: %D%/stamp-mloop ; @true
+%D%/stamp-mloop-x: $(srccom)/genmloop.sh %D%/mloop.in
+       $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+               -mono -no-fast -pbb -parallel-write -switch semx-switch.c \
+               -cpu m32rxf \
+               -infile $(srcdir)/%D%/mloopx.in -outfile-prefix %D%/ -outfile-suffix x
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/engx.hin %D%/engx.h
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/mloopx.cin %D%/mloopx.c
+       $(AM_V_at)touch $@
+
+# FIXME: Use of `mono' is wip.
+%D%/mloop2.c %D%/eng2.h: %D%/stamp-mloop ; @true
+%D%/stamp-mloop-2: $(srccom)/genmloop.sh %D%/mloop.in
+       $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+               -mono -no-fast -pbb -parallel-write -switch sem2-switch.c \
+               -cpu m32r2f \
+               -infile $(srcdir)/%D%/mloop2.in -outfile-prefix %D%/ -outfile-suffix 2
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/eng2.hin %D%/eng2.h
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/mloop2.cin %D%/mloop2.c
+       $(AM_V_at)touch $@
+
+MOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS)
index c6bd03b756cd3cdba01de08fcbc208c965dd0399..3f1c432c3720e472e3671fb28e7862e64e87d8f9 100644 (file)
@@ -53,8 +53,6 @@ SIM_EXTRA_CFLAGS =
 
 SIM_EXTRA_LIBS = -lm
 
-SIM_EXTRA_CLEAN = or1k-clean
-
 ## COMMON_POST_CONFIG_FRAG
 
 arch = or1k
@@ -67,15 +65,6 @@ OR1K32BF_INCLUDE_DEPS = \
        decode.h \
        eng.h
 
-mloop.c eng.h: stamp-mloop ; @true
-stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
-       $(ECHO_STAMP) mloop.c eng.h
-       $(SILENCE) $(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
-               -mono -fast -pbb -switch sem-switch.c \
-               -cpu or1k32bf -infile $(srcdir)/mloop.in
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change eng.hin eng.h
-       $(SILENCE) $(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
-       $(SILENCE) touch $@
 or1k.o: or1k.c $(OR1K32BF_INCLUDE_DEPS)
        $(COMPILE) $<
        $(POSTCOMPILE)
@@ -88,10 +77,7 @@ traps.o: traps.c $(SIM_MAIN_DEPS) eng.h
        $(COMPILE) $<
        $(POSTCOMPILE)
 
-or1k-clean:
-       rm -f mloop.c eng.h stamp-mloop
-
-stamps: stamp-arch stamp-cpu stamp-mloop
+stamps: stamp-arch stamp-cpu
 
 # NOTE: Generated source files are specified as full paths,
 # e.g. $(srcdir)/arch.c, because make may decide the files live
diff --git a/sim/or1k/local.mk b/sim/or1k/local.mk
new file mode 100644 (file)
index 0000000..ab1f07d
--- /dev/null
@@ -0,0 +1,37 @@
+# See sim/Makefile.am
+#
+# Copyright (C) 2017-2021 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%_BUILD_OUTPUTS = \
+       %D%/eng.h \
+       %D%/mloop.c \
+       %D%/stamp-mloop
+
+# This makes sure build tools are available before building the arch-subdirs.
+SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+
+# FIXME: Use of `mono' is wip.
+%D%/mloop.c %D%/eng.h: %D%/stamp-mloop ; @true
+%D%/stamp-mloop: $(srccom)/genmloop.sh %D%/mloop.in
+       $(AM_V_GEN)$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
+               -mono -fast -pbb -switch sem-switch.c \
+               -cpu or1k32bf \
+               -infile $(srcdir)/%D%/mloop.in -outfile-prefix %D%/
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/eng.hin %D%/eng.h
+       $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/mloop.cin %D%/mloop.c
+       $(AM_V_at)touch $@
+
+MOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS)