thisconfigdir=.
myfulldir=lib/rpc
mydir=.
BUILDTOP=$(REL)$(U)$(S)$(U)
DEFINES = -DGSSAPI_KRB5 -DDEBUG_GSSAPI=0

##DOSBUILDTOP = ..\..
##DOSLIBNAME=libgssrpc.lib

LIB=gssrpc
LIBMAJOR=3
LIBMINOR=0
STOBJLISTS=OBJS.ST
SHLIB_EXPDEPS= \
	$(TOPLIBD)/libgssapi_krb5$(SHLIBEXT) \
	$(TOPLIBD)/libkrb5$(SHLIBEXT) \
	$(TOPLIBD)/libk5crypto$(SHLIBEXT) \
	$(TOPLIBD)/libcom_err$(SHLIBEXT) \
	$(TOPLIBD)/libdyn$(SHLIBEXT)
SHLIB_EXPLIBS=-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -ldyn
SHLIB_DIRS=-L$(TOPLIBD)
SHLIB_RDIRS=$(KRB5_LIBDIR)
RELDIR=rpc

SRCS = $(srcdir)/auth_none.c \
	$(srcdir)/auth_unix.c \
	$(srcdir)/auth_any.c \
	$(srcdir)/authunix_prot.c \
	$(srcdir)/auth_gssapi.c \
	$(srcdir)/auth_gssapi_misc.c \
	$(srcdir)/bindresvport.c \
	$(srcdir)/clnt_generic.c \
	$(srcdir)/clnt_perror.c \
	$(srcdir)/clnt_raw.c \
	$(srcdir)/clnt_simple.c \
	$(srcdir)/clnt_tcp.c \
	$(srcdir)/clnt_udp.c \
	$(srcdir)/rpc_dtablesize.c \
	$(srcdir)/get_myaddress.c \
	$(srcdir)/getrpcport.c \
	$(srcdir)/pmap_clnt.c \
	$(srcdir)/pmap_getmaps.c \
	$(srcdir)/pmap_getport.c \
	$(srcdir)/pmap_prot.c \
	$(srcdir)/pmap_prot2.c \
	$(srcdir)/pmap_rmt.c \
	$(srcdir)/rpc_prot.c \
	$(srcdir)/rpc_commondata.c \
	$(srcdir)/rpc_callmsg.c \
	$(srcdir)/svc.c \
	$(srcdir)/svc_auth.c \
	$(srcdir)/svc_auth_unix.c \
	$(srcdir)/svc_auth_any.c \
	$(srcdir)/svc_auth_gssapi.c \
	$(srcdir)/svc_raw.c \
	$(srcdir)/svc_run.c \
	$(srcdir)/svc_simple.c \
	$(srcdir)/svc_tcp.c \
	$(srcdir)/svc_udp.c \
	$(srcdir)/xdr.c \
	$(srcdir)/xdr_array.c \
	$(srcdir)/xdr_float.c \
	$(srcdir)/xdr_mem.c \
	$(srcdir)/xdr_rec.c \
	$(srcdir)/xdr_reference.c \
	$(srcdir)/xdr_stdio.c \
	$(srcdir)/xdr_alloc.c

OBJS = auth_none.$(OBJEXT) \
	auth_unix.$(OBJEXT) \
	auth_any.$(OBJEXT) \
	authunix_prot.$(OBJEXT) \
	auth_gssapi.$(OBJEXT) \
	auth_gssapi_misc.$(OBJEXT) \
	bindresvport.$(OBJEXT) \
	clnt_generic.$(OBJEXT) \
	clnt_perror.$(OBJEXT) \
	clnt_raw.$(OBJEXT) \
	clnt_simple.$(OBJEXT) \
	clnt_tcp.$(OBJEXT) \
	clnt_udp.$(OBJEXT) \
	rpc_dtablesize.$(OBJEXT) \
	get_myaddress.$(OBJEXT) \
	getrpcport.$(OBJEXT) \
	pmap_clnt.$(OBJEXT) \
	pmap_getmaps.$(OBJEXT) \
	pmap_getport.$(OBJEXT) \
	pmap_prot.$(OBJEXT) \
	pmap_prot2.$(OBJEXT) \
	pmap_rmt.$(OBJEXT) \
	rpc_prot.$(OBJEXT) \
	rpc_commondata.$(OBJEXT) \
	rpc_callmsg.$(OBJEXT) \
	svc.$(OBJEXT) \
	svc_auth.$(OBJEXT) \
	svc_auth_unix.$(OBJEXT) \
	svc_auth_any.$(OBJEXT) \
	svc_auth_gssapi.$(OBJEXT) \
	svc_raw.$(OBJEXT) \
	svc_run.$(OBJEXT) \
	svc_simple.$(OBJEXT) \
	svc_tcp.$(OBJEXT) \
	svc_udp.$(OBJEXT) \
	xdr.$(OBJEXT) \
	xdr_array.$(OBJEXT) \
	xdr_float.$(OBJEXT) \
	xdr_mem.$(OBJEXT) \
	xdr_rec.$(OBJEXT) \
	xdr_reference.$(OBJEXT) \
	xdr_stdio.$(OBJEXT) \
	xdr_alloc.$(OBJEXT)

