#
#    Proteus Parallel Architecture Simulator
#    Eric A. Brewer  and  Chris N. Dellarocas
#    Laboratory for Computer Science
#    Massachusetts Institute of Technology
#
#    Module:  Makefile for catoc, catis
#
#    Originally written by Chris Dellarocas
#    Last Modified:       11-25-92 (eab)
#

 
CC = $(INIT_CC)
YACC = $(INIT_YACC)
CFLAGS = -O

# -DSKIP_COMMENTS -DDEBUG -DTREEDEBUG -DLTREEDEBUG -DFREEDEBUG

obj =  decl.o main.o out.o stralloc.o symtable.o tables.o c-lex.o \
	tree.o expr.o primary.o unary.o ipistmt.o

catoc: $(obj)
	$(CC) -o catoc $(obj)

catis: catis.c
	$(CC) $(CFLAGS) -o catis catis.c

main.o: cprep.h 
out.o: cprep.h symtable.h out.c
stralloc.o: cprep.h symtable.h
symtable.o: cprep.h symtable.h yyconsts.h
tables.o: cprep.h symtable.h tables.c
decl.o: cprep.h symtable.h yyconsts.h decl.c
expr.o: cprep.h symtable.h yyconsts.h
primary.o: cprep.h symtable.h yyconsts.h
unary.o: cprep.h symtable.h yyconsts.h
ipistmt.o: cprep.h symtable.h yyconsts.h
c-lex.c: cprep.h yyconsts.h symtable.h parse.y
	$(YACC) -d parse.y
	@ echo "****   Should have 10 s/r conflicts, 1 r/r conflict"
	mv y.tab.c  c-lex.c

c-lex.o: c-lex.c
	$(CC) $(CFLAGS)  -c c-lex.c

tree.o: cprep.h symtable.h tree.c

catoc-test: test.c
	cc -E -D_CA_ test.c | catoc -i test.c -o test.i
	cc -S test.i
	augment test.s -o aug-test.s
	cc aug-test.s -o catoc-test

clean:
	/bin/rm -f *.s *.i *~ tmp*

reset:
	/bin/rm -f *.o c-lex.c *.s *.i *~ *.is y.tab.h

superreset: reset
	/bin/rm -f catoc catoc-test catis
