summaryrefslogtreecommitdiff
path: root/plugins/arm/v7/build_tmp_decl.sh
blob: 0d0feeef9174f76b1f227bb0d3c4b2854ab1cda9 (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
36
37
38
39
#!/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..."

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

		if [ $arch = "simd" ]; then
			echo "#define $n(r, a) NULL" >> $headertmp
		else
			echo "#define $n(r) NULL" >> $headertmp
		fi

	else

		echo "$n found in $header"

	fi

done

echo "#endif" >> $headertmp