# 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

DEST=@DEST@
TOP_INCDIR=@TOP_INCDIR@
TOP_LIBDIR=@TOP_LIBDIR@
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
sbindir=@sbindir@
libexecdir=@libexecdir@
libdir=@libdir@
includedir=@includedir@
mandir=@mandir@
afssrvbindir=@afssrvbindir@
afssrvsbindir=@afssrvsbindir@
afssrvlibexecdir=@afssrvlibexecdir@
COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et
RXGEN=${TOP_SRCDIR}/rxgen/rxgen
TOP_SRCDIR=@TOP_SRCDIR@
SYS_NAME=@AFS_SYSNAME@

SHELL = /bin/sh
include ../../config/Makefile.${SYS_NAME}

CFLAGS=${OPTMZ} ${DBG} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${MT_CFLAGS}
CCRULE = ${CC} ${CFLAGS} -c $?

UBIKOBJS=\
	ubik_int.cs.o \
	ubik_int.xdr.o

CFGOBJS=\
	cfgclient.o \
	cfgdb.o \
	cfghost.o \
	cfgservers.o \
	cfginternal.o

LIBOBJS =\
	${UBIKOBJS} \
	${CFGOBJS}


all: ${TOP_INCDIR}/afs/afs_cfgAdmin.h ${TOP_LIBDIR}/libcfgadmin.a

install: ${DESTDIR}${includedir}/afs/afs_cfgAdmin.h ${DESTDIR}${libdir}/afs/libcfgadmin.a

dest: ${DEST}/include/afs/afs_cfgAdmin.h ${DEST}/lib/afs/libcfgadmin.a

${TOP_INCDIR}/afs/afs_cfgAdmin.h: afs_cfgAdmin.h
	${INSTALL} $? $@

${DESTDIR}${includedir}/afs/afs_cfgAdmin.h: afs_cfgAdmin.h
	${INSTALL} $? $@

${DEST}/include/afs/afs_cfgAdmin.h: afs_cfgAdmin.h
	${INSTALL} $? $@

${TOP_LIBDIR}/libcfgadmin.a: libcfgadmin.a
	${INSTALL} $? $@

${DESTDIR}${libdir}/afs/libcfgadmin.a: libcfgadmin.a
	${INSTALL} $? $@

${DEST}/lib/afs/libcfgadmin.a: libcfgadmin.a
	${INSTALL} $? $@

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

UBIKDIR=../../ubik

ubik_int.cs.o: ${UBIKDIR}/ubik_int.cs.c
	${CCRULE}

ubik_int.xdr.o: ${UBIKDIR}/ubik_int.xdr.c
	${CCRULE}

${CFGOBJS}: afs_cfgAdmin.h

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