# $Id: Makefile.in,v 1.10 2000/02/25 21:12:41 lha Exp $

srcdir		= @srcdir@
VPATH		= @srcdir@

CC		= @CC@

INSTALL		= @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA	= @INSTALL_DATA@
MKINSTALLDIRS 	= @top_srcdir@/mkinstalldirs

prefix 		= @prefix@
exec_prefix 	= @exec_prefix@
libdir 		= @libdir@
libexecdir 	= @libexecdir@
bindir 		= @bindir@
sysconfdir	= @sysconfdir@
transform	= @program_transform_name@

VLDBSERVER_BIN	= vldbserver

DEFS		= @DEFS@ -DMILKO_SYSCONFDIR=\"$(sysconfdir)\"

SHELL		= /bin/sh

CFLAGS		= @CFLAGS@
LDFLAGS		= @LDFLAGS@

ETAGS		= etags
MAKEDEPEND	= makedepend
AFSWSROOT	= /usr/afsws
RXKADINC	= -I$(srcdir)/../rxkad
INCLUDES	= -I$(srcdir)/../.. \
		  -I../../include \
		  -I$(srcdir)/../../include \
		  -I$(srcdir)/../lib/msecurity \
		  -I../../rxdef \
		  $(RXKADINC)
DEFINES		= -DDEBUG
REALCFLAGS	= $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) -DRXDEBUG
RXKADLIB	= @MILKO_RXKAD_LIBS@
LIBS		= -L../../rxdef -lrxvlserver \
		  -L../lib/msecurity -lmsecurity \
		  -L../../lib/acl -lacl \
		  -L../../rxdef -lrxvolserver -lrxfsserver -L../../rx -lrx \
		  -L../../lib/ko -lko \
		  -L../../util -lutil \
		  -L../../lwp -llwp @PLWP_LIB_FLAGS@ \
		  -L../../lib/roken -lroken $(RXKADLIB) \
		  @LIBS@
LIBDEPENDS	= ../../rxdef/librxdefclient.a ../../rx/librx.a \
		  ../../lwp/liblwp.a ../../util/libutil.a \
		  ../../lib/roken/libroken.a ../../lib/ko/libko.a \
		  ../lib/voldb/libvoldb.a ../lib/vld/libvld.a \
		  ../lib/msecurity/libmsecurity.a
PROGS		= vldbserver vled

SRCS		=				\
		vled.c				\
		vld_db.c			\
		vldbserver.c			\
		ubikprocs.c

HDRS		= 

vldbserver_OBJS	=				\
		vl_db.o				\
		vldbserver.o			\
		ubikprocs.o

vled_OBJS	=				\
		vled.o				\
		vl_db.o


.PHONY: all install uninstall depend tags clean

all:		$(PROGS)

.c.o:
		$(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<

install: all
		$(MKINSTALLDIRS) $(DESTDIR)$(libexecdir)
		PROG_BIN='$(VLDBSERVER_BIN)'; for x in $$PROG_BIN; do \
			f=`echo $$x | sed '$(transform)'`; \
			$(INSTALL_PROGRAM) $$x $(DESTDIR)$(libexecdir)/$$f; \
		done

uninstall:
		PROG_BIN='$(VLDBSERVER_BIN)'; for x in $$PROG_BIN; do \
			f=`echo $$x | sed '$(transform)'`; \
			rm -f $(DESTDIR)$(libexecdir)/$$f; \
		done

vldbserver:	$(vldbserver_OBJS) $(LIBDEPENDS)
		$(CC) $(LDFLAGS) -o $@ $(vldbserver_OBJS) $(LIBS)

vled:		$(vled_OBJS) $(LIBDEPENDS)
		$(CC) $(LDFLAGS) -o $@ $(vled_OBJS) $(LIBS)

Makefile:	Makefile.in ../../config.status
		cd ../..; CONFIG_FILES=milko/vldb/Makefile CONFIG_HEADERS= $(SHELL) config.status

depend:		$(SRCS)
		$(MAKEDEPEND) -- $(REALCFLAGS) -- $^

tags:		TAGS

TAGS:		$(SRCS) $(HDRS)
		$(ETAGS) -t $(SRCS) $(HDRS)

clean		:
		rm -f $(PROGS) $(OBJS) *~ *.o core *.core

mostlyclean:	clean

distclean:	clean
		rm -f Makefile config.status

realclean:	distclean
		rm -f TAGS
