1 # Copyright (C) 2007-2017 Free Software Foundation, Inc.
3 # This file is part of GDB.
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
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
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.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 # This file requires GNU make!
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
27 # It can also update the C files in the features directory from their
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.
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:
35 # make GDB=/path/to/gdb cfiles
37 # To regenerate all C files from scratch:
39 # make GDB=/path/to/gdb clean-cfiles cfiles
41 # To generate specific C files, you can override the XMLTOC make
44 # make GDB=/path/to/gdb XMLTOC="xml files" cfiles
47 arm
/arm-with-iwmmxt arm
/arm-with-vfpv2 arm
/arm-with-vfpv3 \
49 i386
/i386 i386
/i386-linux \
51 i386
/amd64 i386
/amd64-linux \
54 i386
/i386-avx-mpx-linux \
55 i386
/i386-avx-avx512-linux \
56 i386
/i386-avx-mpx-avx512-pku-linux \
57 i386
/amd64-avx-linux \
58 i386
/amd64-mpx-linux \
59 i386
/amd64-avx-mpx-linux \
60 i386
/amd64-avx-avx512-linux \
61 i386
/amd64-avx-mpx-avx512-pku-linux \
64 i386
/x32-avx-avx512-linux \
65 mips-linux mips-dsp-linux \
66 microblaze-with-stack-protect \
67 mips64-linux mips64-dsp-linux \
70 rs6000
/powerpc-32l rs6000
/powerpc-altivec32l rs6000
/powerpc-e500l \
71 rs6000
/powerpc-64l rs6000
/powerpc-altivec64l rs6000
/powerpc-vsx32l \
72 rs6000
/powerpc-vsx64l rs6000
/powerpc-cell32l rs6000
/powerpc-cell64l \
73 rs6000
/powerpc-isa205-32l rs6000
/powerpc-isa205-64l \
74 rs6000
/powerpc-isa205-altivec32l rs6000
/powerpc-isa205-altivec64l \
75 rs6000
/powerpc-isa205-vsx32l rs6000
/powerpc-isa205-vsx64l \
76 s390-linux32 s390-linux64 s390x-linux64 \
77 s390-linux32v1 s390-linux64v1 s390x-linux64v1 \
78 s390-linux32v2 s390-linux64v2 s390x-linux64v2 \
79 s390-te-linux64 s390x-te-linux64 s390-vx-linux64 s390x-vx-linux64 \
80 s390-tevx-linux64 s390x-tevx-linux64 \
81 tic6x-c64xp tic6x-c64x tic6x-c62x \
82 tic6x-c64xp-linux tic6x-c64x-linux tic6x-c62x-linux
84 # Record which registers should be sent to GDB by default after stop.
85 aarch64-expedite
= x29
,sp
,pc
86 arm-expedite
= r11
,sp
,pc
87 i386-expedite
= ebp
,esp
,eip
88 amd64-expedite
= rbp
,rsp
,rip
89 x32-expedite
= rbp
,rsp
,rip
90 mips-expedite
= r29
,pc
91 mips-dsp-expedite
= r29
,pc
92 mips64-expedite
= r29
,pc
93 mips64-dsp-expedite
= r29
,pc
94 microblaze-expedite
= r1
,rpc
95 nios2-linux-expedite
= sp
,pc
96 powerpc-expedite
= r1
,pc
97 rs6000
/powerpc-cell32l-expedite
= r1
,pc,r0
,orig_r3
,r4
98 rs6000
/powerpc-cell64l-expedite
= r1
,pc,r0
,orig_r3
,r4
99 s390-linux32-expedite
= r14
,r15
,pswa
100 s390-linux32v1-expedite
= r14
,r15
,pswa
101 s390-linux32v2-expedite
= r14
,r15
,pswa
102 s390-linux64-expedite
= r14l
,r15l
,pswa
103 s390-linux64v1-expedite
= r14l
,r15l
,pswa
104 s390-linux64v2-expedite
= r14l
,r15l
,pswa
105 s390-te-linux64-expedite
= r14l
,r15l
,pswa
106 s390-vx-linux64-expedite
= r14l
,r15l
,pswa
107 s390-tevx-linux64-expedite
= r14l
,r15l
,pswa
108 s390x-linux64-expedite
= r14
,r15
,pswa
109 s390x-linux64v1-expedite
= r14
,r15
,pswa
110 s390x-linux64v2-expedite
= r14
,r15
,pswa
111 s390x-te-linux64-expedite
= r14
,r15
,pswa
112 s390x-vx-linux64-expedite
= r14
,r15
,pswa
113 s390x-tevx-linux64-expedite
= r14
,r15
,pswa
114 tic6x-c64xp-expedite
= A15
,PC
115 tic6x-c64x-expedite
= A15
,PC
116 tic6x-c62x-expedite
= A15
,PC
117 tic6x-c64xp-linux-expedite
= A15
,PC
118 tic6x-c64x-linux-expedite
= A15
,PC
119 tic6x-c62x-linux-expedite
= A15
,PC
123 outdir
= ..
/regformats
124 OUTPUTS
= $(patsubst %,$(outdir
)/%.dat
,$(WHICH
))
126 # The set of xml files we'll generate .c files for GDB from. By
127 # default we'll build all .c files, which requires an
128 # --enable-targets=all GDB. You can override this by passing XMLTOC
129 # to make on the command line.
134 arm
/arm-with-iwmmxt.xml \
135 arm
/arm-with-m-fpa-layout.xml \
136 arm
/arm-with-m-vfp-d16.xml \
138 arm
/arm-with-neon.xml \
139 arm
/arm-with-vfpv2.xml \
140 arm
/arm-with-vfpv3.xml \
141 i386
/amd64-avx-linux.xml \
143 i386
/amd64-avx-avx512-linux.xml \
144 i386
/amd64-avx-avx512.xml \
145 i386
/amd64-avx-mpx-avx512-pku-linux.xml \
146 i386
/amd64-avx-mpx-avx512-pku.xml \
147 i386
/amd64-linux.xml \
148 i386
/amd64-mpx-linux.xml \
150 i386
/amd64-avx-mpx-linux.xml \
151 i386
/amd64-avx-mpx.xml \
154 i386
/i386-avx-avx512.xml \
155 i386
/i386-avx-mpx-avx512-pku.xml \
158 i386
/i386-avx-mpx.xml \
160 i386
/x32-avx-linux.xml \
161 i386
/x32-avx-avx512-linux.xml \
163 microblaze-with-stack-protect.xml \
167 mips64-dsp-linux.xml \
172 rs6000
/powerpc-32.xml \
173 rs6000
/powerpc-32l.xml \
174 rs6000
/powerpc-403.xml \
175 rs6000
/powerpc-403gc.xml \
176 rs6000
/powerpc-405.xml \
177 rs6000
/powerpc-505.xml \
178 rs6000
/powerpc-601.xml \
179 rs6000
/powerpc-602.xml \
180 rs6000
/powerpc-603.xml \
181 rs6000
/powerpc-604.xml \
182 rs6000
/powerpc-64.xml \
183 rs6000
/powerpc-64l.xml \
184 rs6000
/powerpc-7400.xml \
185 rs6000
/powerpc-750.xml \
186 rs6000
/powerpc-860.xml \
187 rs6000
/powerpc-altivec32.xml \
188 rs6000
/powerpc-altivec32l.xml \
189 rs6000
/powerpc-altivec64.xml \
190 rs6000
/powerpc-altivec64l.xml \
191 rs6000
/powerpc-cell32l.xml \
192 rs6000
/powerpc-cell64l.xml \
193 rs6000
/powerpc-e500.xml \
194 rs6000
/powerpc-e500l.xml \
195 rs6000
/powerpc-isa205-32l.xml \
196 rs6000
/powerpc-isa205-64l.xml \
197 rs6000
/powerpc-isa205-altivec32l.xml \
198 rs6000
/powerpc-isa205-altivec64l.xml \
199 rs6000
/powerpc-isa205-vsx32l.xml \
200 rs6000
/powerpc-isa205-vsx64l.xml \
201 rs6000
/powerpc-vsx32.xml \
202 rs6000
/powerpc-vsx32l.xml \
203 rs6000
/powerpc-vsx64.xml \
204 rs6000
/powerpc-vsx64l.xml \
212 s390-te-linux64.xml \
214 s390x-linux64v1.xml \
215 s390x-linux64v2.xml \
216 s390x-te-linux64.xml \
217 s390-tevx-linux64.xml \
218 s390-vx-linux64.xml \
219 s390x-tevx-linux64.xml \
220 s390x-vx-linux64.xml \
221 tic6x-c62x-linux.xml \
223 tic6x-c64x-linux.xml \
225 tic6x-c64xp-linux.xml \
228 TDESC_CFILES
= $(patsubst %.xml
,%.c
,$(XMLTOC
))
233 $(outdir
)/%.dat
: %.xml number-regs.xsl sort-regs.xsl gdbserver-regs.xsl
234 echo
"# THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi :set ro:" > $(outdir
)/$*.tmp
235 echo
"# Generated from: $<" >> $(outdir
)/$*.tmp
236 echo
"name:`echo $(notdir $*) | sed 's/-/_/g'`" >> $(outdir
)/$*.tmp
237 echo
"xmltarget:$(<F)" >> $(outdir
)/$*.tmp
238 echo
"expedite:$(if $($*-expedite),$($*-expedite),$($(firstword $(subst -, ,$(notdir $*)))-expedite))" \
240 $(XSLTPROC
) --path
"$(PWD)" --xinclude number-regs.xsl
$< | \
241 $(XSLTPROC
) sort-regs.xsl
- | \
242 $(XSLTPROC
) gdbserver-regs.xsl
- >> $(outdir
)/$*.tmp
243 sh ..
/..
/move-if-change
$(outdir
)/$*.tmp
$(outdir
)/$*.dat
245 FEATURE_XMLFILES
= i386
/32bit-core.xml \
247 i386
/32bit-linux.xml \
250 i386
/32bit-avx512.xml \
251 i386
/32bit-pkeys.xml \
252 i386
/64bit-avx512.xml \
253 i386
/64bit-core.xml \
255 i386
/64bit-segments.xml \
257 i386
/64bit-linux.xml \
258 i386
/64bit-pkeys.xml \
262 FEATURE_CFILES
= $(patsubst %.xml
,%.c
,$(FEATURE_XMLFILES
))
264 cfiles
: $(TDESC_CFILES
) $(FEATURE_CFILES
)
266 $(TDESC_CFILES
): %.c
: %.xml
267 $(GDB
) -nx
-q
-batch
-ex
'maint print c-tdesc $<' > $@.tmp
268 sh ..
/..
/move-if-change
$@.tmp
$@
270 $(FEATURE_CFILES
): %.c
: %.xml.tmp
271 $(GDB
) -nx
-q
-batch \
272 -ex
'maint print c-tdesc $<' > $@.tmp
273 sh ..
/..
/move-if-change
$@.tmp
$@
276 # %.xml is the XML file for each target description feature, and
277 # %.xml.tmp is the XML file target description which only includes
278 # one target description feature.
281 echo
"<?xml version=\"1.0\"?>" > $@.tmp
282 echo
"<!DOCTYPE target SYSTEM \"gdb-target.dtd\">" >> $@.tmp
283 echo
"<target>" >> $@.tmp
284 echo
" <xi:include href=\"$(notdir $<)\"/>" >> $@.tmp
285 echo
"</target>" >> $@.tmp
286 sh ..
/..
/move-if-change
$@.tmp
$@
288 # Other dependencies.
289 $(outdir
)/arm
/arm-with-iwmmxt.dat
: arm
/arm-core.xml arm
/xscale-iwmmxt.xml
290 $(outdir
)/i386
/i386.dat
: i386
/32bit-core.xml i386
/32bit-sse.xml
291 $(outdir
)/i386
/i386-linux.dat
: i386
/32bit-core.xml i386
/32bit-sse.xml \
293 $(outdir
)/i386
/amd64.dat
: i386
/64bit-core.xml i386
/64bit-sse.xml \
294 i386
/64bit-segments.xml
295 $(outdir
)/i386
/amd64-linux.dat
: i386
/64bit-core.xml i386
/64bit-sse.xml \
296 i386
/64bit-linux.xml i386
/64bit-segments.xml
297 $(outdir
)/i386
/i386-avx.dat
: i386
/32bit-core.xml i386
/32bit-avx.xml
298 $(outdir
)/i386
/i386-avx-linux.dat
: i386
/32bit-core.xml i386
/32bit-avx.xml \
300 $(outdir
)/i386
/i386-mpx.dat
: i386
/32bit-core.xml i386
/32bit-avx.xml \
302 $(outdir
)/i386
/i386-mpx-linux.dat
: i386
/32bit-core.xml i386
/32bit-avx.xml \
303 i386
/32bit-linux.xml i386
/32bit-mpx.xml
304 $(outdir
)/i386
/i386-mpx-linux.dat
: i386
/32bit-core.xml \
305 i386
/32bit-linux.xml i386
/32bit-mpx.xml
306 $(outdir
)/i386
/i386-avx-mpx-linux.dat
: i386
/32bit-core.xml \
307 i386
/32bit-linux.xml i386
/32bit-mpx.xml
308 $(outdir
)/i386
/i386-avx-avx512.dat
: i386
/32bit-core.xml i386
/32bit-avx.xml \
309 i386
/32bit-avx512.xml
310 $(outdir
)/i386
/i386-avx-avx512-linux.dat
: i386
/32bit-core.xml i386
/32bit-avx.xml \
311 i386
/32bit-linux.xml i386
/32bit-avx512.xml
312 $(outdir
)/i386
/i386-avx-mpx-avx512-pku.dat
: i386
/32bit-core.xml
313 i386
/32bit-avx.xml i386
/32bit-mpx.xml i386
/32bit-avx512.xml \
315 $(outdir
)/i386
/i386-avx-mpx-avx512-pku-linux.dat
: i386
/32bit-core.xml \
316 i386
/32bit-avx.xml i386
/32bit-mpx.xml i386
/32bit-avx512.xml \
317 i386
/32bit-pkeys.xml i386
/32bit-linux.xml
318 $(outdir
)/i386
/i386-mmx.dat
: i386
/32bit-core.xml
319 $(outdir
)/i386
/i386-mmx-linux.dat
: i386
/32bit-core.xml i386
/32bit-linux.xml
320 $(outdir
)/i386
/amd64-avx.dat
: i386
/64bit-core.xml i386
/64bit-avx.xml \
321 i386
/64bit-segments.xml
322 $(outdir
)/i386
/amd64-avx-linux.dat
: i386
/64bit-core.xml i386
/64bit-avx.xml \
323 i386
/64bit-linux.xml i386
/64bit-segments.xml
324 $(outdir
)/i386
/amd64-mpx-linux.dat
: i386
/64bit-core.xml i386
/64bit-avx.xml \
325 i386
/64bit-linux.xml i386
/64bit-segments.xml i386
/64bit-mpx.xml
326 $(outdir
)/i386
/amd64-avx-mpx-linux.dat
: i386
/64bit-core.xml \
327 i386
/64bit-linux.xml i386
/64bit-segments.xml i386
/64bit-mpx.xml
328 $(outdir
)/i386
/amd64-mpx.dat
: i386
/64bit-core.xml i386
/64bit-avx.xml \
329 i386
/64bit-segments.xml i386
/64bit-mpx.xml
330 $(outdir
)/i386
/amd64-avx-mpx.dat
: i386
/64bit-core.xml \
331 i386
/64bit-segments.xml i386
/64bit-mpx.xml
332 $(outdir
)/i386
/amd64-avx-avx512.dat
: i386
/64bit-core.xml i386
/64bit-avx.xml \
333 i386
/64bit-avx512.xml i386
/64bit-segments.xml
334 $(outdir
)/i386
/amd64-avx-avx512-linux.dat
: i386
/64bit-core.xml i386
/64bit-avx.xml \
335 i386
/64bit-avx512.xml i386
/64bit-linux.xml
336 $(outdir
)/i386
/amd64-avx-mpx-avx512-pku.dat
: i386
/64bit-core.xml \
337 i386
/64bit-avx.xml i386
/64bit-mpx.xml i386
/64bit-avx512.xml \
338 i386
/64bit-pkeys.xml i386
/64bit-segments.xml
339 $(outdir
)/i386
/amd64-avx-mpx-avx512-pku-linux.dat
: i386
/64bit-core.xml \
340 i386
/64bit-avx.xml i386
/64bit-mpx.xml i386
/64bit-avx512.xml \
341 i386
/64bit-linux.xml i386
/64bit-segments.xml \
343 $(outdir
)/i386
/x32.dat
: i386
/x32-core.xml i386
/64bit-sse.xml
344 $(outdir
)/i386
/x32-linux.dat
: i386
/x32-core.xml i386
/64bit-sse.xml \
345 i386
/64bit-linux.xml i386
/64bit-segments.xml
346 $(outdir
)/i386
/x32-avx.dat
: i386
/x32-core.xml i386
/64bit-avx.xml
347 $(outdir
)/i386
/x32-avx-linux.dat
: i386
/x32-core.xml i386
/64bit-avx.xml \
348 i386
/64bit-linux.xml i386
/64bit-segments.xml
349 $(outdir
)/i386
/x32-avx-avx512.dat
: i386
/x32-core.xml i386
/64bit-avx.xml \
350 i386
/64bit-avx512.xml
351 $(outdir
)/i386
/x32-avx-avx512-linux.dat
: i386
/x32-core.xml i386
/64bit-avx.xml \
352 i386
/64bit-avx512.xml i386
/64bit-linux.xml \
353 i386
/64bit-segments.xml
355 # 'all' doesn't build the C files, so don't delete them in 'clean'
358 rm -f
$(TDESC_CFILES
) $(FEATURE_CFILES
)