CFLAGS= -g -O -I../mip

OBJ= cgen.o error.o gencode.o ident.o init.o label.o pattern.o main.o \
	nextline.o node.o object.o optim.o p_case.o p_decl.o \
	p_expr.o p_required.o p_stmt.o p_vaccess.o parse.o peep.o scan.o \
	stopset.o syminfo.o typecheck.o

HFILE= ../mip/error.h ../mip/ident.h ../mip/nextline.h ../mip/node.h \
	../mip/object.h ../mip/required.h ../mip/scan.h ../mip/size.h \
	../mip/stopset.h ../mip/tword.h ../mip/types.h

pcomp: $(OBJ)
	$(CC) $(CFLAGS) -o pcomp $(OBJ)

lint:
	lint -I../mip *.c ../mip/*.c

# pattern.c peep.h sem.h labels.h: ../pt/pattern.x
#	../pt/peep < ../pt/pattern.x > pattern.c

cgen.o: cgen.c $(HFILE) peep.h
	$(CC) -c $(CFLAGS) cgen.c
error.o: ../mip/error.c $(HFILE)
	$(CC) -c $(CFLAGS) ../mip/error.c
gencode.o: ../mip/gencode.c $(HFILE)
	$(CC) -c $(CFLAGS) ../mip/gencode.c
ident.o: ../mip/ident.c $(HFILE)
	$(CC) -c $(CFLAGS) ../mip/ident.c
init.o: ../mip/init.c $(HFILE) ../rt/runtime.h
	$(CC) -c $(CFLAGS) ../mip/init.c
label.o: ../mip/label.c $(HFILE)
	$(CC) -c $(CFLAGS) ../mip/label.c
main.o: ../mip/main.c $(HFILE)
	$(CC) -c $(CFLAGS) ../mip/main.c
nextline.o: ../mip/nextline.c $(HFILE)
	$(CC) -c $(CFLAGS) ../mip/nextline.c
node.o: ../mip/node.c $(HFILE)
	$(CC) -c $(CFLAGS) ../mip/node.c
object.o: ../mip/object.c $(HFILE)
	$(CC) -c $(CFLAGS) ../mip/object.c
optim.o: ../mip/optim.c $(HFILE)
	$(CC) -c $(CFLAGS) ../mip/optim.c
p_case.o: ../mip/p_case.c $(HFILE)
	$(CC) -c $(CFLAGS) ../mip/p_case.c
p_decl.o: ../mip/p_decl.c $(HFILE) ../rt/runtime.h
	$(CC) -c $(CFLAGS) ../mip/p_decl.c
p_expr.o: ../mip/p_expr.c $(HFILE) ../rt/runtime.h
	$(CC) -c $(CFLAGS) ../mip/p_expr.c
p_required.o: ../mip/p_required.c $(HFILE)
	$(CC) -c $(CFLAGS) ../mip/p_required.c
p_stmt.o: ../mip/p_stmt.c $(HFILE) ../rt/runtime.h
	$(CC) -c $(CFLAGS) ../mip/p_stmt.c
p_vaccess.o: ../mip/p_vaccess.c $(HFILE)
	$(CC) -c $(CFLAGS) ../mip/p_vaccess.c
parse.o: ../mip/parse.c $(HFILE)
	$(CC) -c $(CFLAGS) ../mip/parse.c
pattern.o: pattern.c peep.h labels.h sem.h
	$(CC) -c $(CFLAGS) pattern.c
peep.o: peep.c peep.h
	$(CC) -c $(CFLAGS) peep.c
scan.o: ../mip/scan.c $(HFILE)
	$(CC) -c $(CFLAGS) ../mip/scan.c
stopset.o: ../mip/stopset.c $(HFILE)
	$(CC) -c $(CFLAGS) ../mip/stopset.c
syminfo.o: syminfo.c $(HFILE) peep.h
	$(CC) -c $(CFLAGS) syminfo.c
typecheck.o: ../mip/typecheck.c $(HFILE)
	$(CC) -c $(CFLAGS) ../mip/typecheck.c
