9 base=`basename $SRC .y`
10 if [ -z "$YACC" ]; then
11 # if $DEST is more recent than $SRC, we can just touch
12 # otherwise we touch but print out warnings
14 if [ x`find $SRC -newer $DEST -print` = x$SRC ]; then
15 echo "warning: yacc not found - cannot generate $SRC => $DEST" >&2
16 echo "warning: yacc not found - only updating the timestamp of $DEST" >&2
21 echo "error: yacc not found - cannot generate $SRC => $DEST" >&2
24 # if $DEST is more recent than $SRC, we can just touch
26 if [ x`find $SRC -newer $DEST -print` != x$SRC ]; then
32 if cd $dir && $YACC -d $file; then
33 if [ -r y.tab.h -a -r y.tab.c ];then
34 #echo "info: move files"
35 sed -e "/^#/!b" -e "s|y\.tab\.h|$SRC|" -e "s|\"$base.y|\"$SRC|" y.tab.h > $base.h
36 sed -e "s|y\.tab\.c|$SRC|" -e "s|\"$base.y|\"$SRC|" y.tab.c > $base.c
38 elif [ ! -r $base.h -a ! -r $base.c]; then
39 echo "$base.h nor $base.c generated."