1 |
227 |
jeremybenn |
# Copyright (C) 2007, 2008, 2009, 2010 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 .
|
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
|
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
|
32 |
|
|
|
33 |
|
|
WHICH = arm-with-iwmmxt arm-with-vfpv2 arm-with-vfpv3 arm-with-neon \
|
34 |
|
|
i386/i386 i386/i386-linux \
|
35 |
|
|
i386/amd64 i386/amd64-linux \
|
36 |
|
|
mips-linux mips64-linux \
|
37 |
|
|
rs6000/powerpc-32l rs6000/powerpc-altivec32l rs6000/powerpc-e500l \
|
38 |
|
|
rs6000/powerpc-64l rs6000/powerpc-altivec64l rs6000/powerpc-vsx32l \
|
39 |
|
|
rs6000/powerpc-vsx64l rs6000/powerpc-cell32l rs6000/powerpc-cell64l \
|
40 |
|
|
s390-linux32 s390-linux64 s390x-linux64
|
41 |
|
|
|
42 |
|
|
# Record which registers should be sent to GDB by default after stop.
|
43 |
|
|
arm-expedite = r11,sp,pc
|
44 |
|
|
i386/i386-expedite = ebp,esp,eip
|
45 |
|
|
i386/i386-linux-expedite = ebp,esp,eip
|
46 |
|
|
i386/amd64-expedite = rbp,rsp,rip
|
47 |
|
|
i386/amd64-linux-expedite = rbp,rsp,rip
|
48 |
|
|
mips-expedite = r29,pc
|
49 |
|
|
mips64-expedite = r29,pc
|
50 |
|
|
powerpc-expedite = r1,pc
|
51 |
|
|
rs6000/powerpc-cell32l-expedite = r1,pc,r0,orig_r3,r4
|
52 |
|
|
rs6000/powerpc-cell64l-expedite = r1,pc,r0,orig_r3,r4
|
53 |
|
|
s390-linux32-expedite = r14,r15,pswa
|
54 |
|
|
s390-linux64-expedite = r14l,r15l,pswa
|
55 |
|
|
s390x-linux64-expedite = r14,r15,pswa
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
XSLTPROC = xsltproc
|
59 |
|
|
outdir = ../regformats
|
60 |
|
|
OUTPUTS = $(patsubst %,$(outdir)/%.dat,$(WHICH))
|
61 |
|
|
|
62 |
|
|
XMLTOC =
|
63 |
|
|
CFILES = $(patsubst %.xml,%.c,$(XMLTOC))
|
64 |
|
|
GDB = false
|
65 |
|
|
|
66 |
|
|
all: $(OUTPUTS)
|
67 |
|
|
|
68 |
|
|
$(outdir)/%.dat: %.xml number-regs.xsl sort-regs.xsl gdbserver-regs.xsl
|
69 |
|
|
echo "# DO NOT EDIT: generated from $<" > $(outdir)/$*.tmp
|
70 |
|
|
echo "name:`echo $(notdir $*) | sed 's/-/_/g'`" >> $(outdir)/$*.tmp
|
71 |
|
|
echo "xmltarget:$(> $(outdir)/$*.tmp
|
72 |
|
|
echo "expedite:$(if $($*-expedite),$($*-expedite),$($(firstword $(subst -, ,$(notdir $*)))-expedite))" \
|
73 |
|
|
>> $(outdir)/$*.tmp
|
74 |
|
|
$(XSLTPROC) --path "$(PWD)" --xinclude number-regs.xsl $< | \
|
75 |
|
|
$(XSLTPROC) sort-regs.xsl - | \
|
76 |
|
|
$(XSLTPROC) gdbserver-regs.xsl - >> $(outdir)/$*.tmp
|
77 |
|
|
sh ../../move-if-change $(outdir)/$*.tmp $(outdir)/$*.dat
|
78 |
|
|
|
79 |
|
|
cfiles: $(CFILES)
|
80 |
|
|
%.c: %.xml
|
81 |
|
|
$(GDB) -nx -q -batch \
|
82 |
|
|
-ex "set tdesc filename $<" -ex 'maint print c-tdesc' > $@.tmp
|
83 |
|
|
sh ../../move-if-change $@.tmp $@
|
84 |
|
|
|
85 |
|
|
# Other dependencies.
|
86 |
|
|
$(outdir)/arm-with-iwmmxt.dat: arm-core.xml xscale-iwmmxt.xml
|
87 |
|
|
$(outdir)/i386/i386.dat: i386/32bit-core.xml i386/32bit-sse.xml
|
88 |
|
|
$(outdir)/i386/i386-linux.dat: i386/32bit-core.xml i386/32bit-sse.xml \
|
89 |
|
|
i386/32bit-linux.xml
|
90 |
|
|
$(outdir)/i386/amd64.dat: i386/64bit-core.xml i386/64bit-sse.xml
|
91 |
|
|
$(outdir)/i386/amd64-linux.dat: i386/64bit-core.xml i386/64bit-sse.xml \
|
92 |
|
|
i386/64bit-linux.xml
|