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 1/9] sim: cgen: hoist rules to the top-level build
Date: Sun,  1 Jan 2023 23:32:01 -0500	[thread overview]
Message-ID: <20230102043209.21542-1-vapier@gentoo.org> (raw)

The rules seem to generate the same output as existing subdir cgen
rules with cgen ports, so hopefully this should be correct.  These
are the last set of codegen rules that we run in subdirs, so this
will help unblock killing off subdir builds entirely.
---
 sim/Makefile.in     | 53 +++++++++++++++++++++++++++++++++++++++
 sim/common/local.mk | 60 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 113 insertions(+)

diff --git a/sim/common/local.mk b/sim/common/local.mk
index dde24810e575..22917e0f8a64 100644
--- a/sim/common/local.mk
+++ b/sim/common/local.mk
@@ -142,3 +142,63 @@ SIM_COMMON_LIBS = \
 	$(LIBIBERTY_LIB) \
 	$(LIBGNU) \
 	$(LIBGNU_EXTRA_LIBS)
+
+##
+## CGEN support.
+##
+
+## If the local tree has a bundled copy of guile, use that.
+GUILE = $(or $(wildcard ../guile/libguile/guile),guile)
+CGEN = "$(GUILE) -l $(cgendir)/guile.scm -s"
+CGENFLAGS = -v
+CGEN_CPU_DIR = $(cgendir)/cpu
+## Most ports use the files here instead of cgen/cpu.
+CPU_DIR = $(srcroot)/cpu
+CGEN_ARCHFILE = $(CPU_DIR)/$(@D).cpu
+
+CGEN_READ_SCM = $(cgendir)/sim.scm
+CGEN_ARCH_SCM = $(cgendir)/sim-arch.scm
+CGEN_CPU_SCM = $(cgendir)/sim-cpu.scm $(cgendir)/sim-model.scm
+CGEN_DECODE_SCM = $(cgendir)/sim-decode.scm
+CGEN_DESC_SCM = $(cgendir)/desc.scm $(cgendir)/desc-cpu.scm
+
+## Various choices for which cpu specific files to generate.
+## These are passed to cgen.sh in the "extrafiles" argument.
+CGEN_CPU_EXTR = /extr/
+CGEN_CPU_READ = /read/
+CGEN_CPU_WRITE = /write/
+CGEN_CPU_SEM = /sem/
+CGEN_CPU_SEMSW = /semsw/
+
+CGEN_WRAPPER = $(srccom)/cgen.sh
+
+CGEN_GEN_ARCH = \
+	$(SHELL) $(CGEN_WRAPPER) arch $(srcdir)/$(@D) \
+		$(CGEN) $(cgendir) "$(CGENFLAGS)" \
+		$(@D) "$$FLAGS" ignored "$$isa" $$mach ignored \
+		$(CGEN_ARCHFILE) ignored
+CGEN_GEN_CPU = \
+	$(SHELL) $(CGEN_WRAPPER) cpu $(srcdir)/$(@D) \
+		$(CGEN) $(cgendir) "$(CGENFLAGS)" \
+		$(@D) "$$FLAGS" $$cpu "$$isa" $$mach "$$SUFFIX" \
+		$(CGEN_ARCHFILE) "$$EXTRAFILES"
+CGEN_GEN_DEFS = \
+	$(SHELL) $(CGEN_WRAPPER) defs $(srcdir)/$(@D) \
+		$(CGEN) $(cgendir) "$(CGENFLAGS)" \
+		$(@D) "$$FLAGS" $$cpu "$$isa" $$mach "$$SUFFIX" \
+		$(CGEN_ARCHFILE) ignored
+CGEN_GEN_DECODE = \
+	$(SHELL) $(CGEN_WRAPPER) decode $(srcdir)/$(@D) \
+		$(CGEN) $(cgendir) "$(CGENFLAGS)" \
+		$(@D) "$$FLAGS" $$cpu "$$isa" $$mach "$$SUFFIX" \
+		$(CGEN_ARCHFILE) "$$EXTRAFILES"
+CGEN_GEN_CPU_DECODE = \
+	$(SHELL) $(CGEN_WRAPPER) cpu-decode $(srcdir)/$(@D) \
+		$(CGEN) $(cgendir) "$(CGENFLAGS)" \
+		$(@D) "$$FLAGS" $$cpu "$$isa" $$mach "$$SUFFIX" \
+		$(CGEN_ARCHFILE) "$$EXTRAFILES"
+CGEN_GEN_CPU_DESC = \
+	$(SHELL) $(CGEN_WRAPPER) desc $(srcdir)/$(@D) \
+		$(CGEN) $(cgendir) "$(CGENFLAGS)" \
+		$(@D) "$$FLAGS" $$cpu "$$isa" $$mach "$$SUFFIX" \
+		$(CGEN_ARCHFILE) ignored $$opcfile
-- 
2.39.0


             reply	other threads:[~2023-01-02  4:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-02  4:32 Mike Frysinger [this message]
2023-01-02  4:32 ` [PATCH 2/9] sim: bpf: hoist cgen rules to top-level Mike Frysinger
2023-01-02  4:32 ` [PATCH 3/9] sim: cris: " Mike Frysinger
2023-01-02  4:32 ` [PATCH 4/9] sim: frv: " Mike Frysinger
2023-01-02  4:32 ` [PATCH 5/9] sim: iq2000: " Mike Frysinger
2023-01-02  4:32 ` [PATCH 6/9] sim: lm32: " Mike Frysinger
2023-01-02  4:32 ` [PATCH 7/9] sim: m32r: " Mike Frysinger
2023-01-02  4:32 ` [PATCH 8/9] sim: or1k: " Mike Frysinger
2023-01-02  4:32 ` [PATCH 9/9] sim: cgen: drop common subdir build rules 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=20230102043209.21542-1-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).