# 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.pthread


AUDIT= $(srcdir)/../audit
AUTH = $(srcdir)/../auth
KAUTH =$(srcdir)/../kauth
UBIK = $(srcdir)/../ubik
UTIL = $(srcdir)/../util
RXKAD = $(srcdir)/../rxkad
PTSERVER = $(srcdir)/../ptserver
VOLSER = $(srcdir)/../volser
VLSERVER = $(srcdir)/../vlserver
SYS = $(srcdir)/../sys

AUDITOBJS = audit.o audit-file.o audit-sysvmq.o

AUTHOBJS = \
	cellconfig.o \
	ktc.o \
	keys.o \
	userok.o \
	writeconfig.o \
	authcon.o \
	ktc_errors.o \
	acfg_errors.o \
	token.o \
	token.xdr.o

KAUTHOBJS = \
	kauth.xdr.o \
	kauth.cs.o \
	kaaux.o \
	client.o \
	authclient.o \
	katoken.o \
	kautils.o \
	kalocalcell.o \
	kaerrors.o \
	user.o

UBIKOBJS = \
	uinit.o \
	ubikclient.o \
	uerrors.o \
	ubik_int.cs.o \
	ubik_int.xdr.o

UTILOBJS = \
	pthread_glock.o \
	get_krbrlm.o \
	dirpath.o \
	serverLog.o \
	fileutil.o

RXKADOBJS = \
	rxkad_errs.o

SYSOBJS = \
	rmtsysc.o \
	rmtsys.xdr.o \
	rmtsys.cs.o \
	afssyscalls.o \
	rmtsysnet.o \
	glue.o \
	setpag.o \
	pioctl.o

PTSERVEROBJS = \
	ptclient.o \
	ptint.cs.o \
	ptint.xdr.o \
	ptuser.o \
	display.o \
	pterror.o

VOLSEROBJS = \
	vsprocs.o \
	vsutils.o \
	lockprocs.o \
	volint.xdr.o \
	volint.cs.o \
	volerr.o

VLDBOBJS = \
	vldbint.xdr.o \
	vldbint.cs.o \
	vl_errors.o

LIBOBJS = \
	${AUDITOBJS} \
	${AUTHOBJS} \
	${KAUTHOBJS} \
	${UBIKOBJS} \
	${UTILOBJS} \
	${RXKADOBJS} \
	${PTSERVEROBJS} \
	${SYSOBJS} \
	${VOLSEROBJS} \
	${VLDBOBJS}

all: ${TOP_LIBDIR}/libafsauthent.a

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

libafsauthent.a: ${LIBOBJS}
	$(RM) -f $@
	$(AR) crv $@ ${LIBOBJS}
	$(RANLIB) $@

audit.o: ${AUDIT}/audit.c
	${AFS_CCRULE} ${AUDIT}/audit.c

audit-file.o: ${AUDIT}/audit-file.c
	${AFS_CCRULE} ${AUDIT}/audit-file.c

audit-sysvmq.o: ${AUDIT}/audit-sysvmq.c
	${AFS_CCRULE} ${AUDIT}/audit-sysvmq.c

cellconfig.o: ${AUTH}/cellconfig.c
	${AFS_CCRULE} -I../auth ${AUTH}/cellconfig.c

keys.o: ${AUTH}/keys.c
	${AFS_CCRULE} -I../auth ${AUTH}/keys.c

ktc.o: ${AUTH}/ktc.c
	${AFS_CCRULE} -I../auth ${AUTH}/ktc.c

token.o: ${AUTH}/token.c
	${AFS_CCRULE} -I../auth ${AUTH}/token.c

token.xdr.o: ../auth/token.xdr.c
	${AFS_CCRULE} -I../auth ../auth/token.xdr.c

userok.o: ${AUTH}/userok.c
	${AFS_CCRULE} -I../auth ${AUTH}/userok.c

writeconfig.o: ${AUTH}/writeconfig.c
	${AFS_CCRULE} -I../auth ${AUTH}/writeconfig.c

authcon.o: ${AUTH}/authcon.c
	${AFS_CCRULE} -I../auth ${AUTH}/authcon.c

ktc_errors.o: ../auth/ktc_errors.c
	${AFS_CCRULE} ../auth/ktc_errors.c

acfg_errors.o: ../auth/acfg_errors.c
	${AFS_CCRULE} ../auth/acfg_errors.c

kauth.xdr.o: ../kauth/kauth.xdr.c
	${AFS_CCRULE} ../kauth/kauth.xdr.c

kauth.cs.o: ../kauth/kauth.cs.c
	${AFS_CCRULE} ../kauth/kauth.cs.c

kaaux.o: ${KAUTH}/kaaux.c
	${AFS_CCRULE} -I../kauth ${KAUTH}/kaaux.c

client.o: ${KAUTH}/client.c
	${AFS_CCRULE} -I../kauth ${KAUTH}/client.c

authclient.o: ${KAUTH}/authclient.c
	${AFS_CCRULE} -I../kauth ${KAUTH}/authclient.c

katoken.o: ${KAUTH}/katoken.c
	${AFS_CCRULE} -I../kauth ${KAUTH}/katoken.c

kautils.o: ${KAUTH}/kautils.c
	${AFS_CCRULE} -I../kauth ${KAUTH}/kautils.c

