# 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
include @TOP_OBJDIR@/src/config/Makefile.libtool

LT_objs = usd_file.lo AFS_component_version_number.lo
LT_deps = $(top_builddir)/src/opr/liboafs_opr.la

all: liboafs_usd.la ${TOP_LIBDIR}/libusd.a ${TOP_INCDIR}/afs/usd.h

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

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

#
# Build targets
#
liboafs_usd.la: liboafs_usd.la.sym $(LT_objs) $(LT_deps)
	$(LT_LDLIB_shlib) $(LT_objs) $(LT_deps) $(LT_libs)

libusd.a: $(LT_objs)
	$(LT_LDLIB_static) $(LT_objs)

usd_file.lo: usd.h

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

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

#
# Misc. targets
#
clean:
	$(LT_CLEAN)
	$(RM) -f *.o libusd.a core AFS_component_version_number.c

include ../config/Makefile.version
