1 # Copyright (C) 2007-2013 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
29 # configured for the correct architecture, so the files are again kept
30 # in the GDB repository. To generate C files:
31 # make GDB=/path/to/gdb XMLTOC="xml files" cfiles
34 arm-with-iwmmxt arm-with-vfpv2 arm-with-vfpv3 arm-with-neon \
35 arm-with-m arm-with-m-fpa-layout arm-with-m-vfp-d16 \
36 i386
/i386 i386
/i386-linux \
37 i386
/i386-mmx i386
/i386-mmx-linux \
38 i386
/amd64 i386
/amd64-linux \
39 i386
/i386-avx i386
/i386-avx-linux \
40 i386
/amd64-avx i386
/amd64-avx-linux \
41 i386
/x32 i386
/x32-linux \
42 i386
/x32-avx i386
/x32-avx-linux \
43 mips-linux mips-dsp-linux \
44 mips64-linux mips64-dsp-linux \
47 rs6000
/powerpc-32l rs6000
/powerpc-altivec32l rs6000
/powerpc-e500l \
48 rs6000
/powerpc-64l rs6000
/powerpc-altivec64l rs6000
/powerpc-vsx32l \
49 rs6000
/powerpc-vsx64l rs6000
/powerpc-cell32l rs6000
/powerpc-cell64l \
50 s390-linux32 s390-linux64 s390x-linux64 \
51 s390-linux32v1 s390-linux64v1 s390x-linux64v1 \
52 s390-linux32v2 s390-linux64v2 s390x-linux64v2 \
53 tic6x-c64xp tic6x-c64x tic6x-c62x \
54 tic6x-c64xp-linux tic6x-c64x-linux tic6x-c62x-linux
56 # Record which registers should be sent to GDB by default after stop.
57 aarch64-expedite
= x29
,sp
,pc
58 arm-expedite
= r11
,sp
,pc
59 i386
/i386-expedite
= ebp
,esp
,eip
60 i386
/i386-linux-expedite
= ebp
,esp
,eip
61 i386
/amd64-expedite
= rbp
,rsp
,rip
62 i386
/amd64-linux-expedite
= rbp
,rsp
,rip
63 i386
/i386-avx-expedite
= ebp
,esp
,eip
64 i386
/i386-avx-linux-expedite
= ebp
,esp
,eip
65 i386
/i386-mmx-expedite
= ebp
,esp
,eip
66 i386
/i386-mmx-linux-expedite
= ebp
,esp
,eip
67 i386
/amd64-avx-expedite
= rbp
,rsp
,rip
68 i386
/amd64-avx-linux-expedite
= rbp
,rsp
,rip
69 i386
/x32-expedite
= rbp
,rsp
,rip
70 i386
/x32-linux-expedite
= rbp
,rsp
,rip
71 i386
/x32-avx-expedite
= rbp
,rsp
,rip
72 i386
/x32-avx-linux-expedite
= rbp
,rsp
,rip
73 mips-expedite
= r29
,pc
74 mips-dsp-expedite
= r29
,pc
75 mips64-expedite
= r29
,pc
76 mips64-dsp-expedite
= r29
,pc
77 nios2-linux-expedite
= sp
,pc
78 powerpc-expedite
= r1
,pc
79 rs6000
/powerpc-cell32l-expedite
= r1
,pc,r0
,orig_r3
,r4
80 rs6000
/powerpc-cell64l-expedite
= r1
,pc,r0
,orig_r3
,r4
81 s390-linux32-expedite
= r14
,r15
,pswa
82 s390-linux32v1-expedite
= r14
,r15
,pswa
83 s390-linux32v2-expedite
= r14
,r15
,pswa
84 s390-linux64-expedite
= r14l
,r15l
,pswa
85 s390-linux64v1-expedite
= r14l
,r15l
,pswa
86 s390-linux64v2-expedite
= r14l
,r15l
,pswa
87 s390x-linux64-expedite
= r14
,r15
,pswa
88 s390x-linux64v1-expedite
= r14
,r15
,pswa
89 s390x-linux64v2-expedite
= r14
,r15
,pswa
90 tic6x-c64xp-expedite
= A15
,PC
91 tic6x-c64x-expedite
= A15
,PC
92 tic6x-c62x-expedite
= A15
,PC
93 tic6x-c64xp-linux-expedite
= A15
,PC
94 tic6x-c64x-linux-expedite
= A15
,PC
95 tic6x-c62x-linux-expedite
= A15
,PC
99 outdir
= ..
/regformats
100 OUTPUTS
= $(patsubst %,$(outdir
)/%.dat
,$(WHICH
))
103 CFILES
= $(patsubst %.xml
,%.c
,$(XMLTOC
))
108 $(outdir
)/%.dat
: %.xml number-regs.xsl sort-regs.xsl gdbserver-regs.xsl
109 echo
"# DO NOT EDIT: generated from $<" > $(outdir
)/$*.tmp
110 echo
"name:`echo $(notdir $*) | sed 's/-/_/g'`" >> $(outdir
)/$*.tmp
111 echo
"xmltarget:$(<F)" >> $(outdir
)/$*.tmp
112 echo
"expedite:$(if $($*-expedite),$($*-expedite),$($(firstword $(subst -, ,$(notdir $*)))-expedite))" \
114 $(XSLTPROC
) --path
"$(PWD)" --xinclude number-regs.xsl
$< | \
115 $(XSLTPROC
) sort-regs.xsl
- | \
116 $(XSLTPROC
) gdbserver-regs.xsl
- >> $(outdir
)/$*.tmp
117 sh ..
/..
/move-if-change
$(outdir
)/$*.tmp
$(outdir
)/$*.dat
121 $(GDB
) -nx
-q
-batch \
122 -ex
"set tdesc filename $<" -ex
'maint print c-tdesc' > $@.tmp
123 sh ..
/..
/move-if-change
$@.tmp
$@
125 # Other dependencies.
126 $(outdir
)/arm-with-iwmmxt.dat
: arm-core.xml xscale-iwmmxt.xml
127 $(outdir
)/i386
/i386.dat
: i386
/32bit-core.xml i386
/32bit-sse.xml
128 $(outdir
)/i386
/i386-linux.dat
: i386
/32bit-core.xml i386
/32bit-sse.xml \
130 $(outdir
)/i386
/amd64.dat
: i386
/64bit-core.xml i386
/64bit-sse.xml
131 $(outdir
)/i386
/amd64-linux.dat
: i386
/64bit-core.xml i386
/64bit-sse.xml \
133 $(outdir
)/i386
/i386-avx.dat
: i386
/32bit-core.xml i386
/32bit-avx.xml
134 $(outdir
)/i386
/i386-avx-linux.dat
: i386
/32bit-core.xml i386
/32bit-avx.xml \
136 $(outdir
)/i386
/i386-mmx.dat
: i386
/32bit-core.xml
137 $(outdir
)/i386
/i386-mmx-linux.dat
: i386
/32bit-core.xml i386
/32bit-linux.xml
138 $(outdir
)/i386
/amd64-avx.dat
: i386
/64bit-core.xml i386
/64bit-avx.xml
139 $(outdir
)/i386
/amd64-avx-linux.dat
: i386
/64bit-core.xml i386
/64bit-avx.xml \
141 $(outdir
)/i386
/x32.dat
: i386
/x32-core.xml i386
/64bit-sse.xml
142 $(outdir
)/i386
/x32-linux.dat
: i386
/x32-core.xml i386
/64bit-sse.xml \
144 $(outdir
)/i386
/x32-avx.dat
: i386
/x32-core.xml i386
/64bit-avx.xml
145 $(outdir
)/i386
/x32-avx-linux.dat
: i386
/x32-core.xml i386
/64bit-avx.xml \