# $Id: Makefile.in,v 1.8 2000/02/19 07:24:42 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@

PTSERVER_BIN	= ptserver

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)/../../rxkad \
		  -I$(srcdir)/../../lib/acl \
		  -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../lib/msecurity -lmsecurity \
		  -L../../rxdef -lrxfsserver \
		  -L../../lib/acl -lacl \
		  -L../../lib/ko -lko \
		  -L../../util -lutil \
		  -L../../rxdef -lptserver -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
PROGS		= ptserver
SRCS		=				\
		ptserver.c			\
		pr.c

HDRS		= 

ptserver_OBJS	=				\
		ptserver.o			\
		pr.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='$(PTSERVER_BIN)'; for x in $$PROG_BIN; do \
			f=`echo $$x | sed '$(transform)'`; \
			$(INSTALL_PROGRAM) $$x $(DESTDIR)$(libexecdir)/$$f; \
		done

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

ptserver:	$(ptserver_OBJS) $(LIBDEPENDS)
		$(CC) $(LDFLAGS) -o $@ $(ptserver_OBJS) $(LIBS)

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