mkblobfil (345B)
1 #!/bin/sh 2 3 set -e 4 rm -f blob.h 5 trap 'rm -f $$.tmp' EXIT HUP INT QUIT TERM 6 7 for i 8 do 9 file=$i 10 sym=`basename $i | sed 's/\..*//'` 11 12 cat <<-EOF 13 14 `od -td1 -v -A n $file | 15 tr ' \t' '\n' | 16 awk -v sym=$sym ' 17 BEGIN {printf "char %s[] = {\n", sym} 18 NF == 1 {printf "\t%d,\n", $1} 19 END {print "};"}'` 20 21 EOF 22 done > $$.tmp && mv $$.tmp blobfil.h