* thread.c: cull duplicate prototypes. Move prototypes to top.
[deliverable/binutils-gdb.git] / opcodes / cgen.sh
CommitLineData
bfc10abe
DE
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
3bdf92bd
DE
7# We want to behave like make, any error forces us to stop.
8set -e
9
bfc10abe
DE
10srcdir=$1
11cgendir=$2
12cgenflags=$3
13scheme=$4
14schemeflags=$5
15arch=$6
16
17rm -f tmp-opc.h tmp-opc.c tmp-asm.c tmp-dis.c
18rm -f tmp-opc.h1 tmp-opc.c1 tmp-asm.c1 tmp-dis.c1
19rm -f tmp-asm.in tmp-asm.in1 tmp-dis.in tmp-dis.in1
20
21$scheme $schemeflags $cgendir/cgen-opc.scm \
22 -s $cgendir \
23 $cgenflags \
24 -m all \
25 -a $arch \
26 -h tmp-opc.h1 \
27 -t tmp-opc.c1 \
28 -A tmp-asm.in1 \
29 -D tmp-dis.in1
30
31sed -e "s/@arch@/${arch}/g" < tmp-opc.h1 > tmp-opc.h
32${srcdir}/../move-if-change tmp-opc.h ${srcdir}/${arch}-opc.h
33sed -e "s/@arch@/${arch}/g" < tmp-opc.c1 > tmp-opc.c
34${srcdir}/../move-if-change tmp-opc.c ${srcdir}/${arch}-opc.c
35sed -e "/ -- assembler routines/ r tmp-asm.in1" ${srcdir}/cgen-asm.in \
36 | sed -e "s/@arch@/${arch}/g" > tmp-asm.c
37${srcdir}/../move-if-change tmp-asm.c ${srcdir}/${arch}-asm.c
38sed -e "/ -- disassembler routines/ r tmp-dis.in1" ${srcdir}/cgen-dis.in \
39 | sed -e "s/@arch@/${arch}/g" > tmp-dis.c
40${srcdir}/../move-if-change tmp-dis.c ${srcdir}/${arch}-dis.c
41
42rm -f tmp-opc.h1 tmp-opc.c1 tmp-asm.c1 tmp-dis.c1
43rm -f tmp-asm.in tmp-asm.in1 tmp-dis.in tmp-dis.in1
This page took 0.057348 seconds and 4 git commands to generate.