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

BOSSERVER_BIN	= bosserver

DEFS		= @DEFS@ -DMILKO_LIBEXECDIR=\"$(libexecdir)\" -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@
KAFS_LIBS	= @AIX_EXTRA_KAFS@ @KAFS_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) \
		  $(KAFS_LIBS) \
		  -L../../rxdef -lbosserver \
		  @LIBS@
LIBDEPENDS	= ../../rxdef/libbosserver.a ../../rx/librx.a \
		  ../../lwp/liblwp.a ../../util/libutil.a \
		  ../../lib/roken/libroken.a ../../lib/ko/libko.a \
		  ../lib/msecurity/libmsecurity.a \
		  ../../rxdef/libbosserver.a
PROGS		= bosserver
SRCS		=				\
		kconf.c				\
		bosserver.c			\
		bosprocs.c			

HDRS		= 				\
		kconf.h

bosserver_OBJS	=				\
		kconf.o				\
		bosserver.o			\
		bosprocs.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='$(BOSSERVER_BIN)'; for x in $$PROG_BIN; do \
			f=`echo $$x | sed '$(transform)'`; \
			$(INSTALL_PROGRAM) $$x $(DESTDIR)$(libexecdir)/$$f; \
		done

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

bosserver:	$(bosserver_OBJS) $(LIBDEPENDS)
		$(CC) $(LDFLAGS) -o $@ $(bosserver_OBJS) $(LIBS)

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