PROGRAM=byacc
TYACCROOT=..
all_tests:
	-../$(PROGRAM) -dv -b error error.y
	-../$(PROGRAM) -dv -b ftp -p ftp ftp.y
	-../$(PROGRAM) -P -dv -b calc calc.y
	-../$(PROGRAM) -P -dv -b getdate getdate.y

clean:  
	rm y.* *.tcl

# first generate the y.tab.h file for lex: -d option ONLY
# then generate the parser in tcl: -T option
tcalc.tcl:  tcalc.y 
	$(TYACCROOT)/byacc -d tcalc.y
	mv y.tab.h tmp.h
	cat tmp.h $(TYACCROOT)/lib/yylvaltype.h > y.tab.h
	$(TYACCROOT)/byacc -T tcalc.y
	echo "#!/projects/tcl/sun4/bin/tcl -f" > tcalc.tcl
	cat  y.tab.tcl  $(TYACCROOT)/lib/ParserUtils.tcl  >> tcalc.tcl
	chmod a+x tcalc.tcl
