aboutsummaryrefslogtreecommitdiff
path: root/sim/bpf
diff options
context:
space:
mode:
Diffstat (limited to 'sim/bpf')
-rw-r--r--sim/bpf/Makefile.in90
-rw-r--r--sim/bpf/local.mk40
2 files changed, 40 insertions, 90 deletions
diff --git a/sim/bpf/Makefile.in b/sim/bpf/Makefile.in
index 7a17de8..2732a0e 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 7382f61..7221daf 100644
--- a/sim/bpf/local.mk
+++ b/sim/bpf/local.mk
@@ -55,3 +55,43 @@ SIM_ALL_RECURSIVE_DEPS += $(%C%_BUILD_OUTPUTS)
$(AM_V_at)touch $@
MOSTLYCLEANFILES += $(%C%_BUILD_OUTPUTS)
+
+## Target that triggers all cgen targets that works when --disable-cgen-maint.
+%D%/cgen: %D%/cgen-arch %D%/cgen-cpu %D%/cgen-defs-le %D%/cgen-defs-be %D%/cgen-decode-le %D%/cgen-decode-be
+
+%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