Automatic date update in version.in
[deliverable/binutils-gdb.git] / gdb / features / Makefile
CommitLineData
e2882c85 1# Copyright (C) 2007-2018 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#
41# To generate specific C files, you can override the XMLTOC make
42# variable:
43#
81adfced
DJ
44# make GDB=/path/to/gdb XMLTOC="xml files" cfiles
45
6ac1c082 46WHICH = aarch64 \
0a69eedb
YQ
47 arm/arm-with-iwmmxt arm/arm-with-vfpv2 arm/arm-with-vfpv3 \
48 arm/arm-with-neon \
46763423 49 i386/i386 i386/i386-linux \
f5a29eb0 50 i386/i386-mmx-linux \
46763423 51 i386/amd64 i386/amd64-linux \
f5a29eb0
YQ
52 i386/i386-avx-linux \
53 i386/i386-mpx-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 \
57757c2f
YQ
62 i386/x32-linux \
63 i386/x32-avx-linux \
64 i386/x32-avx-avx512-linux \
1faeff08 65 mips-linux mips-dsp-linux \
164224e9 66 microblaze-with-stack-protect \
1faeff08 67 mips64-linux mips64-dsp-linux \
a1217d97 68 nios2-linux \
0482b03b 69 rs6000/powerpc-32 \
7284e1be 70 rs6000/powerpc-32l rs6000/powerpc-altivec32l rs6000/powerpc-e500l \
604c2f83 71 rs6000/powerpc-64l rs6000/powerpc-altivec64l rs6000/powerpc-vsx32l \
7803799a 72 rs6000/powerpc-vsx64l rs6000/powerpc-cell32l rs6000/powerpc-cell64l \
5878efd4
YQ
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 \
224bbe49 76 s390-linux32 s390-linux64 s390x-linux64 \
c642a434
UW
77 s390-linux32v1 s390-linux64v1 s390x-linux64v1 \
78 s390-linux32v2 s390-linux64v2 s390x-linux64v2 \
446899e4
AA
79 s390-te-linux64 s390x-te-linux64 s390-vx-linux64 s390x-vx-linux64 \
80 s390-tevx-linux64 s390x-tevx-linux64 \
96235dc1 81 s390-gs-linux64 s390x-gs-linux64 \
224bbe49 82 tic6x-c64xp-linux tic6x-c64x-linux tic6x-c62x-linux
fb1e4ffc
DJ
83
84# Record which registers should be sent to GDB by default after stop.
07b287a0 85aarch64-expedite = x29,sp,pc
58d6951d 86arm-expedite = r11,sp,pc
414c838a
YQ
87i386-expedite = ebp,esp,eip
88amd64-expedite = rbp,rsp,rip
89x32-expedite = rbp,rsp,rip
58d6951d 90mips-expedite = r29,pc
1faeff08 91mips-dsp-expedite = r29,pc
58d6951d 92mips64-expedite = r29,pc
1faeff08 93mips64-dsp-expedite = r29,pc
449aa9df 94microblaze-expedite = r1,rpc
a1217d97 95nios2-linux-expedite = sp,pc
a994fec4 96or1k-expedite = r1,npc
58d6951d 97powerpc-expedite = r1,pc
f4d9bade
UW
98rs6000/powerpc-cell32l-expedite = r1,pc,r0,orig_r3,r4
99rs6000/powerpc-cell64l-expedite = r1,pc,r0,orig_r3,r4
7803799a 100s390-linux32-expedite = r14,r15,pswa
c642a434
UW
101s390-linux32v1-expedite = r14,r15,pswa
102s390-linux32v2-expedite = r14,r15,pswa
7803799a 103s390-linux64-expedite = r14l,r15l,pswa
c642a434
UW
104s390-linux64v1-expedite = r14l,r15l,pswa
105s390-linux64v2-expedite = r14l,r15l,pswa
d5552aab 106s390-te-linux64-expedite = r14l,r15l,pswa
446899e4
AA
107s390-vx-linux64-expedite = r14l,r15l,pswa
108s390-tevx-linux64-expedite = r14l,r15l,pswa
96235dc1 109s390-gs-linux64-expedite = r14,r15,pswa
2399fe6a
YQ
110s390x-expedite = r14,r15,pswa
111tic6x-expedite = A15,PC
604c2f83 112
fb1e4ffc
DJ
113
114XSLTPROC = xsltproc
115outdir = ../regformats
116OUTPUTS = $(patsubst %,$(outdir)/%.dat,$(WHICH))
117
db74e4ba
PA
118# The set of xml files we'll generate .c files for GDB from. By
119# default we'll build all .c files, which requires an
120# --enable-targets=all GDB. You can override this by passing XMLTOC
121# to make on the command line.
122XMLTOC = \
ad0a504f
AK
123 arc-v2.xml \
124 arc-arcompact.xml \
0a69eedb
YQ
125 arm/arm-with-iwmmxt.xml \
126 arm/arm-with-m-fpa-layout.xml \
127 arm/arm-with-m-vfp-d16.xml \
128 arm/arm-with-m.xml \
129 arm/arm-with-neon.xml \
130 arm/arm-with-vfpv2.xml \
131 arm/arm-with-vfpv3.xml \
db74e4ba
PA
132 microblaze-with-stack-protect.xml \
133 microblaze.xml \
134 mips-dsp-linux.xml \
135 mips-linux.xml \
136 mips64-dsp-linux.xml \
137 mips64-linux.xml \
a28d8e50 138 nds32.xml \
db74e4ba 139 nios2.xml \
a994fec4 140 or1k.xml \
db74e4ba
PA
141 rs6000/powerpc-32.xml \
142 rs6000/powerpc-32l.xml \
143 rs6000/powerpc-403.xml \
144 rs6000/powerpc-403gc.xml \
145 rs6000/powerpc-405.xml \
146 rs6000/powerpc-505.xml \
147 rs6000/powerpc-601.xml \
148 rs6000/powerpc-602.xml \
149 rs6000/powerpc-603.xml \
150 rs6000/powerpc-604.xml \
151 rs6000/powerpc-64.xml \
152 rs6000/powerpc-64l.xml \
153 rs6000/powerpc-7400.xml \
154 rs6000/powerpc-750.xml \
155 rs6000/powerpc-860.xml \
156 rs6000/powerpc-altivec32.xml \
157 rs6000/powerpc-altivec32l.xml \
158 rs6000/powerpc-altivec64.xml \
159 rs6000/powerpc-altivec64l.xml \
160 rs6000/powerpc-cell32l.xml \
161 rs6000/powerpc-cell64l.xml \
162 rs6000/powerpc-e500.xml \
163 rs6000/powerpc-e500l.xml \
164 rs6000/powerpc-isa205-32l.xml \
165 rs6000/powerpc-isa205-64l.xml \
166 rs6000/powerpc-isa205-altivec32l.xml \
167 rs6000/powerpc-isa205-altivec64l.xml \
168 rs6000/powerpc-isa205-vsx32l.xml \
169 rs6000/powerpc-isa205-vsx64l.xml \
170 rs6000/powerpc-vsx32.xml \
171 rs6000/powerpc-vsx32l.xml \
172 rs6000/powerpc-vsx64.xml \
173 rs6000/powerpc-vsx64l.xml \
174 rs6000/rs6000.xml \
175 s390-linux32.xml \
176 s390-linux32v1.xml \
177 s390-linux32v2.xml \
178 s390-linux64.xml \
179 s390-linux64v1.xml \
180 s390-linux64v2.xml \
181 s390-te-linux64.xml \
182 s390x-linux64.xml \
183 s390x-linux64v1.xml \
184 s390x-linux64v2.xml \
185 s390x-te-linux64.xml \
defaaad5
YQ
186 s390-tevx-linux64.xml \
187 s390-vx-linux64.xml \
188 s390x-tevx-linux64.xml \
189 s390x-vx-linux64.xml \
96235dc1 190 s390-gs-linux64.xml \
c40c7bfc 191 s390x-gs-linux64.xml
db74e4ba 192
25aa13e5 193TDESC_CFILES = $(patsubst %.xml,%.c,$(XMLTOC))
81adfced
DJ
194GDB = false
195
ad7fc756
AH
196#Targets which use feature based target descriptions.
197aarch64-feature = 1
198i386-feature = 1
199tic6x-feature = 1
200
fb1e4ffc
DJ
201all: $(OUTPUTS)
202
203$(outdir)/%.dat: %.xml number-regs.xsl sort-regs.xsl gdbserver-regs.xsl
5fdeec1d
PA
204 echo "# THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi :set ro:" > $(outdir)/$*.tmp
205 echo "# Generated from: $<" >> $(outdir)/$*.tmp
30ed0a8f 206 echo "name:`echo $(notdir $*) | sed 's/-/_/g'`" >> $(outdir)/$*.tmp
ad7fc756 207 $(if $($(firstword $(subst /, ,$(subst -, ,$*)))-feature), echo "feature:1") >> $(outdir)/$*.tmp
221c031f 208 echo "xmltarget:$(<F)" >> $(outdir)/$*.tmp
f4d9bade
UW
209 echo "expedite:$(if $($*-expedite),$($*-expedite),$($(firstword $(subst -, ,$(notdir $*)))-expedite))" \
210 >> $(outdir)/$*.tmp
30ed0a8f 211 $(XSLTPROC) --path "$(PWD)" --xinclude number-regs.xsl $< | \
fb1e4ffc
DJ
212 $(XSLTPROC) sort-regs.xsl - | \
213 $(XSLTPROC) gdbserver-regs.xsl - >> $(outdir)/$*.tmp
214 sh ../../move-if-change $(outdir)/$*.tmp $(outdir)/$*.dat
215
49bdb7ee
AH
216FEATURE_XMLFILES = aarch64-core.xml \
217 aarch64-fpu.xml \
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
YQ
233 i386/x32-core.xml \
234 tic6x-c6xp.xml \
235 tic6x-core.xml \
236 tic6x-gp.xml
25aa13e5
YQ
237
238FEATURE_CFILES = $(patsubst %.xml,%.c,$(FEATURE_XMLFILES))
239
240cfiles: $(TDESC_CFILES) $(FEATURE_CFILES)
241
242$(TDESC_CFILES): %.c: %.xml
8e2141c6 243 $(GDB) -nx -q -batch -ex 'maint print c-tdesc $<' > $@.tmp
81adfced
DJ
244 sh ../../move-if-change $@.tmp $@
245
25aa13e5
YQ
246$(FEATURE_CFILES): %.c: %.xml.tmp
247 $(GDB) -nx -q -batch \
248 -ex 'maint print c-tdesc $<' > $@.tmp
249 sh ../../move-if-change $@.tmp $@
250 rm $<
251
252# %.xml is the XML file for each target description feature, and
253# %.xml.tmp is the XML file target description which only includes
254# one target description feature.
255
256%.xml.tmp: %.xml
257 echo "<?xml version=\"1.0\"?>" > $@.tmp
258 echo "<!DOCTYPE target SYSTEM \"gdb-target.dtd\">" >> $@.tmp
259 echo "<target>" >> $@.tmp
260 echo " <xi:include href=\"$(notdir $<)\"/>" >> $@.tmp
261 echo "</target>" >> $@.tmp
262 sh ../../move-if-change $@.tmp $@
263
fb1e4ffc 264# Other dependencies.
0a69eedb 265$(outdir)/arm/arm-with-iwmmxt.dat: arm/arm-core.xml arm/xscale-iwmmxt.xml
46763423
L
266$(outdir)/i386/i386.dat: i386/32bit-core.xml i386/32bit-sse.xml
267$(outdir)/i386/i386-linux.dat: i386/32bit-core.xml i386/32bit-sse.xml \
268 i386/32bit-linux.xml
48aeef91
JB
269$(outdir)/i386/amd64.dat: i386/64bit-core.xml i386/64bit-sse.xml \
270 i386/64bit-segments.xml
46763423 271$(outdir)/i386/amd64-linux.dat: i386/64bit-core.xml i386/64bit-sse.xml \
2735833d 272 i386/64bit-linux.xml i386/64bit-segments.xml
98adf0f3
L
273$(outdir)/i386/i386-avx.dat: i386/32bit-core.xml i386/32bit-avx.xml
274$(outdir)/i386/i386-avx-linux.dat: i386/32bit-core.xml i386/32bit-avx.xml \
275 i386/32bit-linux.xml
ccc42043
WT
276$(outdir)/i386/i386-mpx.dat: i386/32bit-core.xml i386/32bit-avx.xml \
277 i386/32bit-mpx.xml
278$(outdir)/i386/i386-mpx-linux.dat: i386/32bit-core.xml i386/32bit-avx.xml \
279 i386/32bit-linux.xml i386/32bit-mpx.xml
2b863f51
WT
280$(outdir)/i386/i386-mpx-linux.dat: i386/32bit-core.xml \
281 i386/32bit-linux.xml i386/32bit-mpx.xml
282$(outdir)/i386/i386-avx-mpx-linux.dat: i386/32bit-core.xml \
283 i386/32bit-linux.xml i386/32bit-mpx.xml
a1fa17ee
MS
284$(outdir)/i386/i386-avx-avx512.dat: i386/32bit-core.xml i386/32bit-avx.xml \
285 i386/32bit-avx512.xml
286$(outdir)/i386/i386-avx-avx512-linux.dat: i386/32bit-core.xml i386/32bit-avx.xml \
287 i386/32bit-linux.xml i386/32bit-avx512.xml
1b7fa39e 288$(outdir)/i386/i386-avx-mpx-avx512-pku.dat: i386/32bit-core.xml \
51547df6
MS
289 i386/32bit-avx.xml i386/32bit-mpx.xml i386/32bit-avx512.xml \
290 i386/32bit-pkeys.xml
291$(outdir)/i386/i386-avx-mpx-avx512-pku-linux.dat: i386/32bit-core.xml \
292 i386/32bit-avx.xml i386/32bit-mpx.xml i386/32bit-avx512.xml \
293 i386/32bit-pkeys.xml i386/32bit-linux.xml
3a13a53b
L
294$(outdir)/i386/i386-mmx.dat: i386/32bit-core.xml
295$(outdir)/i386/i386-mmx-linux.dat: i386/32bit-core.xml i386/32bit-linux.xml
48aeef91
JB
296$(outdir)/i386/amd64-avx.dat: i386/64bit-core.xml i386/64bit-avx.xml \
297 i386/64bit-segments.xml
98adf0f3 298$(outdir)/i386/amd64-avx-linux.dat: i386/64bit-core.xml i386/64bit-avx.xml \
2735833d 299 i386/64bit-linux.xml i386/64bit-segments.xml
ccc42043 300$(outdir)/i386/amd64-mpx-linux.dat: i386/64bit-core.xml i386/64bit-avx.xml \
2735833d 301 i386/64bit-linux.xml i386/64bit-segments.xml i386/64bit-mpx.xml
2b863f51 302$(outdir)/i386/amd64-avx-mpx-linux.dat: i386/64bit-core.xml \
2735833d 303 i386/64bit-linux.xml i386/64bit-segments.xml i386/64bit-mpx.xml
ccc42043 304$(outdir)/i386/amd64-mpx.dat: i386/64bit-core.xml i386/64bit-avx.xml \
48aeef91 305 i386/64bit-segments.xml i386/64bit-mpx.xml
2b863f51 306$(outdir)/i386/amd64-avx-mpx.dat: i386/64bit-core.xml \
48aeef91 307 i386/64bit-segments.xml i386/64bit-mpx.xml
a1fa17ee 308$(outdir)/i386/amd64-avx-avx512.dat: i386/64bit-core.xml i386/64bit-avx.xml \
48aeef91 309 i386/64bit-avx512.xml i386/64bit-segments.xml
a1fa17ee
MS
310$(outdir)/i386/amd64-avx-avx512-linux.dat: i386/64bit-core.xml i386/64bit-avx.xml \
311 i386/64bit-avx512.xml i386/64bit-linux.xml
51547df6
MS
312$(outdir)/i386/amd64-avx-mpx-avx512-pku.dat: i386/64bit-core.xml \
313 i386/64bit-avx.xml i386/64bit-mpx.xml i386/64bit-avx512.xml \
48aeef91 314 i386/64bit-pkeys.xml i386/64bit-segments.xml
51547df6
MS
315$(outdir)/i386/amd64-avx-mpx-avx512-pku-linux.dat: i386/64bit-core.xml \
316 i386/64bit-avx.xml i386/64bit-mpx.xml i386/64bit-avx512.xml \
317 i386/64bit-linux.xml i386/64bit-segments.xml \
318 i386/64bit-pkeys.xml
9a82b8ff
L
319$(outdir)/i386/x32.dat: i386/x32-core.xml i386/64bit-sse.xml
320$(outdir)/i386/x32-linux.dat: i386/x32-core.xml i386/64bit-sse.xml \
2735833d 321 i386/64bit-linux.xml i386/64bit-segments.xml
9a82b8ff
L
322$(outdir)/i386/x32-avx.dat: i386/x32-core.xml i386/64bit-avx.xml
323$(outdir)/i386/x32-avx-linux.dat: i386/x32-core.xml i386/64bit-avx.xml \
2735833d 324 i386/64bit-linux.xml i386/64bit-segments.xml
a1fa17ee
MS
325$(outdir)/i386/x32-avx-avx512.dat: i386/x32-core.xml i386/64bit-avx.xml \
326 i386/64bit-avx512.xml
327$(outdir)/i386/x32-avx-avx512-linux.dat: i386/x32-core.xml i386/64bit-avx.xml \
328 i386/64bit-avx512.xml i386/64bit-linux.xml \
22049425 329 i386/64bit-segments.xml
acc9fe45 330
db74e4ba
PA
331# 'all' doesn't build the C files, so don't delete them in 'clean'
332# either.
333clean-cfiles:
25aa13e5 334 rm -f $(TDESC_CFILES) $(FEATURE_CFILES)
db74e4ba 335
acc9fe45
PA
336clean:
337 rm -f $(OUTPUTS)
This page took 1.380948 seconds and 4 git commands to generate.