###############
#  Makefile   #
#  naveed@cs  #
# Spring 2001 #
###############


#compiler
CC=		gcc

#compiler flags
CFLAGS=		-O3 -I ../Tsai-method-v3.0b3

#linker flags
LFLAGS=		-L ../Tsai-method-v3.0b3

#stripper
STRIP=		strip

#libraries to link
LIBS=		-lm -ltsai

#program names
PROGS=		ccalib

#include sources
INCS=		disjset.c pgm_helper.c

#include objects
INCO=		$(INCS:%.c=%.o)

#all source files
SOURCES=	$(INCS) $(PROGS:%=%.c)

#all object files
OBJECTS=	$(SOURCES:%.c=%.o)


#rule for producing object files
.c.o:
		$(CC) $(CFLAGS) -c $<

#rule for all programs
all:		$(PROGS)
		@echo "[make'd] $(PROGS)"

#link each program
$(PROGS):	$(OBJECTS)
		$(CC) -o $@ $@.o $(INCO) $(LFLAGS) $(LIBS)
		$(STRIP) $@

#clean up objects
clean:
		@rm -f $(OBJECTS) $(PROGS) *.o *~
		@echo "[rm'd] $(OBJECTS) $(PROGS)i *.o *~"


#EOF
