public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 3/8] sim: mips: hoist itable igen rules up to common builds
Date: Sun, 25 Dec 2022 14:28:47 -0500	[thread overview]
Message-ID: <20221225192852.1940-3-vapier@gentoo.org> (raw)
In-Reply-To: <20221225192852.1940-1-vapier@gentoo.org>

Since this rule is pretty simple, hoist it up to the common build.
---
 sim/Makefile.in      | 98 ++++++++++++++++++++++++++++++++------------
 sim/mips/Makefile.in | 33 +--------------
 sim/mips/local.mk    | 52 +++++++++++++++++++++--
 3 files changed, 121 insertions(+), 62 deletions(-)

diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in
index 4cd596421190..187f574f2496 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 21a6f5cb56b1..beed8f28a169 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
-- 
2.39.0


  parent reply	other threads:[~2022-12-25 19:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-25  7:28 [PATCH] sim: mips: drop unused micromips igen logic Mike Frysinger
2022-12-25 19:28 ` [PATCH 1/8] sim: mips: rename multi_flags to igen_itable_flags Mike Frysinger
2022-12-25 19:28   ` [PATCH 2/8] sim: mips: unify itable generation (a bit) Mike Frysinger
2022-12-25 19:28   ` Mike Frysinger [this message]
2022-12-25 19:28   ` [PATCH 4/8] sim: mips: rename "igen" generation mode to "single" Mike Frysinger
2022-12-25 19:28   ` [PATCH 5/8] sim: mips: hoist "single" igen rules up to common builds Mike Frysinger
2022-12-25 19:28   ` [PATCH 6/8] sim: mips: hoist "m16" " Mike Frysinger
2022-12-25 19:28   ` [PATCH 7/8] sim: mips: hoist "multi" " Mike Frysinger
2022-12-25 19:28   ` [PATCH 8/8] sim: build: clean up unused codegen logic Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221225192852.1940-3-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).