2 # Id: run_make.sh,v 1.9 2012/01/15 22:35:01 tom Exp
5 # do a test-compile on each of the ".c" files in the test-directory
7 BISON
=`bison --version 2>/dev/null | head -n 1 | sed -e 's/^[^0-9.]*//' -e 's/[^0-9.]*$//'`
18 MY_MAKE
="make -f $PROG_DIR/makefile srcdir=$PROG_DIR VPATH=$TEST_DIR"
21 for input
in ${TEST_DIR}/*.c
23 test -f "$input" ||
continue
25 obj
=`basename "$input" .c`.o
27 $MY_MAKE $obj C_FILES
=$input
28 test -f $obj && rm $obj
33 # DEFS="-DYYLEX_PARAM=flag -DYYLEX_PARAM_TYPE=int"
37 if test "x$DEFS" != "x"
39 $MY_MAKE $obj C_FILES
=$input DEFINES
="$DEFS"
40 test -f $obj && rm -f $obj
46 echo "** compare with bison $BISON"
47 for input
in ${TEST_DIR}/*.y
49 test -f "$input" ||
continue
51 # Bison does not support pure-parser from command-line.
52 # Also, its support for %expect is generally broken.
53 # Work around these issues using a temporary file.
55 echo "... testing $input"
60 if test -z `fgrep -l '%pure-parser' $input`
62 echo "%pure-parser" >>run_make.y
67 sed -e '/^%expect/s,%expect.*,,' $input >>run_make.y
70 sed -e '/^#line/s,"run_make.y","'$input'",' y.tab.c
>run_make.c
78 $MY_MAKE $object DEFINES
='-DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=1 -DYYSTACK_USE_ALLOCA=0 -DYYMAXDEPTH=0'
80 echo "?? $input not found"
87 for name
in /usr
/ccs
/bin
/yacc
97 echo "** compare with $YACC"
98 for input
in ${TEST_DIR}/*.y
100 test -f "$input" ||
continue
102 echo "... testing $input"
107 echo "... skipping $input"
111 if fgrep
'%pure-parser' $input >/dev
/null ||
112 fgrep
'%parse-param' $input >/dev
/null ||
113 fgrep
'%lex-param' $input >/dev
/null ||
114 fgrep
'YYLEX_PARAM' $input >/dev
/null
116 echo "... skipping $input"
122 sed -e '/^%expect/s,%expect.*,,' $input >>run_make.y
125 sed -e '/^#line/s,"run_make.y","'$input'",' y.tab.c
>run_make.c
135 echo "?? $input not found"