TESTS= TESTS_G= OBJECTS= OBJECTS_G= for x in *.p7 do b=`basename $x .p7` TESTS="$TESTS $b" TESTS_G="$TESTS_G ${b}_g" OBJECTS="$OBJECTS $b.so" OBJECTS_G="$OBJECTS_G ${b}_g.so" done TESTS_NEG= for x in neg-*.tcl do b=`basename $x .tcl` TESTS_NEG="$TESTS_NEG $b" done cat << HERE ### Makefile generated by $0 P7TCLSH=@TCLSH@ all: tests_g tests negative tests_g : c_arcfour $TESTS_G @echo "" @echo "OKAY. Tests compiled with debugging enabled passed." @echo "" tests : c_arcfour $TESTS @echo "" @echo "OKAY. Tests compiled with optimizations passed." @echo "" negative : $TESTS_NEG @echo "" @echo "OKAY. Negative tests passed. (Ignore expected error reports on lines beginning ====== above.)" @echo "" clean : rm -f c_arcfour *.so ___*.c ___*.err ___*.out ___*.gripe .FORCE: HERE echo "" echo "#-------------" echo "" for b in $TESTS do echo "${b}_g : ${b}_g.so .FORCE" echo " @echo ---------------------------- Running Test ${b}_g" echo " \$(P7GRIND) \$(P7TCLSH) $b.p7 -g" echo "" echo "$b : $b.so .FORCE" echo " @echo ---------------------------- Running Test ${b}" echo " \$(P7GRIND) \$(P7TCLSH) $b.p7" echo "" echo "" echo "${b}_g.so : $b.p7 ../libp7tcl_g.a" echo " P7LIB=.. P7INCLUDE=.. sh ../p7c -g $b.p7 -g -O1" echo "" echo "$b.so : $b.p7 ../libp7tcl.a" echo " P7LIB=.. P7INCLUDE=.. sh ../p7c $b.p7 -O3" echo "" done echo "" echo "#------------- negative tests" echo "" for b in $TESTS_NEG do echo "$b : .FORCE" echo " @echo ----------- negative compilation test $b.tcl" echo " if ( \$(P7TCLSH) ../p7translate.tcl $b.tcl > ___$b.out 2> ___$b.err ); then false; else true; fi" echo " grep '^======' ___$b.err | head -1 > ___$b.gripe" echo " grep -e \"\`head -1 $b.tcl | sed s/^#expect:// \`\" ___$b.gripe" done