Home | History | Annotate | Line # | Download | only in features
Makefile revision 1.1
      1  1.1  christos # Copyright (C) 2007-2014 Free Software Foundation, Inc.
      2  1.1  christos 
      3  1.1  christos # This file is part of GDB.
      4  1.1  christos 
      5  1.1  christos # This program is free software; you can redistribute it and/or modify
      6  1.1  christos # it under the terms of the GNU General Public License as published by
      7  1.1  christos # the Free Software Foundation; either version 3 of the License, or
      8  1.1  christos # (at your option) any later version.
      9  1.1  christos #
     10  1.1  christos # This program is distributed in the hope that it will be useful,
     11  1.1  christos # but WITHOUT ANY WARRANTY; without even the implied warranty of
     12  1.1  christos # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13  1.1  christos # GNU General Public License for more details.
     14  1.1  christos #
     15  1.1  christos # You should have received a copy of the GNU General Public License
     16  1.1  christos # along with this program.  If not, see <http://www.gnu.org/licenses/>.
     17  1.1  christos 
     18  1.1  christos 
     19  1.1  christos # This file requires GNU make!
     20  1.1  christos 
     21  1.1  christos # This Makefile updates files in ../regformats from their XML master
     22  1.1  christos # copies.  Because this relies on xsltproc, it is not normally run
     23  1.1  christos # during the build process; it should be run by hand when one of the
     24  1.1  christos # affected XML files is changed, and the results should be kept in the
     25  1.1  christos # GDB repository.
     26  1.1  christos 
     27  1.1  christos # It can also update the C files in the features directory from their
     28  1.1  christos # XML master copies.  This relies on a GDB linked with expat and
     29  1.1  christos # configured for the correct architecture, so the files are again kept
     30  1.1  christos # in the GDB repository.  To generate C files:
     31  1.1  christos #   make GDB=/path/to/gdb XMLTOC="xml files" cfiles
     32  1.1  christos 
     33  1.1  christos WHICH = aarch64 \
     34  1.1  christos 	arm-with-iwmmxt arm-with-vfpv2 arm-with-vfpv3 arm-with-neon \
     35  1.1  christos 	arm-with-m arm-with-m-fpa-layout arm-with-m-vfp-d16 \
     36  1.1  christos 	i386/i386 i386/i386-linux \
     37  1.1  christos 	i386/i386-mmx i386/i386-mmx-linux \
     38  1.1  christos 	i386/amd64 i386/amd64-linux \
     39  1.1  christos 	i386/i386-avx i386/i386-avx-linux \
     40  1.1  christos 	i386/i386-mpx i386/i386-mpx-linux \
     41  1.1  christos 	i386/amd64-avx i386/amd64-avx-linux \
     42  1.1  christos 	i386/amd64-mpx i386/amd64-mpx-linux \
     43  1.1  christos 	i386/x32 i386/x32-linux \
     44  1.1  christos 	i386/x32-avx i386/x32-avx-linux \
     45  1.1  christos 	mips-linux mips-dsp-linux \
     46  1.1  christos 	mips64-linux mips64-dsp-linux \
     47  1.1  christos 	nios2-linux \
     48  1.1  christos 	rs6000/powerpc-32 \
     49  1.1  christos 	rs6000/powerpc-32l rs6000/powerpc-altivec32l rs6000/powerpc-e500l \
     50  1.1  christos 	rs6000/powerpc-64l rs6000/powerpc-altivec64l rs6000/powerpc-vsx32l \
     51  1.1  christos 	rs6000/powerpc-vsx64l rs6000/powerpc-cell32l rs6000/powerpc-cell64l \
     52  1.1  christos 	s390-linux32 s390-linux64 s390x-linux64 \
     53  1.1  christos 	s390-linux32v1 s390-linux64v1 s390x-linux64v1 \
     54  1.1  christos 	s390-linux32v2 s390-linux64v2 s390x-linux64v2 \
     55  1.1  christos 	s390-te-linux64 s390x-te-linux64 \
     56  1.1  christos 	tic6x-c64xp tic6x-c64x tic6x-c62x \
     57  1.1  christos 	tic6x-c64xp-linux tic6x-c64x-linux tic6x-c62x-linux
     58  1.1  christos 
     59  1.1  christos # Record which registers should be sent to GDB by default after stop.
     60  1.1  christos aarch64-expedite = x29,sp,pc
     61  1.1  christos arm-expedite = r11,sp,pc
     62  1.1  christos i386/i386-expedite = ebp,esp,eip
     63  1.1  christos i386/i386-linux-expedite = ebp,esp,eip
     64  1.1  christos i386/amd64-expedite = rbp,rsp,rip
     65  1.1  christos i386/amd64-linux-expedite = rbp,rsp,rip
     66  1.1  christos i386/i386-avx-expedite = ebp,esp,eip
     67  1.1  christos i386/i386-avx-linux-expedite = ebp,esp,eip
     68  1.1  christos i386/i386-mpx-expedite = ebp,esp,eip
     69  1.1  christos i386/i386-mpx-linux-expedite = ebp,esp,eip
     70  1.1  christos i386/i386-mmx-expedite = ebp,esp,eip
     71  1.1  christos i386/i386-mmx-linux-expedite = ebp,esp,eip
     72  1.1  christos i386/amd64-avx-expedite = rbp,rsp,rip
     73  1.1  christos i386/amd64-avx-linux-expedite = rbp,rsp,rip
     74  1.1  christos i386/amd64-mpx-expedite = rbp,rsp,rip
     75  1.1  christos i386/amd64-mpx-linux-expedite = rbp,rsp,rip
     76  1.1  christos i386/x32-expedite = rbp,rsp,rip
     77  1.1  christos i386/x32-linux-expedite = rbp,rsp,rip
     78  1.1  christos i386/x32-avx-expedite = rbp,rsp,rip
     79  1.1  christos i386/x32-avx-linux-expedite = rbp,rsp,rip
     80  1.1  christos mips-expedite = r29,pc
     81  1.1  christos mips-dsp-expedite = r29,pc
     82  1.1  christos mips64-expedite = r29,pc
     83  1.1  christos mips64-dsp-expedite = r29,pc
     84  1.1  christos nios2-linux-expedite = sp,pc
     85  1.1  christos powerpc-expedite = r1,pc
     86  1.1  christos rs6000/powerpc-cell32l-expedite = r1,pc,r0,orig_r3,r4
     87  1.1  christos rs6000/powerpc-cell64l-expedite = r1,pc,r0,orig_r3,r4
     88  1.1  christos s390-linux32-expedite = r14,r15,pswa
     89  1.1  christos s390-linux32v1-expedite = r14,r15,pswa
     90  1.1  christos s390-linux32v2-expedite = r14,r15,pswa
     91  1.1  christos s390-linux64-expedite = r14l,r15l,pswa
     92  1.1  christos s390-linux64v1-expedite = r14l,r15l,pswa
     93  1.1  christos s390-linux64v2-expedite = r14l,r15l,pswa
     94  1.1  christos s390-te-linux64-expedite = r14,r15,pswa
     95  1.1  christos s390x-linux64-expedite = r14,r15,pswa
     96  1.1  christos s390x-linux64v1-expedite = r14,r15,pswa
     97  1.1  christos s390x-linux64v2-expedite = r14,r15,pswa
     98  1.1  christos s390x-te-linux64-expedite = r14,r15,pswa
     99  1.1  christos tic6x-c64xp-expedite = A15,PC
    100  1.1  christos tic6x-c64x-expedite = A15,PC
    101  1.1  christos tic6x-c62x-expedite = A15,PC
    102  1.1  christos tic6x-c64xp-linux-expedite = A15,PC
    103  1.1  christos tic6x-c64x-linux-expedite = A15,PC
    104  1.1  christos tic6x-c62x-linux-expedite = A15,PC
    105  1.1  christos 
    106  1.1  christos 
    107  1.1  christos XSLTPROC = xsltproc
    108  1.1  christos outdir = ../regformats
    109  1.1  christos OUTPUTS = $(patsubst %,$(outdir)/%.dat,$(WHICH))
    110  1.1  christos 
    111  1.1  christos XMLTOC =
    112  1.1  christos CFILES = $(patsubst %.xml,%.c,$(XMLTOC))
    113  1.1  christos GDB = false
    114  1.1  christos 
    115  1.1  christos all: $(OUTPUTS)
    116  1.1  christos 
    117  1.1  christos $(outdir)/%.dat: %.xml number-regs.xsl sort-regs.xsl gdbserver-regs.xsl
    118  1.1  christos 	echo "# DO NOT EDIT: generated from $<" > $(outdir)/$*.tmp
    119  1.1  christos 	echo "name:`echo $(notdir $*) | sed 's/-/_/g'`" >> $(outdir)/$*.tmp
    120  1.1  christos 	echo "xmltarget:$(<F)" >> $(outdir)/$*.tmp
    121  1.1  christos 	echo "expedite:$(if $($*-expedite),$($*-expedite),$($(firstword $(subst -, ,$(notdir $*)))-expedite))" \
    122  1.1  christos 	  >> $(outdir)/$*.tmp
    123  1.1  christos 	$(XSLTPROC) --path "$(PWD)" --xinclude number-regs.xsl $< | \
    124  1.1  christos 	  $(XSLTPROC) sort-regs.xsl - | \
    125  1.1  christos 	  $(XSLTPROC) gdbserver-regs.xsl - >> $(outdir)/$*.tmp
    126  1.1  christos 	sh ../../move-if-change $(outdir)/$*.tmp $(outdir)/$*.dat
    127  1.1  christos 
    128  1.1  christos cfiles: $(CFILES)
    129  1.1  christos %.c: %.xml
    130  1.1  christos 	$(GDB) -nx -q -batch \
    131  1.1  christos 	  -ex "set tdesc filename $<" -ex 'maint print c-tdesc' > $@.tmp
    132  1.1  christos 	sh ../../move-if-change $@.tmp $@
    133  1.1  christos 
    134  1.1  christos # Other dependencies.
    135  1.1  christos $(outdir)/arm-with-iwmmxt.dat: arm-core.xml xscale-iwmmxt.xml
    136  1.1  christos $(outdir)/i386/i386.dat: i386/32bit-core.xml i386/32bit-sse.xml
    137  1.1  christos $(outdir)/i386/i386-linux.dat: i386/32bit-core.xml i386/32bit-sse.xml \
    138  1.1  christos 			       i386/32bit-linux.xml
    139  1.1  christos $(outdir)/i386/amd64.dat: i386/64bit-core.xml i386/64bit-sse.xml
    140  1.1  christos $(outdir)/i386/amd64-linux.dat: i386/64bit-core.xml i386/64bit-sse.xml \
    141  1.1  christos 			        i386/64bit-linux.xml
    142  1.1  christos $(outdir)/i386/i386-avx.dat: i386/32bit-core.xml i386/32bit-avx.xml
    143  1.1  christos $(outdir)/i386/i386-avx-linux.dat: i386/32bit-core.xml i386/32bit-avx.xml \
    144  1.1  christos 			       i386/32bit-linux.xml
    145  1.1  christos $(outdir)/i386/i386-mpx.dat: i386/32bit-core.xml i386/32bit-avx.xml \
    146  1.1  christos 			       i386/32bit-mpx.xml
    147  1.1  christos $(outdir)/i386/i386-mpx-linux.dat: i386/32bit-core.xml 	i386/32bit-avx.xml \
    148  1.1  christos 			       i386/32bit-linux.xml i386/32bit-mpx.xml
    149  1.1  christos $(outdir)/i386/i386-mmx.dat: i386/32bit-core.xml 
    150  1.1  christos $(outdir)/i386/i386-mmx-linux.dat: i386/32bit-core.xml i386/32bit-linux.xml
    151  1.1  christos $(outdir)/i386/amd64-avx.dat: i386/64bit-core.xml i386/64bit-avx.xml
    152  1.1  christos $(outdir)/i386/amd64-avx-linux.dat: i386/64bit-core.xml i386/64bit-avx.xml \
    153  1.1  christos 				    i386/64bit-linux.xml
    154  1.1  christos $(outdir)/i386/amd64-mpx-linux.dat: i386/64bit-core.xml i386/64bit-avx.xml \
    155  1.1  christos 			       i386/64bit-linux.xml i386/64bit-mpx.xml
    156  1.1  christos $(outdir)/i386/amd64-mpx.dat: i386/64bit-core.xml i386/64bit-avx.xml \
    157  1.1  christos 			       i386/64bit-mpx.xml
    158  1.1  christos $(outdir)/i386/x32.dat: i386/x32-core.xml i386/64bit-sse.xml
    159  1.1  christos $(outdir)/i386/x32-linux.dat: i386/x32-core.xml i386/64bit-sse.xml \
    160  1.1  christos 			      i386/64bit-linux.xml
    161  1.1  christos $(outdir)/i386/x32-avx.dat: i386/x32-core.xml i386/64bit-avx.xml
    162  1.1  christos $(outdir)/i386/x32-avx-linux.dat: i386/x32-core.xml i386/64bit-avx.xml \
    163  1.1  christos 				  i386/64bit-linux.xml
    164