# $Id: Makefile.in,v 1.17 2000/07/21 13:12:53 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@

FSERVER_BIN	= fileserver

DEFS		= @DEFS@ 

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)/../include \
		  -I$(srcdir)/../lib/ropa \
		  -I$(srcdir)/../../lib/bufdir \
		  -I$(srcdir)/../lib/voldb \
		  -I$(srcdir)/../lib/mlog \
		  -I$(srcdir)/../lib/msecurity \
		  -I$(srcdir)/../lib/dpart \
		  -I$(srcdir)/../lib/vld \
		  -I$(srcdir)/../lib/vstatus \
		  -I../lib/vstatus \
		  -I../../rxdef \
		  $(RXKADINC)
DEFINES		= -DDEBUG
REALCFLAGS	= $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) -DRXDEBUG
RXKADLIB	= @MILKO_RXKAD_LIBS@
KAFS_LIBS	= @AIX_EXTRA_KAFS@ @KAFS_LIBS@
LIBS		= -L../lib/mlog -lmlog \
		  -L../lib/vld -lvld \
		  -L../lib/vstatus -lvstatus \
		  -L../lib/voldb -lvoldb \
		  -L../lib/dpart -ldpart \
		  -L../lib/msecurity -lmsecurity \
		  -L../lib/ropa -lropa \
		  -L../../lib/acl -lacl \
		  -L../../lib/bufdir -lbufdir \
		  -L../../rxdef -lrxfsserver \
		  -L../../rxdef -lptclient \
		  -L../../lib/ko -lko \
		  -L../../util -lutil \
		  -L../../rxdef -lrxvolserver -lrxfsserver -L../../rx -lrx \
		  -L../../lwp -llwp @PLWP_LIB_FLAGS@ \
		  -L../../lib/roken -lroken $(RXKADLIB) \
		  $(KAFS_LIBS) \
		  @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 ../../lib/ko/libko.a \
		  ../lib/dpart/libdpart.a ../../rxdef/libptclient.a \
		  ../../lib/acl/libacl.a ../lib/ropa/libropa.a \
		  ../lib/mlog/libmlog.a
PROGS		= fileserver
SRCS		=				\
		fileserver.c			\
		fsprocs.c			\
		volprocs.c			\
		connsec.c

HDRS		= \
		fs_def.h			\
		fsrv_locl.h

fileserver_OBJS	=				\
		fileserver.o			\
		fsprocs.o			\
		volprocs.o			\
		connsec.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='$(FSERVER_BIN)'; for x in $$PROG_BIN; do \
			f=`echo $$x | sed '$(transform)'`; \
			$(INSTALL_PROGRAM) $$x $(DESTDIR)$(libexecdir)/$$f; \
		done

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

fileserver:	$(fileserver_OBJS) $(LIBDEPENDS)
		$(CC) $(LDFLAGS) -o $@ $(fileserver_OBJS) $(LIBS)

Makefile:	Makefile.in ../../config.status
		cd ../..; CONFIG_FILES=milko/fs/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
