COMPILER=gcc -g -I../pnheaders
LEX=flex
YACC=bison
PNDIR=../pnheaders/

generate: actions.o dict.o read.yy.o read.tab.o

actions.o: actions.c read.h dict.h $(PNDIR)*.h
	$(COMPILER) -g -c actions.c

dict.o: dict.c dict.h $(PNDIR)*.h
	$(COMPILER) -g -c dict.c

read.yy.o: read.lex read.h dict.h read.tab.o $(PNDIR)*.h
	$(LEX) -oread.yy.c read.lex
	$(COMPILER) -g -c read.yy.c

read.tab.o: read.y read.h dict.h $(PNDIR)*.h
	$(YACC) -d read.y
	$(COMPILER) -g -c read.tab.c

clean:
	rm *.o || true
