# Copyright 2000, International Business Machines Corporation and others.
# All Rights Reserved.
# 
# This software has been released under the terms of the IBM Public
# License.  For details, see the LICENSE file in the top-level source
# directory or online at http://www.openafs.org/dl/license10.html

# This is a pthread safe library containing ubikclient, auth, kauth.

srcdir=@srcdir@
include @TOP_OBJDIR@/src/config/Makefile.config
include @TOP_OBJDIR@/src/config/Makefile.libtool

# Increment these according to libtool's versioning rules (look them up!)
# The output library looks like libafsauthen.<current - age>.<revision>
LT_current = 2
LT_revision = 0
LT_age = 0

LT_objs = \
	$(top_builddir)/src/audit/libaudit_pic.la \
	$(top_builddir)/src/auth/libauth_pic.la   \
	$(top_builddir)/src/kauth/libkauth_pic.la \
	$(top_builddir)/src/ubik/libauthent_ubik.la \
	$(top_builddir)/src/sys/libsys_pic.la \
	$(top_builddir)/src/ptserver/libprot_pic.la \
	$(top_builddir)/src/volser/libvolser_pic.la \
	$(top_builddir)/src/vlserver/libvlserver_pic.la \
	$(top_builddir)/src/opr/libopr_pic.la \
	$(top_builddir)/src/util/libafsutil_pic.la

LT_deps = \
	$(top_builddir)/src/libafsrpc/libafsrpc.la

LT_libs = $(LIB_hcrypto) $(LIB_roken) $(LIB_crypt) $(LIB_AFSDB) $(MT_LIBS)

@SHARED_ONLY@SHARED_LIBS = libafsauthent.la

all: $(SHARED_LIBS) libafsauthent_pic.la \
	$(TOP_LIBDIR)/libafsauthent.a \
	$(TOP_LIBDIR)/libafsauthent_pic.a

libafsauthent.la: libafsauthent.la.sym $(LT_objs) $(LT_deps) libafsauthent_pic.la libafsauthent.a
	$(LT_LDLIB_shlib_only) $(LT_objs) $(LT_deps) $(LT_libs)

libafsauthent_pic.la: $(LT_objs)
	$(LT_LDLIB_pic) $(LT_objs)

# On AIX, libtool can only produce one of shared and static libraries in a
# given invocation, so we need separate rules.
libafsauthent.a: $(LT_objs)
	$(LT_LDLIB_static) $(LT_objs)

${TOP_LIBDIR}/libafsauthent.a: libafsauthent.a
	${INSTALL_DATA} $? $@

${TOP_LIBDIR}/libafsauthent_pic.a: libafsauthent_pic.la
	${INSTALL_DATA} .libs/libafsauthent_pic.a $@

clean:
	$(LT_CLEAN)
	$(RM) -f *.o libafsauthent.a

install: $(SHARED_LIBS) libafsauthent.a libafsauthent_pic.la
	${INSTALL} -d ${DESTDIR}${libdir}
	@SHARED_ONLY@${LT_INSTALL_DATA} libafsauthent.la ${DESTDIR}${libdir}/libafsauthent.la
	@SHARED_ONLY@${RM} ${DESTDIR}${libdir}/libafsauthent.la
	${INSTALL_DATA}  libafsauthent.a ${DESTDIR}${libdir}/libafsauthent.a
	${INSTALL_DATA}  .libs/libafsauthent_pic.a ${DESTDIR}${libdir}/libafsauthent_pic.a

dest: libafsauthent.a
	${INSTALL} -d ${DEST}/lib
	${INSTALL_DATA} libafsauthent.a ${DEST}/lib/libafsauthent.a
