# Makefile for program redblack
CC = /bin/cc
LD = /bin/ld
CFLAGS = -g
FTDIR = /u/emery/code2-emery/code2/runtime/FastThreads
C2DIR = /u/emery/code2-emery/code2/runtime/FastThreads
INC = -I$(FTDIR)/include -I$(C2DIR)
INDENT = /usr/ucb/indent
INDENTFLG = -i2
OBJS = c2_main.o \
      ./comp_black.o ./comp_red.o ./readinput.o ./decomp.o ./printmatrix.o ./overlp_redblack.o ./timer.o \
      graph19.o graph291.o 

redblack:& $(OBJS)
	$(LD) -h -Z0200000 -X $(FTDIR)/lib/crt0.o $(OBJS) $(C2DIR)/c2libg.o\
            -lm $(FTDIR)/lib/thread.a -lpps -lseq -lc -o redblack

clean:
	\rm -f *.o *.pretty core redblack

pretty:
	$(INDENT) c2_globtype.h c2_globtype.h.pretty $(INDENTFLG)
	$(INDENT) c2_main.h c2_main.h.pretty $(INDENTFLG)
	$(INDENT) c2_main.c c2_main.c.pretty $(INDENTFLG)
	$(INDENT) graph19.c graph19.c.pretty $(INDENTFLG)
	$(INDENT) graph291.c graph291.c.pretty $(INDENTFLG)

c2_main.o: c2_main.c
	$(CC) $(CFLAGS) $(INC) -c c2_main.c

graph19.o: graph19.c
	$(CC) $(CFLAGS) $(INC) -c graph19.c

graph291.o: graph291.c
	$(CC) $(CFLAGS) $(INC) -c graph291.c

