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 40 41 42
|
#!/bin/sh
varname=`basename $1 | tr "[a-z]" "[A-Z]" | tr "-" "_" | tr "." "_"`
echo "/* This file is automatically generated from"
echo " * $1"
echo " * Do not edit it directly, but edit the source file and rerun 'make'"
echo " */"
echo
echo "#define $varname \\"
comment=false
IFS="
"
while read line; do
line=`echo "$line" | sed -e 's/\/\*.*\*\///g' | sed -e 's/[ ]*$//g'`
if [ -z "$line" ]; then
continue
fi
if [ "$comment" = "false" ] && echo "$line" | fgrep '/*' >/dev/null; then
comment=true
fi
if [ "$comment" = "true" ] && echo "$line" | fgrep '*/' >/dev/null; then
comment=false
continue
fi
if [ "$comment" = "true" ]; then
continue
fi
line="`echo "$line" | sed -e 's/"/\\"/g'`" #' hi, emacs syntax coloring!
if [ -n "$line" ]; then
echo " \"$line \"\\"
fi
done
echo ' ""'
|