summaryrefslogtreecommitdiff
path: root/envytools/rnn/update.sed.sh
blob: 8127b5cf161d1c15581cb3f81968c49d4e269012 (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
#!/bin/bash
if test renouveau.xml -nt renouveau; then
	./renouveau2rnn
fi

for i in renouveau/*; do
	if test "${i:${#i} - 4:4}" == ".xml"; then
		continue
	fi

	if test "$i" -nt "$i.xml"; then
		./text2xml "$i" > "$i.xml"
	fi
done

function addrs
{
	sed -nre "s/d NV01_SUBCHAN ([^ ]*) ([^ ]*).*/\1 \2/p"
}

function gen
{
	join <(./expand "$3" -v obj-class "$1"|addrs|sort) <(./expand "$4" -v obj-class "$2"|addrs|sort)|sed -re 's@\([^()]*\)@@g; s@([^ ]*) ([^ ]*) ([^ ]*)@s/\2/\3/g;@g; s@s/NV..TCL_@s/'"$1"'_@'|sort|uniq
}

gen NV10TCL NV10TCL renouveau/nv10-20tcl.xml nv10_3d.xml
gen NV20TCL NV20TCL renouveau/nv10-20tcl.xml nv20_3d.xml
gen NV34TCL NV30_3D renouveau/nv30-40tcl.xml nv30-40_3d.xml
gen NV40TCL NV40_3D renouveau/nv30-40tcl.xml nv30-40_3d.xml
gen NV50TCL NV50_3D renouveau/nv50tcl.xml nv50_3d.xml