kalocalcell.o: ${KAUTH}/kalocalcell.c
	${AFS_CCRULE} -I ../kauth ${KAUTH}/kalocalcell.c

kaerrors.o: ../kauth/kaerrors.c
	${AFS_CCRULE} ../kauth/kaerrors.c

user.o: ${KAUTH}/user.c
	${AFS_CCRULE} -I ../kauth ${KAUTH}/user.c

read_passwd.o: ${KAUTH}/read_passwd.c
	${AFS_CCRULE} ${KAUTH}/read_passwd.c

ubikclient.o: ${UBIK}/ubikclient.c
	${AFS_CCRULE} ${UBIK}/ubikclient.c

uinit.o: ${UBIK}/uinit.c
	${AFS_CCRULE} ${UBIK}/uinit.c

uerrors.o: ../ubik/uerrors.c
	${AFS_CCRULE} ../ubik/uerrors.c

ubik_int.cs.o: ../ubik/ubik_int.cs.c
	${AFS_CCRULE} ../ubik/ubik_int.cs.c

ubik_int.xdr.o: ../ubik/ubik_int.xdr.c
	${AFS_CCRULE} ../ubik/ubik_int.xdr.c


get_krbrlm.o: ${UTIL}/get_krbrlm.c
	${AFS_CCRULE} ${UTIL}/get_krbrlm.c

dirpath.o: ${UTIL}/dirpath.c
	${AFS_CCRULE} ${UTIL}/dirpath.c

serverLog.o: ${UTIL}/serverLog.c
	${AFS_CCRULE} ${UTIL}/serverLog.c

fileutil.o: ${UTIL}/fileutil.c
	${AFS_CCRULE} ${UTIL}/fileutil.c

pthread_glock.o: ${UTIL}/pthread_glock.c
	${AFS_CCRULE} ${UTIL}/pthread_glock.c

rxkad_errs.o: ../rxkad/rxkad_errs.c
	${AFS_CCRULE} ../rxkad/rxkad_errs.c

ptclient.o: ${PTSERVER}/ptclient.c
	${AFS_CCRULE} -I../ptserver ${PTSERVER}/ptclient.c

ptuser.o: ${PTSERVER}/ptuser.c
	${AFS_CCRULE} -I../ptserver ${PTSERVER}/ptuser.c

display.o: ${PTSERVER}/display.c
	${AFS_CCRULE} -I../ptserver ${PTSERVER}/display.c

ptint.cs.o: ../ptserver/ptint.cs.c
	${AFS_CCRULE} ../ptserver/ptint.cs.c

ptint.xdr.o: ../ptserver/ptint.xdr.c
	${AFS_CCRULE} ../ptserver/ptint.xdr.c

pterror.o: ../ptserver/pterror.c
	${AFS_CCRULE} ../ptserver/pterror.c

rmtsysc.o: ${SYS}/rmtsysc.c
	${AFS_CCRULE} -I../sys ${SYS}/rmtsysc.c

rmtsys.xdr.o: ../sys/rmtsys.xdr.c
	${AFS_CCRULE} ../sys/rmtsys.xdr.c

rmtsys.cs.o: ../sys/rmtsys.cs.c
	${AFS_CCRULE} ../sys/rmtsys.cs.c

afssyscalls.o: ${SYS}/afssyscalls.c
	${AFS_CCRULE} ${SYS}/afssyscalls.c

rmtsysnet.o: ${SYS}/rmtsysnet.c
	${AFS_CCRULE} -I../sys ${SYS}/rmtsysnet.c

glue.o: ${SYS}/glue.c
	${AFS_CCRULE} ${SYS}/glue.c

setpag.o: ${SYS}/setpag.c
	${AFS_CCRULE} ${SYS}/setpag.c

pioctl.o: ${SYS}/pioctl.c
	${AFS_CCRULE} ${SYS}/pioctl.c

vsprocs.o: $(VOLSER)/vsprocs.c
	$(AFS_CCRULE) -I../volser $(VOLSER)/vsprocs.c

vsutils.o: $(VOLSER)/vsutils.c
	$(AFS_CCRULE) $(VOLSER)/vsutils.c

lockprocs.o: $(VOLSER)/lockprocs.c
	$(AFS_CCRULE) $(VOLSER)/lockprocs.c

volint.xdr.o: ../volser/volint.xdr.c
	$(AFS_CCRULE) ../volser/volint.xdr.c

volint.cs.o: ../volser/volint.cs.c
	$(AFS_CCRULE) ../volser/volint.cs.c

volerr.o: $(VOLSER)/volerr.c
	$(AFS_CCRULE) $(VOLSER)/volerr.c

vldbint.xdr.o: ../vlserver/vldbint.xdr.c
	$(AFS_CCRULE) ../vlserver/vldbint.xdr.c

vldbint.cs.o: ../vlserver/vldbint.cs.c
	$(AFS_CCRULE) ../vlserver/vldbint.cs.c

vl_errors.o: $(VLSERVER)/vl_errors.c
	$(AFS_CCRULE) $(VLSERVER)/vl_errors.c

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

install: libafsauthent.a
	${INSTALL} -d ${DESTDIR}${libdir}
	${INSTALL_DATA} libafsauthent.a ${DESTDIR}${libdir}/libafsauthent.a

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