From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/9] sim: bpf: hoist cgen rules to top-level
Date: Sun, 1 Jan 2023 23:32:02 -0500 [thread overview]
Message-ID: <20230102043209.21542-2-vapier@gentoo.org> (raw)
In-Reply-To: <20230102043209.21542-1-vapier@gentoo.org>
---
sim/Makefile.in | 25 +++++++++++++
sim/bpf/Makefile.in | 90 ---------------------------------------------
sim/bpf/local.mk | 37 +++++++++++++++++++
3 files changed, 62 insertions(+), 90 deletions(-)
diff --git a/sim/bpf/Makefile.in b/sim/bpf/Makefile.in
index 7a17de8d4758..2732a0e6071e 100644
--- a/sim/bpf/Makefile.in
+++ b/sim/bpf/Makefile.in
@@ -33,8 +33,6 @@ SIM_OBJS = \
SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=64
-SIM_EXTRA_CLEAN = bpf-clean
-
## COMMON_POST_CONFIG_FRAG
# Dependencies for binaries from CGEN generated source
@@ -61,91 +59,3 @@ sem-be.o: sem-be.c
$(POSTCOMPILE)
arch = bpf
-
-CGEN_COMMON_DEPS = \
- $(CGEN_READ_SCM) \
- $(srcdir)/../../cpu/bpf.cpu \
- $(srcdir)/../../cpu/bpf.opc \
- Makefile
-
-stamp-arch: $(CGEN_COMMON_DEPS) $(CGEN_ARCH_SCM)
- $(MAKE) cgen-arch $(CGEN_FLAGS_TO_PASS) \
- mach=bpf cpu=bpfbf \
- archfile=$(srcdir)/../../cpu/bpf.cpu \
- FLAGS="with-scache"
- $(SILENCE) touch $@
-$(srcdir)/arch.h $(srcdir)/arch.c $(srcdir)/cpuall.h: $(CGEN_MAINT) stamp-arch
- @true
-
-stamp-cpu: $(CGEN_COMMON_DEPS) $(CGEN_CPU_SCM)
- $(MAKE) cgen-cpu $(CGEN_FLAGS_TO_PASS) \
- isa=ebpfle,ebpfbe cpu=bpfbf mach=bpf \
- archfile=$(srcdir)/../../cpu/bpf.cpu \
- FLAGS="with-multiple-isa with-scache"
- rm -f $(srcdir)/model.c
- $(SILENCE) touch $@
-$(srcdir)/cpu.h $(srcdir)/cpu.c $(srcdir)/model.c: $(CGEN_MAINT) stamp-cpu
- @true
-
-# We need to generate a group of files per ISA.
-# For eBPF little-endian:
-# defs-le.h
-# sem-le.c, decode-le.c, decode-le.h
-# $(objdir)/mloop-le.c $(objdir)/eng-le.h
-# For eBPF big-endian:
-# defs-be.h
-# sem-be.c, decode-be.c, decode-be.h
-# $(objdir)/mloop-be.c $(objdir)/eng-le.h
-#
-# The rules below take care of that.
-
-stamp-defs-le: $(CGEN_COMMON_DEPS) $(CGEN_CPU_SCM)
- $(MAKE) cgen-defs $(CGEN_FLAGS_TO_PASS) \
- isa=ebpfle cpu=bpfbf mach=bpf \
- archfile=$(srcdir)/../../cpu/bpf.cpu \
- FLAGS="with-scache" \
- SUFFIX="-le"
- $(SILENCE) touch $@
-$(srcdir)/defs-le.h: $(CGEN_MAINT) stamp-defs-le
- @true
-
-
-stamp-defs-be: $(CGEN_COMMON_DEPS) $(CGEN_CPU_SCM)
- $(MAKE) cgen-defs $(CGEN_FLAGS_TO_PASS) \
- isa=ebpfbe cpu=bpfbf mach=bpf \
- archfile=$(srcdir)/../../cpu/bpf.cpu \
- FLAGS="with-scache" \
- SUFFIX="-be"
- $(SILENCE) touch $@
-$(srcdir)/defs-be.h: $(CGEN_MAINT) stamp-defs-be
- @true
-
-stamp-decode-le: $(CGEN_COMMON_DEPS) $(CGEN_CPU_SCM) $(GEN_DECODE_SCM)
- $(MAKE) cgen-decode $(CGEN_FLAGS_TO_PASS) \
- isa=ebpfle cpu=bpfbf mach=bpf \
- archfile=$(srcdir)/../../cpu/bpf.cpu \
- FLAGS="with-scache" \
- SUFFIX="-le" \
- EXTRAFILES="$(CGEN_CPU_SEM)"
- $(SILENCE) touch $@
-$(srcdir)/sem-le.c $(srcdir)/decode-le.c $(srcdir)/decode-le.h: \
- $(CGEN_MAINT) stamp-decode-le
- @true
-
-
-stamp-decode-be: $(CGEN_COMMON_DEPS) $(CGEN_CPU_SCM) $(GEN_DECODE_SCM)
- $(MAKE) cgen-decode $(CGEN_FLAGS_TO_PASS) \
- isa=ebpfbe cpu=bpfbf mach=bpf \
- archfile=$(srcdir)/../../cpu/bpf.cpu \
- FLAGS="with-scache" \
- SUFFIX="-be" \
- EXTRAFILES="$(CGEN_CPU_SEM)"
- $(SILENCE) touch $@
-$(srcdir)/sem-be.c $(srcdir)/decode-be.c $(srcdir)/decode-be.h: \
- $(CGEN_MAINT) stamp-decode-be
- @true
-
-.PHONY = bpf-clean
-
-bpf-clean:
- rm -f stamp-arch stamp-cpu stamp-decode stamp-defs
diff --git a/sim/bpf/local.mk b/sim/bpf/local.mk
index 7382f6163bc2..fabf77ec67bd 100644
--- a/sim/bpf/local.mk
+++ b/sim/bpf/local.mk
@@ -55,3 +55,40 @@ SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
$(AM_V_at)touch $@
MOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS)
+
+%D%/cgen-arch:
+ $(AM_V_GEN)mach=bpf cpu=bpfbf FLAGS="with-scache"; $(CGEN_GEN_ARCH)
+%D%/arch.h %D%/arch.c %D%/cpuall.h: @CGEN_MAINT@ %D%/cgen-arch
+
+%D%/cgen-cpu:
+ $(AM_V_GEN)isa=ebpfle,ebpfbe cpu=bpfbf mach=bpf FLAGS="with-multiple-isa with-scache"; $(CGEN_GEN_CPU)
+ $(AM_V_at)rm -f $(srcdir)/%D%/model.c
+%D%/cpu.h %D%/cpu.c %D%/model.c: @CGEN_MAINT@ %D%/cgen-cpu
+
+## We need to generate a group of files per ISA.
+## For eBPF little-endian:
+## defs-le.h
+## sem-le.c, decode-le.c, decode-le.h
+## $(objdir)/mloop-le.c $(objdir)/eng-le.h
+## For eBPF big-endian:
+## defs-be.h
+## sem-be.c, decode-be.c, decode-be.h
+## $(objdir)/mloop-be.c $(objdir)/eng-le.h
+##
+## The rules below take care of that.
+
+%D%/cgen-defs-le:
+ $(AM_V_GEN)isa=ebpfle cpu=bpfbf mach=bpf FLAGS="with-scache" SUFFIX="-le"; $(CGEN_GEN_DEFS)
+%D%/defs-le.h: @CGEN_MAINT@ %D%/cgen-defs-le
+
+%D%/cgen-defs-be:
+ $(AM_V_GEN)isa=ebpfbe cpu=bpfbf mach=bpf FLAGS="with-scache" SUFFIX="-be"; $(CGEN_GEN_DEFS)
+%D%/defs-be.h: @CGEN_MAINT@ %D%/cgen-defs-be
+
+%D%/cgen-decode-le:
+ $(AM_V_GEN)isa=ebpfle cpu=bpfbf mach=bpf FLAGS="with-scache" SUFFIX="-le" EXTRAFILES="$(CGEN_CPU_SEM)"; $(CGEN_GEN_DECODE)
+%D%/sem-le.c %D%/decode-le.c %D%/decode-le.h: @CGEN_MAINT@ %D%/cgen-decode-vle
+
+%D%/cgen-decode-be:
+ $(AM_V_GEN)isa=ebpfbe cpu=bpfbf mach=bpf FLAGS="with-scache" SUFFIX="-be" EXTRAFILES="$(CGEN_CPU_SEM)"; $(CGEN_GEN_DECODE)
+%D%/sem-be.c %D%/decode-be.c %D%/decode-be.h: @CGEN_MAINT@ %D%/cgen-decode-be
--
2.39.0
next prev parent 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 [PATCH 1/9] sim: cgen: hoist rules to the top-level build Mike Frysinger
2023-01-02 4:32 ` Mike Frysinger [this message]
2023-01-02 4:32 ` [PATCH 3/9] sim: cris: hoist cgen rules to top-level 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-2-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).