Update copyright year range in header of all files managed by GDB
[binutils-gdb.git] / sim / bpf / Makefile.in
blob7a17de8d47587fb6c96fc497840c677b53257522
1 # Makefile template for configure for the eBPF simulator
2 # Copyright (C) 2020-2023 Free Software Foundation, Inc.
4 # This file is part of GDB, the GNU debugger.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 ## COMMON_PRE_CONFIG_FRAG
21 CGEN_STD_OBJS = cgen-run.o cgen-scache.o cgen-trace.o cgen-utils.o
22 BPF_GEN_OBJS = arch.o cpu.o \
23 decode-le.o decode-be.o \
24 sem-le.o sem-be.o \
25 mloop-le.o mloop-be.o
26 BPF_HAND_OBJS = bpf.o sim-if.o traps.o bpf-helpers.o
28 SIM_OBJS = \
29 $(SIM_NEW_COMMON_OBJS) \
30 $(CGEN_STD_OBJS) \
31 $(BPF_GEN_OBJS) \
32 $(BPF_HAND_OBJS)
34 SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=64
36 SIM_EXTRA_CLEAN = bpf-clean
38 ## COMMON_POST_CONFIG_FRAG
40 # Dependencies for binaries from CGEN generated source
42 mloop-le.o: mloop-le.c
43 $(COMPILE) -DWANT_ISA_EBPFLE mloop-le.c
44 $(POSTCOMPILE)
45 mloop-be.o: mloop-be.c
46 $(COMPILE) -DWANT_ISA_EBPFBE mloop-be.c
47 $(POSTCOMPILE)
49 decode-le.o: decode-le.c
50 $(COMPILE) -DWANT_ISA_EBPFLE $(srcdir)/decode-le.c
51 $(POSTCOMPILE)
52 decode-be.o: decode-be.c
53 $(COMPILE) -DWANT_ISA_EBPFBE $(srcdir)/decode-be.c
54 $(POSTCOMPILE)
56 sem-le.o: sem-le.c
57 $(COMPILE) -DWANT_ISA_EBPFLE $(srcdir)/sem-le.c
58 $(POSTCOMPILE)
59 sem-be.o: sem-be.c
60 $(COMPILE) -DWANT_ISA_EBPFBE $(srcdir)/sem-be.c
61 $(POSTCOMPILE)
63 arch = bpf
65 CGEN_COMMON_DEPS = \
66 $(CGEN_READ_SCM) \
67 $(srcdir)/../../cpu/bpf.cpu \
68 $(srcdir)/../../cpu/bpf.opc \
69 Makefile
71 stamp-arch: $(CGEN_COMMON_DEPS) $(CGEN_ARCH_SCM)
72 $(MAKE) cgen-arch $(CGEN_FLAGS_TO_PASS) \
73 mach=bpf cpu=bpfbf \
74 archfile=$(srcdir)/../../cpu/bpf.cpu \
75 FLAGS="with-scache"
76 $(SILENCE) touch $@
77 $(srcdir)/arch.h $(srcdir)/arch.c $(srcdir)/cpuall.h: $(CGEN_MAINT) stamp-arch
78 @true
80 stamp-cpu: $(CGEN_COMMON_DEPS) $(CGEN_CPU_SCM)
81 $(MAKE) cgen-cpu $(CGEN_FLAGS_TO_PASS) \
82 isa=ebpfle,ebpfbe cpu=bpfbf mach=bpf \
83 archfile=$(srcdir)/../../cpu/bpf.cpu \
84 FLAGS="with-multiple-isa with-scache"
85 rm -f $(srcdir)/model.c
86 $(SILENCE) touch $@
87 $(srcdir)/cpu.h $(srcdir)/cpu.c $(srcdir)/model.c: $(CGEN_MAINT) stamp-cpu
88 @true
90 # We need to generate a group of files per ISA.
91 # For eBPF little-endian:
92 # defs-le.h
93 # sem-le.c, decode-le.c, decode-le.h
94 # $(objdir)/mloop-le.c $(objdir)/eng-le.h
95 # For eBPF big-endian:
96 # defs-be.h
97 # sem-be.c, decode-be.c, decode-be.h
98 # $(objdir)/mloop-be.c $(objdir)/eng-le.h
100 # The rules below take care of that.
102 stamp-defs-le: $(CGEN_COMMON_DEPS) $(CGEN_CPU_SCM)
103 $(MAKE) cgen-defs $(CGEN_FLAGS_TO_PASS) \
104 isa=ebpfle cpu=bpfbf mach=bpf \
105 archfile=$(srcdir)/../../cpu/bpf.cpu \
106 FLAGS="with-scache" \
107 SUFFIX="-le"
108 $(SILENCE) touch $@
109 $(srcdir)/defs-le.h: $(CGEN_MAINT) stamp-defs-le
110 @true
113 stamp-defs-be: $(CGEN_COMMON_DEPS) $(CGEN_CPU_SCM)
114 $(MAKE) cgen-defs $(CGEN_FLAGS_TO_PASS) \
115 isa=ebpfbe cpu=bpfbf mach=bpf \
116 archfile=$(srcdir)/../../cpu/bpf.cpu \
117 FLAGS="with-scache" \
118 SUFFIX="-be"
119 $(SILENCE) touch $@
120 $(srcdir)/defs-be.h: $(CGEN_MAINT) stamp-defs-be
121 @true
123 stamp-decode-le: $(CGEN_COMMON_DEPS) $(CGEN_CPU_SCM) $(GEN_DECODE_SCM)
124 $(MAKE) cgen-decode $(CGEN_FLAGS_TO_PASS) \
125 isa=ebpfle cpu=bpfbf mach=bpf \
126 archfile=$(srcdir)/../../cpu/bpf.cpu \
127 FLAGS="with-scache" \
128 SUFFIX="-le" \
129 EXTRAFILES="$(CGEN_CPU_SEM)"
130 $(SILENCE) touch $@
131 $(srcdir)/sem-le.c $(srcdir)/decode-le.c $(srcdir)/decode-le.h: \
132 $(CGEN_MAINT) stamp-decode-le
133 @true
136 stamp-decode-be: $(CGEN_COMMON_DEPS) $(CGEN_CPU_SCM) $(GEN_DECODE_SCM)
137 $(MAKE) cgen-decode $(CGEN_FLAGS_TO_PASS) \
138 isa=ebpfbe cpu=bpfbf mach=bpf \
139 archfile=$(srcdir)/../../cpu/bpf.cpu \
140 FLAGS="with-scache" \
141 SUFFIX="-be" \
142 EXTRAFILES="$(CGEN_CPU_SEM)"
143 $(SILENCE) touch $@
144 $(srcdir)/sem-be.c $(srcdir)/decode-be.c $(srcdir)/decode-be.h: \
145 $(CGEN_MAINT) stamp-decode-be
146 @true
148 .PHONY = bpf-clean
150 bpf-clean:
151 rm -f stamp-arch stamp-cpu stamp-decode stamp-defs