aboutsummaryrefslogtreecommitdiff
path: root/sim/mips
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2022-12-25 02:25:47 -0500
committerMike Frysinger <vapier@gentoo.org>2022-12-27 00:31:33 -0500
commit49d3ce6c2e9c7b2d9f3c761a9e736bdaceb756e6 (patch)
tree78eb9fe42808406e85d6a21ffa30279173d1f14c /sim/mips
parent67c952d109873321b45b6de99cdbefbcd4249745 (diff)
downloadgdb-49d3ce6c2e9c7b2d9f3c761a9e736bdaceb756e6.zip
gdb-49d3ce6c2e9c7b2d9f3c761a9e736bdaceb756e6.tar.gz
gdb-49d3ce6c2e9c7b2d9f3c761a9e736bdaceb756e6.tar.bz2
sim: mips: hoist itable igen rules up to common builds
Since this rule is pretty simple, hoist it up to the common build.
Diffstat (limited to 'sim/mips')
-rw-r--r--sim/mips/Makefile.in33
-rw-r--r--sim/mips/local.mk52
2 files changed, 50 insertions, 35 deletions
diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in
index 4cd5964..187f574 100644
--- a/sim/mips/Makefile.in
+++ b/sim/mips/Makefile.in
@@ -6,7 +6,6 @@
SIM_MIPS_IGEN_FLAGS = @SIM_MIPS_IGEN_FLAGS@
SIM_MIPS_M16_FLAGS = @SIM_MIPS_M16_FLAGS@
SIM_MIPS_GEN = @SIM_MIPS_GEN@
-SIM_MIPS_IGEN_ITABLE_FLAGS = @SIM_MIPS_IGEN_ITABLE_FLAGS@
SIM_MIPS_MULTI_IGEN_CONFIGS = @SIM_MIPS_MULTI_IGEN_CONFIGS@
SIM_MIPS_MULTI_SRC = @SIM_MIPS_MULTI_SRC@
SIM_MIPS_MULTI_OBJ = @SIM_MIPS_MULTI_OBJ@
@@ -64,8 +63,6 @@ SIM_EXTRA_CLEAN = clean-extra
all: $(SIM_$(SIM_MIPS_GEN)_ALL)
-SIM_EXTRA_DEPS = itable.h
-
## COMMON_POST_CONFIG_FRAG
IGEN_TRACE= # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries # -G trace-all
@@ -89,37 +86,10 @@ IGEN_INCLUDE=\
$(srcdir)/mips3264r2.igen \
$(srcdir)/mips3264r6.igen \
-# NB: Since these can be built by a number of generators, care
-# must be taken to ensure that they are only dependant on
-# one of those generators.
-BUILT_SRC_FROM_IGEN_ITABLE = \
- itable.h \
- itable.c \
-
SIM_IGEN_ALL = tmp-igen
SIM_M16_ALL = tmp-m16
SIM_MULTI_ALL = tmp-multi
-$(BUILT_SRC_FROM_IGEN_ITABLE): tmp-itable
-
-tmp-itable: $(IGEN_INSN) $(IGEN_DC) $(IGEN) $(IGEN_INCLUDE)
- $(ECHO_IGEN) $(IGEN_RUN) \
- $(IGEN_TRACE) \
- -I $(srcdir) \
- -Werror \
- -Wnodiscard \
- -Wnowidth \
- -Wnounimplemented \
- $(SIM_MIPS_IGEN_ITABLE_FLAGS) \
- -G gen-direct-access \
- -G gen-zero-r0 \
- -i $(IGEN_INSN) \
- -n itable.h -ht itable.h \
- -n itable.c -t itable.c \
- #
- $(SILENCE) touch $@
-
-
BUILT_SRC_FROM_IGEN = \
icache.h \
icache.c \
@@ -333,9 +303,8 @@ tmp-run-multi: $(srcdir)/m16run.c $(srcdir)/micromipsrun.c
$(SILENCE) touch $@
clean-extra:
- rm -f $(BUILT_SRC_FROM_IGEN_ITABLE)
rm -f $(BUILT_SRC_FROM_IGEN)
rm -f $(BUILT_SRC_FROM_M16)
rm -f $(BUILT_SRC_FROM_MULTI)
rm -f tmp-*
- rm -f micromips16*.o micromips32*.o m16*.o m32*.o itable*.o
+ rm -f micromips16*.o micromips32*.o m16*.o m32*.o
diff --git a/sim/mips/local.mk b/sim/mips/local.mk
index 21a6f5c..beed8f2 100644
--- a/sim/mips/local.mk
+++ b/sim/mips/local.mk
@@ -24,11 +24,57 @@
noinst_PROGRAMS += %D%/run
-## TODO: Delete this once mips igen rules move here from Makefile.in.
-SIM_ALL_RECURSIVE_DEPS += $(IGEN)
-
%C%_SIM_EXTRA_HW_DEVICES = tx3904cpu tx3904irc tx3904tmr tx3904sio
AM_MAKEFLAGS += %C%_SIM_EXTRA_HW_DEVICES="$(%C%_SIM_EXTRA_HW_DEVICES)"
+%C%_BUILT_SRC_FROM_IGEN_ITABLE = \
+ %D%/itable.h \
+ %D%/itable.c
+%C%_BUILD_OUTPUTS = \
+ $(%C%_BUILT_SRC_FROM_IGEN_ITABLE) \
+ %D%/stamp-igen-itable
+
+## This makes sure build tools are available before building the arch-subdirs.
+SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
+
+$(%C%_BUILT_SRC_FROM_IGEN_ITABLE): %D%/stamp-igen-itable
+
+%C%_IGEN_TRACE = # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries # -G trace-all
+%C%_IGEN_INSN = $(srcdir)/%D%/mips.igen
+%C%_IGEN_INSN_INC = \
+ %D%/dsp.igen \
+ %D%/dsp2.igen \
+ %D%/m16.igen \
+ %D%/m16e.igen \
+ %D%/mdmx.igen \
+ %D%/micromipsdsp.igen \
+ %D%/micromips.igen \
+ %D%/mips3264r2.igen \
+ %D%/mips3264r6.igen \
+ %D%/mips3d.igen \
+ %D%/sb1.igen \
+ %D%/tx.igen \
+ %D%/vr.igen
+
+## NB: Since these can be built by a number of generators, care
+## must be taken to ensure that they are only dependant on
+## one of those generators.
+%D%/stamp-igen-itable: $(%C%_IGEN_INSN) $(%C%_IGEN_INSN_INC) $(IGEN)
+ $(AM_V_GEN)$(IGEN_RUN) \
+ $(%C%_IGEN_TRACE) \
+ -I $(srcdir)/%D% \
+ -Werror \
+ -Wnodiscard \
+ -Wnowidth \
+ -Wnounimplemented \
+ $(SIM_MIPS_IGEN_ITABLE_FLAGS) \
+ -G gen-direct-access \
+ -G gen-zero-r0 \
+ -i $(%C%_IGEN_INSN) \
+ -n itable.h -ht %D%/itable.h \
+ -n itable.c -t %D%/itable.c
+ $(AM_V_at)touch $@
+
+MOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS)
## These are created by mips/acinclude.m4 during configure time.
DISTCLEANFILES += %D%/multi-include.h %D%/multi-run.c