# 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
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@

#
# Main targets
#
all: \
	${TOP_LIBDIR}/libacl.a \
	depinstall

depinstall: \
	${TOP_INCDIR}/afs/acl.h \
	${TOP_INCDIR}/afs/prs_fs.h 

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

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

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

libacl.a: aclprocs.o netprocs.o AFS_component_version_number.o
	$(RM) -f $@
	$(AR) crv $@ aclprocs.o netprocs.o AFS_component_version_number.o
	$(RANLIB) $@

aclprocs.o: aclprocs.c acl.h

netprocs.o: netprocs.c acl.h

#
# Installation targets
#
install: libacl.a acl.h prs_fs.h
	${INSTALL} -d ${DESTDIR}${libdir}/afs
	${INSTALL} -d ${DESTDIR}${includedir}/afs
	${INSTALL_DATA} libacl.a ${DESTDIR}${libdir}/afs/libacl.a
	${INSTALL_DATA} ${srcdir}/acl.h ${DESTDIR}${includedir}/afs/acl.h
	${INSTALL_DATA} ${srcdir}/prs_fs.h ${DESTDIR}${includedir}/afs/prs_fs.h

dest: libacl.a acl.h prs_fs.h
	${INSTALL} -d ${DEST}/lib/afs
	${INSTALL} -d ${DEST}/include/afs
	${INSTALL_DATA} libacl.a ${DEST}/lib/afs/libacl.a
	${INSTALL_DATA} ${srcdir}/acl.h ${DEST}/include/afs/acl.h
	${INSTALL_DATA} ${srcdir}/prs_fs.h ${DEST}/include/afs/prs_fs.h

#
# Misc. targets
#
test:
	cd test; $(MAKE)

clean: 
	$(RM) -f acltest *.o *.a core AFS_component_version_number.c

include ../config/Makefile.version
