2 # Usage: gentvals.sh type dir files pattern cpp
6 # FIXME: Would be nice to process #include's in these files.
11 # FIXME: need trap to remove tmp files.
13 rm -f tmpvals.list tmpvals.
uniq
16 if test -f $dir/$f ; then
17 grep "#define[ ]$pattern" $dir/$f |
sed -e "s/^.*#define[ ]\($pattern\)[ ]*\([^ ][^ ]*\).*$/\1/" >> tmpvals.list
21 sort <tmpvals.list |
uniq >tmpvals.
uniq
26 if test -f $dir/$f ; then
27 echo "#include <$f>" >>tmpvals.h
34 echo "#ifdef $sym" >>tmpvals.h
35 echo 'DEFVAL { "'$sym'", '$sym ' },' >>tmpvals.h
36 echo "#endif" >>tmpvals.h
39 echo "#ifdef ${type}_defs"
42 if test -f $dir/$f ; then
46 echo "/* begin $type target macros */"
47 $cpp tmpvals.h |
grep DEFVAL |
sed -e 's/DEFVAL//' -e 's/ / /'
48 echo "/* end $type target macros */"
51 rm -f tmpvals.list tmpvals.
uniq tmpvals.h
This page took 0.030813 seconds and 4 git commands to generate.