STLIBOBJS = \
	auth_none.o \
	auth_unix.o \
	auth_any.o \
	authunix_prot.o \
	auth_gssapi.o \
	auth_gssapi_misc.o \
	bindresvport.o \
	clnt_generic.o \
	clnt_perror.o \
	clnt_raw.o \
	clnt_simple.o \
	clnt_tcp.o \
	clnt_udp.o \
	rpc_dtablesize.o \
	get_myaddress.o \
	getrpcport.o \
	pmap_clnt.o \
	pmap_getmaps.o \
	pmap_getport.o \
	pmap_prot.o \
	pmap_prot2.o \
	pmap_rmt.o \
	rpc_prot.o \
	rpc_commondata.o \
	rpc_callmsg.o \
	svc.o \
	svc_auth.o \
	svc_auth_unix.o \
	svc_auth_any.o \
	svc_auth_gssapi.o \
	svc_raw.o \
	svc_run.o \
	svc_simple.o \
	svc_tcp.o \
	svc_udp.o \
	xdr.o \
	xdr_array.o \
	xdr_float.o \
	xdr_mem.o \
	xdr_rec.o \
	xdr_reference.o \
	xdr_stdio.o \
	xdr_alloc.o

HDRDIR=$(BUILDTOP)/include/gssrpc

HDRS=	$(HDRDIR)/auth.h \
	$(HDRDIR)/auth_gssapi.h \
	$(HDRDIR)/auth_unix.h \
	$(HDRDIR)/clnt.h \
	$(HDRDIR)/netdb.h \
	$(HDRDIR)/pmap_clnt.h \
	$(HDRDIR)/pmap_prot.h \
	$(HDRDIR)/pmap_rmt.h \
	$(HDRDIR)/rpc.h \
	$(HDRDIR)/rpc_msg.h \
	$(HDRDIR)/svc.h \
	$(HDRDIR)/svc_auth.h \
	$(HDRDIR)/types.h \
	$(HDRDIR)/xdr.h

all-prerecurse:: includes
all-prerecurse:: all-liblinks

all-windows:: $(OBJS)

install-unix:: install-libs

BUILD_HDRS = types.h
SRC_HDRS = auth.h auth_gssapi.h auth_unix.h clnt.h netdb.h pmap_clnt.h \
	pmap_prot.h pmap_rmt.h rpc.h rpc_msg.h svc.h svc_auth.h \
	xdr.h

includes:: $(SRC_HDRS) $(BUILD_HDRS)
	if [ -d $(HDRDIR) ]; then :; else mkdir -p $(HDRDIR); fi
	for i in $(SRC_HDRS) ; do \
		i=`basename $$i`; \
		if cmp $(srcdir)/$$i $(HDRDIR)/$$i >/dev/null 2>&1; then :; \
		else \
			(set -x; $(RM) $(HDRDIR)/$$i; \
			 $(CP) $(srcdir)/$$i $(HDRDIR)/$$i) ; \
		fi ; \
	done
	for i in $(BUILD_HDRS) ; do \
		i=`basename $$i`; \
		if cmp $$i $(HDRDIR)/$$i >/dev/null 2>&1; then :; \
		else \
			(set -x; $(RM) $(HDRDIR)/$$i; \
			 $(CP) $$i $(HDRDIR)/$$i) ; \
		fi ; \
	done

clean-unix::
	$(RM) $(HDRS)
	for i in $(SRC_HDRS) $(BUILD_HDRS) ; do \
		$(RM) $(HDRDIR)/$$i ; \
	done

check-windows::

clean-unix:: clean-liblinks clean-libs clean-libobjs

clean-windows::

# Should only rebuild types.h here (use CONFIG_FILES=), but the weird krb5
# makefile post-processing is unconditional and would trash the makefile.
types.h: types.stamp
types.stamp: $(srcdir)/types.hin config.status
	$(SHELL) config.status
	touch types.stamp

clean-unix::
	$(RM) types.h types.stamp
clean-mac::
	$(RM) types.h types.stamp
clean-windows::
	$(RM) types.h types.stamp
