# 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

RPCINCLS=${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/rx/rx.h

INCLS=fsprobe.h ${RPCINCLS}

LIBS=${TOP_LIBDIR}/libvolser.a ${TOP_LIBDIR}/vlib.a ${TOP_LIBDIR}/libacl.a \
        ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libvldb.a \
        ${TOP_LIBDIR}/libubik.a \
        ${TOP_LIBDIR}/libauth.a ${TOP_LIBDIR}/libsys.a \
        ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/librxkad.a ${TOP_LIBDIR}/libdes.a \
        ${TOP_LIBDIR}/libcom_err.a ${TOP_LIBDIR}/libkauth.a \
	${TOP_LIBDIR}/libaudit.a \
	${TOP_LIBDIR}/libafsint.a \
	${TOP_LIBDIR}/librx.a \
	${TOP_LIBDIR}/liblwp.a \
	${TOP_LIBDIR}/libsys.a \
	${TOP_LIBDIR}/util.a

all: ${TOP_INCDIR}/afs/fsprobe.h ${TOP_LIBDIR}/libfsprobe.a fsprobe_test

#
# Build targets
#
libfsprobe.a: fsprobe.o fsprobe_callback.o AFS_component_version_number.o
	-$(RM) -f $@
	$(AR) crv $@ fsprobe.o fsprobe_callback.o AFS_component_version_number.o
	$(RANLIB) $@

fsprobe.o: fsprobe.c ${INCLS} AFS_component_version_number.c

fsprobe_callback.o: fsprobe_callback.c ${INCLS}

fsprobe_test: fsprobe_test.o libfsprobe.a ${LIBS}
	${CC} ${CFLAGS} -o fsprobe_test fsprobe_test.o libfsprobe.a \
		${LIBS} ${XLIBS}

#
# Install targets
#
install: ${DESTDIR}${includedir}/afs/fsprobe.h ${DESTDIR}${libdir}/afs/libfsprobe.a 

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

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

#
# Misc others
#
clean:
	$(RM) -f *.o fsprobe_test libfsprobe.a core AFS_component_version_number.c

include ../config/Makefile.version

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

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

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

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

dest: ${DEST}/include/afs/fsprobe.h ${DEST}/lib/afs/libfsprobe.a 

