parse : parser.tab.c lex.yy.c
	gcc -g $^ -lfl -lm -o $@

parser.tab.c : parser.y
	bison --defines=parser.tab.h -o $@ $<

ast.ps : parse 
	./parse test.in >ast.dot
	dot -Tps ast.dot > $@

lex.yy.c : scanner.l
	flex $<

clean :
	rm -f parser.tab.* lex.yy.* parse ast.*

.PHONY: clean 
