.cc.o:
	$(CC) $(FLAGS) -c $(OUTPUT_OPTION) $<

CC = g++
FLAGS = 

OBJFILES = interpreter.o system.o symtable.o error.o y.tab.o lex.yy.o

tglc : ${OBJFILES}
	${CC} -o tglc -L/usr/X11R6/lib -lX11 ${OBJFILES}

lex.yy.c: tglc.lex y.tab.h
	flex tglc.lex

y.tab.c: tglc.y code.h
	yacc -d -v tglc.y

symtable.o: symtable.cc symtable.h error.h code.h sysproc.h const.h

interpreter.o: interpreter.cc const.h code.h system.h

system.o: system.cc system.h machine.h sysproc.h

error.o: error.cc error.h


clean:
	rm -f *.o lex.yy.c y.tab.c y.tab.h y.output
