# Makefile for certify program

include ../Makefile.inc

EXEC = $(BIN)/certify
LIB = $(LIBDIR)/certify.a

all : $(EXEC)

make : 
	../../util/configure.pl make

$(EXEC) : $(LIB) $(CDBSLIBS)
	$(CC) $(LFLAGS) -o $@ $(LIBDIR)/main.o $(LIB) \
	$(CDBSLIBS) $(IRAFLIBS) $(SUNLIBS)

.PRECIOUS : $(LIB)

$(LIB) : $(LIB)(certify.o) \
	$(LIB)(rule.o) \
	$(LIB)(task.o) \
	$(LIB)(template.o)
	ranlib $@

$(LIB)(certify.o) :  certify.c ../../include/error.h \
	../../include/config.h ../../include/cdbslib.h \
	../../include/loadfile.h ../../include/reffile.h certify.h \
	template.h
	$(CC) $(CFLAGS) -c -o certify.o certify.c
	ar -rv $(LIB) certify.o
	rm -f certify.o

$(LIB)(rule.o) :  rule.c ../../include/config.h \
	../../include/error.h ../../include/cdbslib.h \
	../../include/loadfile.h ../../include/reffile.h template.h
	$(CC) $(CFLAGS) -c -o rule.o rule.c
	ar -rv $(LIB) rule.o
	rm -f rule.o

$(LIB)(task.o) :  task.c ../../include/loadfile.h \
	../../include/config.h ../../include/datafile.h \
	../../include/system.h ../../include/cdbslib.h \
	../../include/reffile.h certify.h template.h
	$(CC) $(CFLAGS) -c -o task.o task.c
	ar -rv $(LIB) task.o
	rm -f task.o

$(LIB)(template.o) :  template.c ../../include/config.h \
	../../include/error.h ../../include/cdbslib.h \
	../../include/loadfile.h ../../include/reffile.h template.h
	$(CC) $(CFLAGS) -c -o template.o template.c
	ar -rv $(LIB) template.o
	rm -f template.o


