Automatic date update in version.in
[platform/upstream/binutils.git] / gdb / features / Makefile
1 # Copyright (C) 2007-2014 Free Software Foundation, Inc.
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
7 # the Free Software Foundation; either version 3 of the License, or
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
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
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
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.
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 #
44 #   make GDB=/path/to/gdb XMLTOC="xml files" cfiles
45
46 WHICH = aarch64 \
47         arm-with-iwmmxt arm-with-vfpv2 arm-with-vfpv3 arm-with-neon \
48         i386/i386 i386/i386-linux \
49         i386/i386-mmx i386/i386-mmx-linux \
50         i386/amd64 i386/amd64-linux \
51         i386/i386-avx i386/i386-avx-linux \
52         i386/i386-mpx i386/i386-mpx-linux \
53         i386/i386-avx512 i386/i386-avx512-linux \
54         i386/amd64-avx i386/amd64-avx-linux \
55         i386/amd64-mpx i386/amd64-mpx-linux \
56         i386/amd64-avx512 i386/amd64-avx512-linux \
57         i386/x32 i386/x32-linux \
58         i386/x32-avx i386/x32-avx-linux \
59         i386/x32-avx512 i386/x32-avx512-linux \
60         mips-linux mips-dsp-linux \
61         microblaze-with-stack-protect \
62         mips64-linux mips64-dsp-linux \
63         nios2-linux \
64         rs6000/powerpc-32 \
65         rs6000/powerpc-32l rs6000/powerpc-altivec32l rs6000/powerpc-e500l \
66         rs6000/powerpc-64l rs6000/powerpc-altivec64l rs6000/powerpc-vsx32l \
67         rs6000/powerpc-vsx64l rs6000/powerpc-cell32l rs6000/powerpc-cell64l \
68         s390-linux32 s390-linux64 s390x-linux64 \
69         s390-linux32v1 s390-linux64v1 s390x-linux64v1 \
70         s390-linux32v2 s390-linux64v2 s390x-linux64v2 \
71         s390-te-linux64 s390x-te-linux64 \
72         tic6x-c64xp tic6x-c64x tic6x-c62x \
73         tic6x-c64xp-linux tic6x-c64x-linux tic6x-c62x-linux
74
75 # Record which registers should be sent to GDB by default after stop.
76 aarch64-expedite = x29,sp,pc
77 arm-expedite = r11,sp,pc
78 i386/i386-expedite = ebp,esp,eip
79 i386/i386-linux-expedite = ebp,esp,eip
80 i386/amd64-expedite = rbp,rsp,rip
81 i386/amd64-linux-expedite = rbp,rsp,rip
82 i386/i386-avx-expedite = ebp,esp,eip
83 i386/i386-avx-linux-expedite = ebp,esp,eip
84 i386/i386-mpx-expedite = ebp,esp,eip
85 i386/i386-mpx-linux-expedite = ebp,esp,eip
86 i386/i386-avx512-expedite = ebp,esp,eip
87 i386/i386-avx512-linux-expedite = ebp,esp,eip
88 i386/i386-mmx-expedite = ebp,esp,eip
89 i386/i386-mmx-linux-expedite = ebp,esp,eip
90 i386/amd64-avx-expedite = rbp,rsp,rip
91 i386/amd64-avx-linux-expedite = rbp,rsp,rip
92 i386/amd64-mpx-expedite = rbp,rsp,rip
93 i386/amd64-mpx-linux-expedite = rbp,rsp,rip
94 i386/amd64-avx512-expedite = rbp,rsp,rip
95 i386/amd64-avx512-linux-expedite = rbp,rsp,rip
96 i386/x32-expedite = rbp,rsp,rip
97 i386/x32-linux-expedite = rbp,rsp,rip
98 i386/x32-avx-expedite = rbp,rsp,rip
99 i386/x32-avx-linux-expedite = rbp,rsp,rip
100 i386/x32-avx512-expedite = rbp,rsp,rip
101 i386/x32-avx512-linux-expedite = rbp,rsp,rip
102 mips-expedite = r29,pc
103 mips-dsp-expedite = r29,pc
104 mips64-expedite = r29,pc
105 mips64-dsp-expedite = r29,pc
106 microblaze-expedite = r1,pc
107 nios2-linux-expedite = sp,pc
108 powerpc-expedite = r1,pc
109 rs6000/powerpc-cell32l-expedite = r1,pc,r0,orig_r3,r4
110 rs6000/powerpc-cell64l-expedite = r1,pc,r0,orig_r3,r4
111 s390-linux32-expedite = r14,r15,pswa
112 s390-linux32v1-expedite = r14,r15,pswa
113 s390-linux32v2-expedite = r14,r15,pswa
114 s390-linux64-expedite = r14l,r15l,pswa
115 s390-linux64v1-expedite = r14l,r15l,pswa
116 s390-linux64v2-expedite = r14l,r15l,pswa
117 s390-te-linux64-expedite = r14,r15,pswa
118 s390x-linux64-expedite = r14,r15,pswa
119 s390x-linux64v1-expedite = r14,r15,pswa
120 s390x-linux64v2-expedite = r14,r15,pswa
121 s390x-te-linux64-expedite = r14,r15,pswa
122 tic6x-c64xp-expedite = A15,PC
123 tic6x-c64x-expedite = A15,PC
124 tic6x-c62x-expedite = A15,PC
125 tic6x-c64xp-linux-expedite = A15,PC
126 tic6x-c64x-linux-expedite = A15,PC
127 tic6x-c62x-linux-expedite = A15,PC
128
129
130 XSLTPROC = xsltproc
131 outdir = ../regformats
132 OUTPUTS = $(patsubst %,$(outdir)/%.dat,$(WHICH))
133
134 # The set of xml files we'll generate .c files for GDB from.  By
135 # default we'll build all .c files, which requires an
136 # --enable-targets=all GDB.  You can override this by passing XMLTOC
137 # to make on the command line.
138 XMLTOC = \
139         aarch64.xml \
140         arm-with-iwmmxt.xml \
141         arm-with-m-fpa-layout.xml \
142         arm-with-m-vfp-d16.xml \
143         arm-with-m.xml \
144         arm-with-neon.xml \
145         arm-with-vfpv2.xml \
146         arm-with-vfpv3.xml \
147         i386/amd64-avx-linux.xml \
148         i386/amd64-avx.xml \
149         i386/amd64-avx512-linux.xml \
150         i386/amd64-avx512.xml \
151         i386/amd64-linux.xml \
152         i386/amd64-mpx-linux.xml \
153         i386/amd64-mpx.xml \
154         i386/amd64.xml \
155         i386/i386-avx-linux.xml \
156         i386/i386-avx.xml \
157         i386/i386-avx512-linux.xml \
158         i386/i386-avx512.xml \
159         i386/i386-linux.xml \
160         i386/i386-mmx-linux.xml \
161         i386/i386-mmx.xml \
162         i386/i386-mpx-linux.xml \
163         i386/i386-mpx.xml \
164         i386/i386.xml \
165         i386/x32-avx-linux.xml \
166         i386/x32-avx.xml \
167         i386/x32-avx512-linux.xml \
168         i386/x32-avx512.xml \
169         i386/x32-linux.xml \
170         i386/x32.xml \
171         microblaze-with-stack-protect.xml \
172         microblaze.xml \
173         mips-dsp-linux.xml \
174         mips-linux.xml \
175         mips64-dsp-linux.xml \
176         mips64-linux.xml \
177         nios2-linux.xml \
178         nios2.xml \
179         rs6000/powerpc-32.xml \
180         rs6000/powerpc-32l.xml \
181         rs6000/powerpc-403.xml \
182         rs6000/powerpc-403gc.xml \
183         rs6000/powerpc-405.xml \
184         rs6000/powerpc-505.xml \
185         rs6000/powerpc-601.xml \
186         rs6000/powerpc-602.xml \
187         rs6000/powerpc-603.xml \
188         rs6000/powerpc-604.xml \
189         rs6000/powerpc-64.xml \
190         rs6000/powerpc-64l.xml \
191         rs6000/powerpc-7400.xml \
192         rs6000/powerpc-750.xml \
193         rs6000/powerpc-860.xml \
194         rs6000/powerpc-altivec32.xml \
195         rs6000/powerpc-altivec32l.xml \
196         rs6000/powerpc-altivec64.xml \
197         rs6000/powerpc-altivec64l.xml \
198         rs6000/powerpc-cell32l.xml \
199         rs6000/powerpc-cell64l.xml \
200         rs6000/powerpc-e500.xml \
201         rs6000/powerpc-e500l.xml \
202         rs6000/powerpc-isa205-32l.xml \
203         rs6000/powerpc-isa205-64l.xml \
204         rs6000/powerpc-isa205-altivec32l.xml \
205         rs6000/powerpc-isa205-altivec64l.xml \
206         rs6000/powerpc-isa205-vsx32l.xml \
207         rs6000/powerpc-isa205-vsx64l.xml \
208         rs6000/powerpc-vsx32.xml \
209         rs6000/powerpc-vsx32l.xml \
210         rs6000/powerpc-vsx64.xml \
211         rs6000/powerpc-vsx64l.xml \
212         rs6000/rs6000.xml \
213         s390-linux32.xml \
214         s390-linux32v1.xml \
215         s390-linux32v2.xml \
216         s390-linux64.xml \
217         s390-linux64v1.xml \
218         s390-linux64v2.xml \
219         s390-te-linux64.xml \
220         s390x-linux64.xml \
221         s390x-linux64v1.xml \
222         s390x-linux64v2.xml \
223         s390x-te-linux64.xml \
224         tic6x-c62x-linux.xml \
225         tic6x-c62x.xml \
226         tic6x-c64x-linux.xml \
227         tic6x-c64x.xml \
228         tic6x-c64xp-linux.xml \
229         tic6x-c64xp.xml
230
231 CFILES = $(patsubst %.xml,%.c,$(XMLTOC))
232 GDB = false
233
234 all: $(OUTPUTS)
235
236 $(outdir)/%.dat: %.xml number-regs.xsl sort-regs.xsl gdbserver-regs.xsl
237         echo "# THIS FILE IS GENERATED.  -*- buffer-read-only: t -*- vi :set ro:" > $(outdir)/$*.tmp
238         echo "# Generated from: $<" >> $(outdir)/$*.tmp
239         echo "name:`echo $(notdir $*) | sed 's/-/_/g'`" >> $(outdir)/$*.tmp
240         echo "xmltarget:$(<F)" >> $(outdir)/$*.tmp
241         echo "expedite:$(if $($*-expedite),$($*-expedite),$($(firstword $(subst -, ,$(notdir $*)))-expedite))" \
242           >> $(outdir)/$*.tmp
243         $(XSLTPROC) --path "$(PWD)" --xinclude number-regs.xsl $< | \
244           $(XSLTPROC) sort-regs.xsl - | \
245           $(XSLTPROC) gdbserver-regs.xsl - >> $(outdir)/$*.tmp
246         sh ../../move-if-change $(outdir)/$*.tmp $(outdir)/$*.dat
247
248 cfiles: $(CFILES)
249 %.c: %.xml
250         $(GDB) -nx -q -batch \
251           -ex "set tdesc filename $<" -ex 'maint print c-tdesc' > $@.tmp
252         sh ../../move-if-change $@.tmp $@
253
254 # Other dependencies.
255 $(outdir)/arm-with-iwmmxt.dat: arm-core.xml xscale-iwmmxt.xml
256 $(outdir)/i386/i386.dat: i386/32bit-core.xml i386/32bit-sse.xml
257 $(outdir)/i386/i386-linux.dat: i386/32bit-core.xml i386/32bit-sse.xml \
258                                i386/32bit-linux.xml
259 $(outdir)/i386/amd64.dat: i386/64bit-core.xml i386/64bit-sse.xml
260 $(outdir)/i386/amd64-linux.dat: i386/64bit-core.xml i386/64bit-sse.xml \
261                                 i386/64bit-linux.xml
262 $(outdir)/i386/i386-avx.dat: i386/32bit-core.xml i386/32bit-avx.xml
263 $(outdir)/i386/i386-avx-linux.dat: i386/32bit-core.xml i386/32bit-avx.xml \
264                                i386/32bit-linux.xml
265 $(outdir)/i386/i386-mpx.dat: i386/32bit-core.xml i386/32bit-avx.xml \
266                                i386/32bit-mpx.xml
267 $(outdir)/i386/i386-mpx-linux.dat: i386/32bit-core.xml  i386/32bit-avx.xml \
268                                i386/32bit-linux.xml i386/32bit-mpx.xml
269 $(outdir)/i386/i386-avx512.dat: i386/32bit-core.xml i386/32bit-avx.xml \
270                                i386/32bit-mpx.xml i386/32bit-avx512.xml
271 $(outdir)/i386/i386-avx512-linux.dat: i386/32bit-core.xml i386/32bit-avx.xml \
272                                i386/32bit-linux.xml i386/32bit-mpx.xml i386/32bit-avx512.xml
273 $(outdir)/i386/i386-mmx.dat: i386/32bit-core.xml 
274 $(outdir)/i386/i386-mmx-linux.dat: i386/32bit-core.xml i386/32bit-linux.xml
275 $(outdir)/i386/amd64-avx.dat: i386/64bit-core.xml i386/64bit-avx.xml
276 $(outdir)/i386/amd64-avx-linux.dat: i386/64bit-core.xml i386/64bit-avx.xml \
277                                     i386/64bit-linux.xml
278 $(outdir)/i386/amd64-mpx-linux.dat: i386/64bit-core.xml i386/64bit-avx.xml \
279                                i386/64bit-linux.xml i386/64bit-mpx.xml
280 $(outdir)/i386/amd64-mpx.dat: i386/64bit-core.xml i386/64bit-avx.xml \
281                                i386/64bit-mpx.xml
282 $(outdir)/i386/amd64-avx512.dat: i386/64bit-core.xml i386/64bit-avx.xml \
283                                i386/64bit-mpx.xml i386/64bit-avx512.xml
284 $(outdir)/i386/amd64-avx512-linux.dat: i386/64bit-core.xml i386/64bit-avx.xml \
285                                i386/64bit-mpx.xml i386/64bit-avx512.xml \
286                                i386/64bit-linux.xml
287 $(outdir)/i386/x32.dat: i386/x32-core.xml i386/64bit-sse.xml
288 $(outdir)/i386/x32-linux.dat: i386/x32-core.xml i386/64bit-sse.xml \
289                               i386/64bit-linux.xml
290 $(outdir)/i386/x32-avx.dat: i386/x32-core.xml i386/64bit-avx.xml
291 $(outdir)/i386/x32-avx-linux.dat: i386/x32-core.xml i386/64bit-avx.xml \
292                                   i386/64bit-linux.xml
293 $(outdir)/i386/x32-avx512.dat: i386/x32-core.xml i386/64bit-avx.xml \
294                                i386/64bit-mpx.xml i386/64bit-avx512.xml
295 $(outdir)/i386/x32-avx512-linux.dat: i386/x32-core.xml i386/64bit-avx.xml \
296                                i386/64bit-mpx.xml i386/64bit-avx512.xml i386/64bit-linux.xml
297
298 # 'all' doesn't build the C files, so don't delete them in 'clean'
299 # either.
300 clean-cfiles:
301         rm -f $(CFILES)
302
303 clean:
304         rm -f $(OUTPUTS)