summaryrefslogtreecommitdiffstats
path: root/hacks/m6502.sh
diff options
context:
space:
mode:
Diffstat (limited to 'hacks/m6502.sh')
-rwxr-xr-xhacks/m6502.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/hacks/m6502.sh b/hacks/m6502.sh
new file mode 100755
index 0000000..30f338c
--- /dev/null
+++ b/hacks/m6502.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+TARGET=$1
+shift
+SRCS=$*
+
+TMP1=m6502.h.1.$$
+TMP2=m6502.h.2.$$
+rm -f $TMP1 $TMP2
+trap "rm -f $TMP1 $TMP2" 1 2 3 15 EXIT
+
+if [ -z "$UTILS_SRC" ]; then UTILS_SRC="../utils"; fi
+
+for f in $SRCS ; do
+ sed 's/[ ]*;.*$//' < "$f" > $TMP1 # lose comments
+ sh "$UTILS_SRC/ad2c" $TMP1 |
+ sed 's/",$/\\n"/' >> $TMP2
+ echo ',' >> $TMP2
+done
+rm -f $TMP1
+if cmp -s $TMP2 $TARGET ; then
+ rm -f $TMP2
+else
+ mv $TMP2 $TARGET
+fi
+