#
#  Makefile for the Gatherer-Collector server interface.
#
#  Makefile.in,v 1.24 1995/11/16 19:26:34 duane Exp
#
prefix = @prefix@
INSTALL_BINDIR	= $(prefix)/bin
INSTALL_LIBDIR	= $(prefix)/lib
INSTALL_UTILDIR	= $(INSTALL_LIBDIR)/gatherer
INSTALL_MANDIR 	= $(prefix)/man

CC		= @CC@
INSTALL		= @INSTALL@
INSTALL_BIN 	= @INSTALL_PROGRAM@
INSTALL_FILE 	= @INSTALL_DATA@
RANLIB		= @RANLIB@
LN_S		= @LN_S@
XTRA_LIBS	= @XTRA_LIBS@

DEBUG		= $(DEBUG_TOP) #-O #-g #-DDEBUG
DEBUG_LIBS	= 
CFLAGS 		= $(DEBUG) $(INCLUDE)
INCLUDE		= -I../../common/include 
LDFLAGS		= -L../../common/lib 
LIBS		= -ltemplate -lutil -lgdbm $(DEBUG_LIBS) $(XTRA_LIBS)
OBJS		= gatherd.o collect.o
PROGS		= gather 
UTILS		= gatherd mkindex mkcompressed kill-gatherd

all:		$(PROGS) $(UTILS)

install:	all
	@for f in $(PROGS) ; do \
		echo $(INSTALL_BIN) $$f $(INSTALL_BINDIR); \
		$(INSTALL_BIN) $$f $(INSTALL_BINDIR); \
	done
	@for f in $(UTILS); do \
		echo $(INSTALL_BIN) $$f $(INSTALL_UTILDIR); \
		$(INSTALL_BIN) $$f $(INSTALL_UTILDIR); \
	done
	-rm -f $(INSTALL_UTILDIR)/in.gatherd
	(cd $(INSTALL_UTILDIR); $(LN_S) gatherd in.gatherd)

clean:
	-rm -f core *.o $(PROGS) gatherd mkindex

realclean:	clean
	-rm -f Makefile

gatherd:	$(OBJS)
	$(CC) -o $@ $(OBJS) $(LDFLAGS) $(LIBS)

mkindex:	mkindex.o
	$(CC) -o $@ $@.o $(LDFLAGS) $(LIBS)

gather:	gather.o
	$(CC) -o $@ $@.o $(LDFLAGS) $(XTRA_LIBS)
