From http://www.jwz.org/xscreensaver/xscreensaver-5.30.tar.gz
[xscreensaver] / hacks / m6502.sh
1 #!/bin/sh
2
3 TARGET=$1
4 shift
5 SRCS=$*
6
7 TMP1=m6502.h.1.$$
8 TMP2=m6502.h.2.$$
9 rm -f $TMP1 $TMP2
10
11 if [ -z "$UTILS_SRC" ]; then UTILS_SRC="../utils"; fi
12
13 for f in $SRCS ; do
14   sed 's/[      ]*;.*$//' < "$f" > $TMP1  # lose comments
15   sh "$UTILS_SRC/ad2c" $TMP1 |
16     sed 's/",$/\\n"/' >> $TMP2
17   echo ',' >> $TMP2
18 done
19 rm $TMP1
20 if cmp -s $TMP2 $TARGET ; then
21   rm $TMP2
22 else
23   mv $TMP2 $TARGET
24 fi
25