.SUFFIXES: .cc
CCC = g++

three_address: three_address.y lex.yy.c
	bison three_address.y
	mv three_address.tab.c three_address.tab.cc
	$(CCC) -g three_address.tab.cc -o three_address

lex.yy.c: three_address.l
	flex -i three_address.l

test: three_address
	three_address < three_address.test_input > test_output

clean:
	/bin/rm -f *.o three_address.tab.cc lex.yy.c three_address core test_output

tar: clean
	rm -f all.tar
	tar cf all.tar *
	chmod a+r all.tar
