* Makefile.am: Add cgen support.
[deliverable/binutils-gdb.git] / opcodes / cgen.sh
1 #! /bin/sh
2 # Generate CGEN opcode files: arch-opc.[ch], arch-asm.c, arch-asm.c.
3 #
4 # We store the generated files in the source directory until we decide to
5 # ship a scheme with gdb/binutils. Maybe we never will.
6
7 srcdir=$1
8 cgendir=$2
9 cgenflags=$3
10 scheme=$4
11 schemeflags=$5
12 arch=$6
13
14 rm -f tmp-opc.h tmp-opc.c tmp-asm.c tmp-dis.c
15 rm -f tmp-opc.h1 tmp-opc.c1 tmp-asm.c1 tmp-dis.c1
16 rm -f tmp-asm.in tmp-asm.in1 tmp-dis.in tmp-dis.in1
17
18 $scheme $schemeflags $cgendir/cgen-opc.scm \
19 -s $cgendir \
20 $cgenflags \
21 -m all \
22 -a $arch \
23 -h tmp-opc.h1 \
24 -t tmp-opc.c1 \
25 -A tmp-asm.in1 \
26 -D tmp-dis.in1
27
28 sed -e "s/@arch@/${arch}/g" < tmp-opc.h1 > tmp-opc.h
29 ${srcdir}/../move-if-change tmp-opc.h ${srcdir}/${arch}-opc.h
30 sed -e "s/@arch@/${arch}/g" < tmp-opc.c1 > tmp-opc.c
31 ${srcdir}/../move-if-change tmp-opc.c ${srcdir}/${arch}-opc.c
32 sed -e "/ -- assembler routines/ r tmp-asm.in1" ${srcdir}/cgen-asm.in \
33 | sed -e "s/@arch@/${arch}/g" > tmp-asm.c
34 ${srcdir}/../move-if-change tmp-asm.c ${srcdir}/${arch}-asm.c
35 sed -e "/ -- disassembler routines/ r tmp-dis.in1" ${srcdir}/cgen-dis.in \
36 | sed -e "s/@arch@/${arch}/g" > tmp-dis.c
37 ${srcdir}/../move-if-change tmp-dis.c ${srcdir}/${arch}-dis.c
38
39 rm -f tmp-opc.h1 tmp-opc.c1 tmp-asm.c1 tmp-dis.c1
40 rm -f tmp-asm.in tmp-asm.in1 tmp-dis.in tmp-dis.in1
This page took 0.056088 seconds and 5 git commands to generate.