summaryrefslogtreecommitdiff
path: root/src/arch/arm/v7/build_tmp_decl.sh
blob: 1833f1beeac50f2c96303d9d0be556e20d0e91e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh


arch=$1
header="opcodes/${arch}_opcodes.h"
headertmp="opcodes/opcodes_tmp_$arch.h"

echo "#ifndef ${arch}_def_tmp_h" > $headertmp
echo "#define ${arch}_def_tmp_h" >> $headertmp

target=armv7_read_${arch}_instr

needed=`grep $target $arch.c | sed "s/.*\(${target}_[^(]*\).*/\1/" | sort | uniq`

for n in $needed; do

	echo "  $n..."

	grep -q "$n(" $header
	if [ $? -ne 0 ]; then

		echo "#define $n(r) NULL" >> $headertmp

	else

		echo "$n found in $header"

	fi

done

echo "#endif" >> $headertmp