# 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

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


VLSERVER = ../../vlserver
VOLSER = ../../volser
FSINT = ../../fsint

ADMINOBJS =\
	afs_vosAdmin.o \
	vosutils.o \
	vsprocs.o \
	lockprocs.o

VLSERVEROBJS =\
	vldbint.cs.o \
	vldbint.xdr.o

VOLSEROBJS =\
	volint.cs.o \
	volint.xdr.o

FSINTOBJS =\
	afsint.xdr.o \
	afscbint.xdr.o

LIBOBJS = ${ADMINOBJS} ${VLSERVEROBJS} ${VOLSEROBJS} ${FSINTOBJS}

LIBVOSADMIN=${TOP_LIBDIR}/libvosadmin.a

all: ${TOP_INCDIR}/afs/afs_vosAdmin.h ${TOP_LIBDIR}/libvosadmin.a

${TOP_INCDIR}/afs/afs_vosAdmin.h: afs_vosAdmin.h
	${INSTALL_DATA} $? $@

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

install: afs_vosAdmin.h libvosadmin.a
	${INSTALL} -d ${DESTDIR}${includedir}/afs
	${INSTALL} -d ${DESTDIR}${libdir}/afs
	${INSTALL_DATA} ${srcdir}/afs_vosAdmin.h ${DESTDIR}${includedir}/afs/afs_vosAdmin.h
	${INSTALL_DATA} libvosadmin.a ${DESTDIR}${libdir}/afs/libvosadmin.a

dest: afs_vosAdmin.h libvosadmin.a
	${INSTALL} -d ${DEST}/include/afs
	${INSTALL} -d ${DEST}/lib/afs
	${INSTALL_DATA} ${srcdir}/afs_vosAdmin.h ${DEST}/include/afs/afs_vosAdmin.h
	${INSTALL_DATA} libvosadmin.a ${DEST}/lib/afs/libvosadmin.a

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

afs_vosAdmin.o: afs_vosAdmin.h

vldbint.cs.o: ${VLSERVER}/vldbint.cs.c
	$(AFS_CCRULE) $(VLSERVER)/vldbint.cs.c

vldbint.xdr.o: ${VLSERVER}/vldbint.xdr.c
	$(AFS_CCRULE) $(VLSERVER)/vldbint.xdr.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

afscbint.xdr.o: ${FSINT}/afscbint.xdr.c
	$(AFS_CCRULE) $(FSINT)/afscbint.xdr.c

afsint.xdr.o: ${FSINT}/afsint.xdr.c
	$(AFS_CCRULE) $(FSINT)/afsint.xdr.c

clean:
	$(RM) -f *.o libvosadmin*
