options =	$(PFLOPT)

xlibs	=	-I/usr/openwin/include		\
		-I/usr/openwin/include/Xol 	\
		-I/usr/openwin/include/X11	\
		-L/usr/openwin/lib		\
		-lXol -lXt -lX11
 
header	=	../header.h	\
		../db/tc/tc.h	../db/df/df.h	../db/hf/hf.h	../db/db.h	\
		../hp/cell.h	../hp/cstack.h	../hp/hp.h	../user/user.h	\
		../expr/expr.h	../type/type.h	../eval/eval.h	../oper/oper.h

auxiliary =	../aux/check.o	../hp/hp.o	../user/*.o	../expr/expr.o	\
		../db/tc/tc.o	../db/df/df.o	../db/hf/hf.o	../db/db.o	\
		../type/type.o	../eval/eval.o	../oper/oper.o	../show/show.o	

npfl:		Makefile $(header) $(auxiliary) y.tab.o handler.o ansifile.o
		g++ -o npfl $(options) $(auxiliary) y.tab.o handler.o ansifile.o -lg++ -lc

handler.o:	Makefile handler.c
		gcc -c $(options) handler.c

ansifile.o:	Makefile ansifile.c
		gcc -c $(options) ansifile.c

y.tab.o:	Makefile $(header) y.tab.C lex.yy.C
		g++ -c $(options) y.tab.C

y.tab.C:	Makefile $(header) parser
		yacc -t -v -d parser
		cp y.tab.c y.tab.C

lex.yy.C:	Makefile $(header) analyser
		flex -I analyser
		cp lex.yy.c lex.yy.C


