| 1 | # Copyright (C) 2007 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 2 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, write to the Free Software |
| 17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 18 | |
| 19 | |
| 20 | # This file requires GNU make! |
| 21 | |
| 22 | # This Makefile updates files in ../regformats from their XML master |
| 23 | # copies. Because this relies on xsltproc, it is not normally run |
| 24 | # during the build process; it should be run by hand when one of the |
| 25 | # affected XML files is changed, and the results should be kept in the |
| 26 | # GDB repository. |
| 27 | |
| 28 | # It can also update the C files in the features directory from their |
| 29 | # XML master copies. This relies on a GDB linked with expat and |
| 30 | # configured for the correct architecture, so the files are again kept |
| 31 | # in the GDB repository. To generate C files: |
| 32 | # make GDB=/path/to/gdb XMLTOC="xml files" cfiles |
| 33 | |
| 34 | WHICH = arm-with-iwmmxt mips-linux mips64-linux \ |
| 35 | rs6000/powerpc-32 rs6000/powerpc-e500 rs6000/powerpc-64 |
| 36 | |
| 37 | # Record which registers should be sent to GDB by default after stop. |
| 38 | arm-with-iwmmxt-expedite = r11,sp,pc |
| 39 | mips-linux-expedite = r29,pc |
| 40 | mips64-linux-expedite = r29,pc |
| 41 | rs6000/powerpc-32-expedite = r1,pc |
| 42 | rs6000/powerpc-e500-expedite = r1,pc |
| 43 | rs6000/powerpc-64-expedite = r1,pc |
| 44 | |
| 45 | XSLTPROC = xsltproc |
| 46 | outdir = ../regformats |
| 47 | OUTPUTS = $(patsubst %,$(outdir)/%.dat,$(WHICH)) |
| 48 | |
| 49 | XMLTOC = |
| 50 | CFILES = $(patsubst %.xml,%.c,$(XMLTOC)) |
| 51 | GDB = false |
| 52 | |
| 53 | all: $(OUTPUTS) |
| 54 | |
| 55 | $(outdir)/%.dat: %.xml number-regs.xsl sort-regs.xsl gdbserver-regs.xsl |
| 56 | echo "# DO NOT EDIT: generated from $<" > $(outdir)/$*.tmp |
| 57 | echo "name:`echo $(notdir $*) | sed 's/-/_/g'`" >> $(outdir)/$*.tmp |
| 58 | echo "expedite:$($*-expedite)" >> $(outdir)/$*.tmp |
| 59 | $(XSLTPROC) --path "$(PWD)" --xinclude number-regs.xsl $< | \ |
| 60 | $(XSLTPROC) sort-regs.xsl - | \ |
| 61 | $(XSLTPROC) gdbserver-regs.xsl - >> $(outdir)/$*.tmp |
| 62 | sh ../../move-if-change $(outdir)/$*.tmp $(outdir)/$*.dat |
| 63 | |
| 64 | cfiles: $(CFILES) |
| 65 | %.c: %.xml |
| 66 | $(GDB) -nx -q -batch \ |
| 67 | -ex "set tdesc filename $<" -ex 'maint print c-tdesc' > $@.tmp |
| 68 | sh ../../move-if-change $@.tmp $@ |
| 69 | |
| 70 | # Other dependencies. |
| 71 | $(outdir)/arm-with-iwmmxt.dat: arm-core.xml xscale-iwmmxt.xml |