Commit | Line | Data |
---|---|---|
88b9d363 | 1 | # Copyright (C) 2007-2022 Free Software Foundation, Inc. |
fb1e4ffc DJ |
2 | |
3 | # This file is part of GDB. | |
4 | ||
5 | # This program is free software; you can redistribute it and/or modify | |
6 | # it under the terms of the GNU General Public License as published by | |
dcf7800b | 7 | # the Free Software Foundation; either version 3 of the License, or |
fb1e4ffc DJ |
8 | # (at your option) any later version. |
9 | # | |
10 | # This program is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | # GNU General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU General Public License | |
dcf7800b | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
fb1e4ffc DJ |
17 | |
18 | ||
19 | # This file requires GNU make! | |
20 | ||
21 | # This Makefile updates files in ../regformats from their XML master | |
22 | # copies. Because this relies on xsltproc, it is not normally run | |
23 | # during the build process; it should be run by hand when one of the | |
24 | # affected XML files is changed, and the results should be kept in the | |
25 | # GDB repository. | |
26 | ||
81adfced | 27 | # It can also update the C files in the features directory from their |
db74e4ba PA |
28 | # XML master copies. This relies on a GDB linked with expat and that |
29 | # is configured to include support for the architecture, so the files | |
30 | # are kept in the GDB repository. | |
31 | # | |
32 | # By default we'll generate all C files, and you must point make at a | |
33 | # GDB that has been configured with --enable-targets=all: | |
34 | # | |
35 | # make GDB=/path/to/gdb cfiles | |
36 | # | |
37 | # To regenerate all C files from scratch: | |
38 | # | |
39 | # make GDB=/path/to/gdb clean-cfiles cfiles | |
40 | # | |
89abbcc2 AH |
41 | # To generate specific C files, you can override the XMLTOC and |
42 | # FEATURE_XMLFILES make variables: | |
db74e4ba | 43 | # |
89abbcc2 | 44 | # make GDB=/path/to/gdb XMLTOC="xml files" FEATURE_XMLFILES="xml files" cfiles |
81adfced | 45 | |
89abbcc2 | 46 | # List of .dat files to create in ../regformats/ |
7d458ea5 | 47 | WHICH = mips-linux mips-dsp-linux \ |
164224e9 | 48 | microblaze-with-stack-protect \ |
1faeff08 | 49 | mips64-linux mips64-dsp-linux \ |
a1217d97 | 50 | nios2-linux \ |
0482b03b | 51 | rs6000/powerpc-32 \ |
7284e1be | 52 | rs6000/powerpc-32l rs6000/powerpc-altivec32l rs6000/powerpc-e500l \ |
604c2f83 | 53 | rs6000/powerpc-64l rs6000/powerpc-altivec64l rs6000/powerpc-vsx32l \ |
abf516c6 | 54 | rs6000/powerpc-vsx64l \ |
5878efd4 YQ |
55 | rs6000/powerpc-isa205-32l rs6000/powerpc-isa205-64l \ |
56 | rs6000/powerpc-isa205-altivec32l rs6000/powerpc-isa205-altivec64l \ | |
57 | rs6000/powerpc-isa205-vsx32l rs6000/powerpc-isa205-vsx64l \ | |
7ca18ed6 EBM |
58 | rs6000/powerpc-isa205-ppr-dscr-vsx32l \ |
59 | rs6000/powerpc-isa205-ppr-dscr-vsx64l \ | |
f2cf6173 | 60 | rs6000/powerpc-isa207-vsx32l rs6000/powerpc-isa207-vsx64l \ |
8d619c01 EBM |
61 | rs6000/powerpc-isa207-htm-vsx32l \ |
62 | rs6000/powerpc-isa207-htm-vsx64l \ | |
224bbe49 | 63 | s390-linux32 s390-linux64 s390x-linux64 \ |
c642a434 UW |
64 | s390-linux32v1 s390-linux64v1 s390x-linux64v1 \ |
65 | s390-linux32v2 s390-linux64v2 s390x-linux64v2 \ | |
446899e4 AA |
66 | s390-te-linux64 s390x-te-linux64 s390-vx-linux64 s390x-vx-linux64 \ |
67 | s390-tevx-linux64 s390x-tevx-linux64 \ | |
96235dc1 | 68 | s390-gs-linux64 s390x-gs-linux64 \ |
224bbe49 | 69 | tic6x-c64xp-linux tic6x-c64x-linux tic6x-c62x-linux |
fb1e4ffc DJ |
70 | |
71 | # Record which registers should be sent to GDB by default after stop. | |
07b287a0 | 72 | aarch64-expedite = x29,sp,pc |
58d6951d | 73 | arm-expedite = r11,sp,pc |
414c838a YQ |
74 | i386-expedite = ebp,esp,eip |
75 | amd64-expedite = rbp,rsp,rip | |
76 | x32-expedite = rbp,rsp,rip | |
58d6951d | 77 | mips-expedite = r29,pc |
1faeff08 | 78 | mips-dsp-expedite = r29,pc |
58d6951d | 79 | mips64-expedite = r29,pc |
1faeff08 | 80 | mips64-dsp-expedite = r29,pc |
449aa9df | 81 | microblaze-expedite = r1,rpc |
a1217d97 | 82 | nios2-linux-expedite = sp,pc |
a994fec4 | 83 | or1k-expedite = r1,npc |
58d6951d | 84 | powerpc-expedite = r1,pc |
7803799a | 85 | s390-linux32-expedite = r14,r15,pswa |
c642a434 UW |
86 | s390-linux32v1-expedite = r14,r15,pswa |
87 | s390-linux32v2-expedite = r14,r15,pswa | |
7803799a | 88 | s390-linux64-expedite = r14l,r15l,pswa |
c642a434 UW |
89 | s390-linux64v1-expedite = r14l,r15l,pswa |
90 | s390-linux64v2-expedite = r14l,r15l,pswa | |
d5552aab | 91 | s390-te-linux64-expedite = r14l,r15l,pswa |
446899e4 AA |
92 | s390-vx-linux64-expedite = r14l,r15l,pswa |
93 | s390-tevx-linux64-expedite = r14l,r15l,pswa | |
96235dc1 | 94 | s390-gs-linux64-expedite = r14,r15,pswa |
2399fe6a YQ |
95 | s390x-expedite = r14,r15,pswa |
96 | tic6x-expedite = A15,PC | |
604c2f83 | 97 | |
fb1e4ffc DJ |
98 | |
99 | XSLTPROC = xsltproc | |
100 | outdir = ../regformats | |
101 | OUTPUTS = $(patsubst %,$(outdir)/%.dat,$(WHICH)) | |
102 | ||
89abbcc2 AH |
103 | # For targets without feature based target descriptions, |
104 | # the set of xml files we'll generate .c files for GDB from. By | |
db74e4ba PA |
105 | # default we'll build all .c files, which requires an |
106 | # --enable-targets=all GDB. You can override this by passing XMLTOC | |
107 | # to make on the command line. | |
108 | XMLTOC = \ | |
db74e4ba PA |
109 | microblaze-with-stack-protect.xml \ |
110 | microblaze.xml \ | |
111 | mips-dsp-linux.xml \ | |
112 | mips-linux.xml \ | |
113 | mips64-dsp-linux.xml \ | |
114 | mips64-linux.xml \ | |
a28d8e50 | 115 | nds32.xml \ |
db74e4ba | 116 | nios2.xml \ |
a994fec4 | 117 | or1k.xml \ |
db74e4ba PA |
118 | rs6000/powerpc-32.xml \ |
119 | rs6000/powerpc-32l.xml \ | |
120 | rs6000/powerpc-403.xml \ | |
121 | rs6000/powerpc-403gc.xml \ | |
122 | rs6000/powerpc-405.xml \ | |
123 | rs6000/powerpc-505.xml \ | |
124 | rs6000/powerpc-601.xml \ | |
125 | rs6000/powerpc-602.xml \ | |
126 | rs6000/powerpc-603.xml \ | |
127 | rs6000/powerpc-604.xml \ | |
128 | rs6000/powerpc-64.xml \ | |
129 | rs6000/powerpc-64l.xml \ | |
130 | rs6000/powerpc-7400.xml \ | |
131 | rs6000/powerpc-750.xml \ | |
132 | rs6000/powerpc-860.xml \ | |
133 | rs6000/powerpc-altivec32.xml \ | |
134 | rs6000/powerpc-altivec32l.xml \ | |
135 | rs6000/powerpc-altivec64.xml \ | |
136 | rs6000/powerpc-altivec64l.xml \ | |
db74e4ba PA |
137 | rs6000/powerpc-e500.xml \ |
138 | rs6000/powerpc-e500l.xml \ | |
139 | rs6000/powerpc-isa205-32l.xml \ | |
140 | rs6000/powerpc-isa205-64l.xml \ | |
141 | rs6000/powerpc-isa205-altivec32l.xml \ | |
142 | rs6000/powerpc-isa205-altivec64l.xml \ | |
143 | rs6000/powerpc-isa205-vsx32l.xml \ | |
144 | rs6000/powerpc-isa205-vsx64l.xml \ | |
7ca18ed6 EBM |
145 | rs6000/powerpc-isa205-ppr-dscr-vsx32l.xml \ |
146 | rs6000/powerpc-isa205-ppr-dscr-vsx64l.xml \ | |
f2cf6173 EBM |
147 | rs6000/powerpc-isa207-vsx32l.xml \ |
148 | rs6000/powerpc-isa207-vsx64l.xml \ | |
8d619c01 EBM |
149 | rs6000/powerpc-isa207-htm-vsx32l.xml \ |
150 | rs6000/powerpc-isa207-htm-vsx64l.xml \ | |
db74e4ba PA |
151 | rs6000/powerpc-vsx32.xml \ |
152 | rs6000/powerpc-vsx32l.xml \ | |
153 | rs6000/powerpc-vsx64.xml \ | |
154 | rs6000/powerpc-vsx64l.xml \ | |
155 | rs6000/rs6000.xml \ | |
ab33b152 | 156 | rx.xml \ |
db74e4ba PA |
157 | s390-linux32.xml \ |
158 | s390-linux32v1.xml \ | |
159 | s390-linux32v2.xml \ | |
160 | s390-linux64.xml \ | |
161 | s390-linux64v1.xml \ | |
162 | s390-linux64v2.xml \ | |
163 | s390-te-linux64.xml \ | |
164 | s390x-linux64.xml \ | |
165 | s390x-linux64v1.xml \ | |
166 | s390x-linux64v2.xml \ | |
167 | s390x-te-linux64.xml \ | |
defaaad5 YQ |
168 | s390-tevx-linux64.xml \ |
169 | s390-vx-linux64.xml \ | |
170 | s390x-tevx-linux64.xml \ | |
171 | s390x-vx-linux64.xml \ | |
96235dc1 | 172 | s390-gs-linux64.xml \ |
28b48aa1 SB |
173 | s390x-gs-linux64.xml \ |
174 | z80.xml | |
db74e4ba | 175 | |
25aa13e5 | 176 | TDESC_CFILES = $(patsubst %.xml,%.c,$(XMLTOC)) |
81adfced DJ |
177 | GDB = false |
178 | ||
ad7fc756 AH |
179 | #Targets which use feature based target descriptions. |
180 | aarch64-feature = 1 | |
89abbcc2 | 181 | arm-feature = 1 |
ad7fc756 | 182 | i386-feature = 1 |
b5ffee31 | 183 | riscv-feature = 1 |
ad7fc756 AH |
184 | tic6x-feature = 1 |
185 | ||
fb1e4ffc DJ |
186 | all: $(OUTPUTS) |
187 | ||
188 | $(outdir)/%.dat: %.xml number-regs.xsl sort-regs.xsl gdbserver-regs.xsl | |
5fdeec1d PA |
189 | echo "# THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi :set ro:" > $(outdir)/$*.tmp |
190 | echo "# Generated from: $<" >> $(outdir)/$*.tmp | |
30ed0a8f | 191 | echo "name:`echo $(notdir $*) | sed 's/-/_/g'`" >> $(outdir)/$*.tmp |
ad7fc756 | 192 | $(if $($(firstword $(subst /, ,$(subst -, ,$*)))-feature), echo "feature:1") >> $(outdir)/$*.tmp |
221c031f | 193 | echo "xmltarget:$(<F)" >> $(outdir)/$*.tmp |
f4d9bade UW |
194 | echo "expedite:$(if $($*-expedite),$($*-expedite),$($(firstword $(subst -, ,$(notdir $*)))-expedite))" \ |
195 | >> $(outdir)/$*.tmp | |
30ed0a8f | 196 | $(XSLTPROC) --path "$(PWD)" --xinclude number-regs.xsl $< | \ |
fb1e4ffc DJ |
197 | $(XSLTPROC) sort-regs.xsl - | \ |
198 | $(XSLTPROC) gdbserver-regs.xsl - >> $(outdir)/$*.tmp | |
199 | sh ../../move-if-change $(outdir)/$*.tmp $(outdir)/$*.dat | |
200 | ||
89abbcc2 AH |
201 | # For targets with feature based target descriptions, |
202 | # the set of xml files we'll generate .c files for GDB from. | |
49bdb7ee AH |
203 | FEATURE_XMLFILES = aarch64-core.xml \ |
204 | aarch64-fpu.xml \ | |
6dc0ebde | 205 | aarch64-pauth.xml \ |
c1bd443b | 206 | aarch64-mte.xml \ |
995d3a19 SV |
207 | arc/v1-core.xml \ |
208 | arc/v1-aux.xml \ | |
209 | arc/v2-core.xml \ | |
210 | arc/v2-aux.xml \ | |
89abbcc2 AH |
211 | arm/arm-core.xml \ |
212 | arm/arm-fpa.xml \ | |
213 | arm/arm-m-profile.xml \ | |
214 | arm/arm-m-profile-with-fpa.xml \ | |
215 | arm/arm-vfpv2.xml \ | |
216 | arm/arm-vfpv3.xml \ | |
217 | arm/xscale-iwmmxt.xml \ | |
49bdb7ee | 218 | i386/32bit-core.xml \ |
25aa13e5 YQ |
219 | i386/32bit-sse.xml \ |
220 | i386/32bit-linux.xml \ | |
221 | i386/32bit-avx.xml \ | |
222 | i386/32bit-mpx.xml \ | |
223 | i386/32bit-avx512.xml \ | |
6c73f67f YQ |
224 | i386/32bit-pkeys.xml \ |
225 | i386/64bit-avx512.xml \ | |
226 | i386/64bit-core.xml \ | |
227 | i386/64bit-mpx.xml \ | |
228 | i386/64bit-segments.xml \ | |
229 | i386/64bit-avx.xml \ | |
230 | i386/64bit-linux.xml \ | |
231 | i386/64bit-pkeys.xml \ | |
232 | i386/64bit-sse.xml \ | |
506fe5f4 | 233 | i386/x32-core.xml \ |
25428040 | 234 | riscv/rv32e-xregs.xml \ |
b5ffee31 | 235 | riscv/32bit-cpu.xml \ |
b5ffee31 AB |
236 | riscv/32bit-fpu.xml \ |
237 | riscv/64bit-cpu.xml \ | |
b5ffee31 | 238 | riscv/64bit-fpu.xml \ |
506fe5f4 YQ |
239 | tic6x-c6xp.xml \ |
240 | tic6x-core.xml \ | |
241 | tic6x-gp.xml | |
25aa13e5 YQ |
242 | |
243 | FEATURE_CFILES = $(patsubst %.xml,%.c,$(FEATURE_XMLFILES)) | |
244 | ||
245 | cfiles: $(TDESC_CFILES) $(FEATURE_CFILES) | |
246 | ||
247 | $(TDESC_CFILES): %.c: %.xml | |
8e2141c6 | 248 | $(GDB) -nx -q -batch -ex 'maint print c-tdesc $<' > $@.tmp |
81adfced DJ |
249 | sh ../../move-if-change $@.tmp $@ |
250 | ||
25aa13e5 YQ |
251 | $(FEATURE_CFILES): %.c: %.xml.tmp |
252 | $(GDB) -nx -q -batch \ | |
ab33b152 | 253 | -ex 'maint print c-tdesc -single-feature $<' > $@.tmp |
25aa13e5 YQ |
254 | sh ../../move-if-change $@.tmp $@ |
255 | rm $< | |
256 | ||
257 | # %.xml is the XML file for each target description feature, and | |
258 | # %.xml.tmp is the XML file target description which only includes | |
259 | # one target description feature. | |
260 | ||
261 | %.xml.tmp: %.xml | |
262 | echo "<?xml version=\"1.0\"?>" > $@.tmp | |
263 | echo "<!DOCTYPE target SYSTEM \"gdb-target.dtd\">" >> $@.tmp | |
264 | echo "<target>" >> $@.tmp | |
265 | echo " <xi:include href=\"$(notdir $<)\"/>" >> $@.tmp | |
266 | echo "</target>" >> $@.tmp | |
267 | sh ../../move-if-change $@.tmp $@ | |
268 | ||
db74e4ba PA |
269 | # 'all' doesn't build the C files, so don't delete them in 'clean' |
270 | # either. | |
271 | clean-cfiles: | |
25aa13e5 | 272 | rm -f $(TDESC_CFILES) $(FEATURE_CFILES) |
db74e4ba | 273 | |
acc9fe45 PA |
274 | clean: |
275 | rm -f $(OUTPUTS) |