# 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

# Common elements for Makefiles for all system types.
#

# Each MakefileProto includes Makefile.config, so we should only need
# minor tweaks here.
MODULE_CFLAGS=${UAFS_CFLAGS} -DKERNEL -I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBG} $(XCFLAGS)

LT_objs = \
	afs_atomlist.lo \
	afs_lhash.lo \
	afs_analyze.lo \
	afs_error.lo \
	afs_axscache.lo  \
	afs_buffer.lo	\
	afs_bypasscache.lo \
	afs_callback.lo	\
	afs_cbqueue.lo    \
	afs_cell.lo \
	afs_chunk.lo		\
	afs_conn.lo \
	afs_daemons.lo	\
	afs_dcache.lo \
	afs_dir.lo		\
	afs_disconnected.lo	\
	afs_dynroot.lo \
	afs_icl.lo \
	afs_init.lo \
	afs_lock.lo	\
	afs_mariner.lo \
	afs_memcache.lo	\
	afs_fetchstore.lo	\
	afs_osidnlc.lo	\
	afs_osi_pag.lo \
	afs_segments.lo \
	afs_server.lo \
	afs_stat.lo \
	afs_syscall.lo \
	afs_tokens.lo \
	afs_user.lo \
	afs_util.lo \
	afs_vcache.lo \
	afs_warn.lo \
	afs_osi_uio.lo \
	afs_vnop_access.lo \
	afs_vnop_attrs.lo \
	afs_vnop_create.lo \
	afs_vnop_dirops.lo \
	afs_vnop_fid.lo \
	afs_vnop_flock.lo \
	afs_vnop_link.lo \
	afs_vnop_lookup.lo \
	afs_vnop_open.lo \
	afs_vnop_read.lo \
	afs_vnop_readdir.lo \
	afs_vnop_remove.lo \
	afs_vnop_rename.lo \
	afs_vnop_strategy.lo \
	afs_vnop_symlink.lo \
	afs_vnop_write.lo \
	afs_volume.lo \
	afs_call.lo \
	afs_pioctl.lo \
	osi_vfsops.lo \
	afs_usrops.lo \
	afsd.lo \
	afsd_uafs.lo \
	xdr.lo \
	xdr_afsuuid.lo \
	xdr_update.lo \
	xdr_refernce.lo \
	afs_uuid.lo \
	assert.lo \
	osi_vnodeops.lo \
	osi_vm.lo \
	osi_groups.lo \
	osi_gcpags.lo \
	osi_vcache.lo \
	afsaux.lo \
	Kvice.xdr.lo \
	xdr_array.lo \
	xdr_arrayn.lo \
	Kvice.cs.lo \
	fcrypt.lo \
	rx.lo \
	rx_rdwr.lo \
	rx_clock.lo \
	rx_event.lo \
	rx_globals.lo \
	rx_identity.lo \
	rx_kmutex.lo \
	rx_knet.lo \
	rx_kcommon.lo \
	rx_misc.lo \
	rx_multi.lo \
	rx_null.lo \
	rx_opaque.lo \
	rx_getaddr.lo \
	rx_stats.lo \
	rx_packet.lo \
	rx_conncache.lo \
	rx_call.lo \
	rx_conn.lo \
	rx_peer.lo \
	xdr_rx.lo \
	Kvldbint.cs.lo \
	Kvldbint.xdr.lo \
	Kcallback.ss.lo \
	crypt_conn.lo \
	AFS_component_version_number.lo \
	afs_exporter.lo \
	rxkad_client.lo \
	rxkad_common.lo \
	casestrcpy.lo \
	dirpath.lo \
	fileutil.lo \
	netrestrict.lo \
	cellconfig.lo \
	keys.lo \
	realms.lo \
	ktc.lo \
	Krxstat.ss.lo \
	Krxstat.xdr.lo \
	rxstat.lo \
	xdr_int32.lo \
	xdr_int64.lo \
	token.xdr.lo \
	token.lo \
	xdr_mem.lo \
	xdr_len.lo

INCLUDE=  -I. -I${ISYSROOT}/usr/include -I${TOP_OBJDIR}/src/config
PERLUAFS = PERLUAFS
AFS	=../afs
RX	=../rx
AFSINT=../afsint
LIB	=../lib
SWIG_PERL_CFLAGS = -fPIC `perl -MExtUtils::Embed -e ccopts`
SWIG_PERL_LDFLAGS = -fPIC `perl -MExtUtils::Embed -e ldopts`
SWIG = @SWIG@
LIBUAFS_BUILD_PERL = @LIBUAFS_BUILD_PERL@

TOP_OBJ_AUTH = ${TOP_OBJDIR}/src/auth
TOP_OBJ_FSINT = ${TOP_OBJDIR}/src/fsint
TOP_OBJ_RXSTAT = ${TOP_OBJDIR}/src/rxstat
TOP_OBJ_VLSERVER = ${TOP_OBJDIR}/src/vlserver

TOP_SRC_AFS = ${TOP_SRCDIR}/afs
TOP_SRC_AUTH = ${TOP_SRCDIR}/auth
TOP_SRC_RXSTAT = ${TOP_SRCDIR}/rxstat
TOP_SRC_FSINT = ${TOP_SRCDIR}/fsint
TOP_SRC_RX = ${TOP_SRCDIR}/rx
TOP_SRC_VNOPS = ${TOP_SRCDIR}/afs/VNOPS
TOP_SRC_RXKAD = ${TOP_SRCDIR}/rxkad

MODULE_INCLUDE = -I. -I.. -I../nfs \
        -I${TOP_SRCDIR} \
        -I${TOP_SRCDIR}/afs \
        -I${TOP_SRCDIR}/afs/UKERNEL \
        -I${TOP_SRCDIR}/config \
        -I${TOP_SRCDIR}/rx \
        -I${TOP_SRCDIR}/rx/UKERNEL \
        -I${TOP_SRCDIR}/rxkad \
        -I${TOP_SRCDIR}/util \
        -I${TOP_OBJDIR}/src \
	-I${TOP_OBJDIR}/src/afs \
        -I${TOP_OBJDIR}/src/afs/UKERNEL \
        -I${TOP_OBJDIR}/src/rxkad \
        -I${TOP_OBJDIR}/src/config \
        -I${TOP_OBJDIR}/src/fsint \
        -I${TOP_OBJDIR}/src/vlserver \
	-I${TOP_OBJDIR}/src/libuafs \
	-I${TOP_OBJDIR}/src/auth \
	-I${TOP_INCDIR}/afs \
	-I${TOP_INCDIR} \
        @INCLUDE_libintl@

# Build rules - CC and CFLAGS are defined in system specific MakefileProtos.

all: ${TOP_LIBDIR}/libuafs.a \
	${TOP_LIBDIR}/libuafs_pic.a linktest @LIBUAFS_BUILD_PERL@

${TOP_LIBDIR}/libuafs.a: libuafs.a
	${INSTALL_DATA} libuafs.a $@

${TOP_LIBDIR}/libuafs_pic.a: libuafs_pic.la
	${INSTALL_DATA} .libs/libuafs_pic.a $@

$(LT_objs): h

libuafs.la: $(LT_objs)
	$(LT_LDLIB_shlib) $(LT_objs)

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

libuafs_pic.la: libuafs.a $(LT_objs)
	$(LT_LDLIB_pic) $(LT_objs)

setup_perllib:
	${INSTALL} -d ${TOP_LIBDIR}/perl
	${INSTALL} -d ${TOP_LIBDIR}/perl/AFS

${TOP_LIBDIR}/perl/ukernel.so: setup_perllib PERLUAFS/ukernel.so
	${INSTALL_DATA} PERLUAFS/ukernel.so $@

${TOP_LIBDIR}/perl/AFS/ukernel.pm: setup_perllib PERLUAFS/ukernel.pm
	${INSTALL_DATA} PERLUAFS/ukernel.pm $@

LIBUAFS_BUILD_PERL: ${TOP_LIBDIR}/perl/ukernel.so ${TOP_LIBDIR}/perl/AFS/ukernel.pm

linktest: libuafs.a
	$(CC) $(COMMON_CFLAGS) $(TEST_CFLAGS) $(TEST_LDFLAGS) \
		$(LDFLAGS_roken) $(LDFLAGS_hcrypto) -o linktest \
		${srcdir}/linktest.c $(MODULE_INCLUDE) -DUKERNEL \
		libuafs.a ${TOP_LIBDIR}/libcmd.a \
		${TOP_LIBDIR}/libafsutil.a $(TOP_LIBDIR)/libopr.a \
		$(LIB_hcrypto) $(LIB_roken) $(LIB_crypt) $(TEST_LIBS) $(XLIBS)

# Compilation rules

# These files are for the user space library
afs_atomlist.lo: $(TOP_SRCDIR)/util/afs_atomlist.c
	$(LT_CCRULE) $(TOP_SRCDIR)/util/afs_atomlist.c
afs_lhash.lo: $(TOP_SRCDIR)/util/afs_lhash.c
	$(LT_CCRULE) $(TOP_SRCDIR)/util/afs_lhash.c
afs_analyze.lo: $(TOP_SRC_AFS)/afs_analyze.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_analyze.c
afs_axscache.lo: $(TOP_SRC_AFS)/afs_axscache.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_axscache.c
afs_buffer.lo: $(TOP_SRC_AFS)/afs_buffer.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_buffer.c
afs_bypasscache.lo: $(TOP_SRC_AFS)/afs_bypasscache.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_bypasscache.c
afs_cell.lo: $(TOP_SRC_AFS)/afs_cell.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_cell.c
afs_conn.lo: $(TOP_SRC_AFS)/afs_conn.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_conn.c
afs_dcache.lo: $(TOP_SRC_AFS)/afs_dcache.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_dcache.c
afs_dynroot.lo: $(TOP_SRC_AFS)/afs_dynroot.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_dynroot.c
afs_disconnected.lo: $(TOP_SRC_AFS)/afs_disconnected.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_disconnected.c
afs_error.lo: $(TOP_SRC_AFS)/afs_error.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_error.c
afs_init.lo: $(TOP_SRC_AFS)/afs_init.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_init.c
afs_mariner.lo: $(TOP_SRC_AFS)/afs_mariner.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_mariner.c
afs_osidnlc.lo: $(TOP_SRC_AFS)/afs_osidnlc.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_osidnlc.c
afs_osi.lo: $(TOP_SRC_AFS)/afs_osi.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_osi.c
afs_osi_pag.lo: $(TOP_SRC_AFS)/afs_osi_pag.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_osi_pag.c
afs_segments.lo: $(TOP_SRC_AFS)/afs_segments.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_segments.c
afs_server.lo: $(TOP_SRC_AFS)/afs_server.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_server.c
afs_tokens.lo: $(TOP_SRC_AFS)/afs_tokens.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_tokens.c
afs_user.lo: $(TOP_SRC_AFS)/afs_user.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_user.c
afs_util.lo: $(TOP_SRC_AFS)/afs_util.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_util.c
afs_vcache.lo: $(TOP_SRC_AFS)/afs_vcache.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_vcache.c
afs_warn.lo: $(TOP_SRC_AFS)/afs_warn.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_warn.c
afs_osi_uio.lo: $(TOP_SRC_AFS)/afs_osi_uio.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_osi_uio.c
afs_vnop_access.lo: $(TOP_SRC_VNOPS)/afs_vnop_access.c
	$(LT_CCRULE) $(TOP_SRC_VNOPS)/afs_vnop_access.c
afs_vnop_attrs.lo: $(TOP_SRC_VNOPS)/afs_vnop_attrs.c
	$(LT_CCRULE) $(TOP_SRC_VNOPS)/afs_vnop_attrs.c
afs_vnop_create.lo: $(TOP_SRC_VNOPS)/afs_vnop_create.c
	$(LT_CCRULE) $(TOP_SRC_VNOPS)/afs_vnop_create.c
afs_vnop_dirops.lo: $(TOP_SRC_VNOPS)/afs_vnop_dirops.c
	$(LT_CCRULE) $(TOP_SRC_VNOPS)/afs_vnop_dirops.c
afs_vnop_fid.lo: $(TOP_SRC_VNOPS)/afs_vnop_fid.c
	$(LT_CCRULE) $(TOP_SRC_VNOPS)/afs_vnop_fid.c
afs_vnop_flock.lo: $(TOP_SRC_VNOPS)/afs_vnop_flock.c
	$(LT_CCRULE) $(TOP_SRC_VNOPS)/afs_vnop_flock.c
afs_vnop_link.lo: $(TOP_SRC_VNOPS)/afs_vnop_link.c
	$(LT_CCRULE) $(TOP_SRC_VNOPS)/afs_vnop_link.c
afs_vnop_lookup.lo: $(TOP_SRC_VNOPS)/afs_vnop_lookup.c
	$(LT_CCRULE) $(TOP_SRC_VNOPS)/afs_vnop_lookup.c
afs_vnop_open.lo: $(TOP_SRC_VNOPS)/afs_vnop_open.c
	$(LT_CCRULE) $(TOP_SRC_VNOPS)/afs_vnop_open.c
afs_vnop_read.lo: $(TOP_SRC_VNOPS)/afs_vnop_read.c
	$(LT_CCRULE) $(TOP_SRC_VNOPS)/afs_vnop_read.c
afs_vnop_readdir.lo: $(TOP_SRC_VNOPS)/afs_vnop_readdir.c
	$(LT_CCRULE) $(TOP_SRC_VNOPS)/afs_vnop_readdir.c
afs_vnop_remove.lo: $(TOP_SRC_VNOPS)/afs_vnop_remove.c
	$(LT_CCRULE) $(TOP_SRC_VNOPS)/afs_vnop_remove.c
afs_vnop_rename.lo: $(TOP_SRC_VNOPS)/afs_vnop_rename.c
	$(LT_CCRULE) $(TOP_SRC_VNOPS)/afs_vnop_rename.c
afs_vnop_strategy.lo: $(TOP_SRC_VNOPS)/afs_vnop_strategy.c
	$(LT_CCRULE) $(TOP_SRC_VNOPS)/afs_vnop_strategy.c
afs_vnop_symlink.lo: $(TOP_SRC_VNOPS)/afs_vnop_symlink.c
	$(LT_CCRULE) $(TOP_SRC_VNOPS)/afs_vnop_symlink.c
afs_vnop_write.lo: $(TOP_SRC_VNOPS)/afs_vnop_write.c
	$(LT_CCRULE) $(TOP_SRC_VNOPS)/afs_vnop_write.c
afs_volume.lo: $(TOP_SRC_AFS)/afs_volume.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_volume.c
rx_rdwr.lo: $(TOP_SRC_RX)/rx_rdwr.c
	$(LT_CCRULE) $(TOP_SRC_RX)/rx_rdwr.c
afs_cbqueue.lo: $(TOP_SRC_AFS)/afs_cbqueue.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_cbqueue.c
afs_callback.lo: $(TOP_SRC_AFS)/afs_callback.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_callback.c
afs_chunk.lo: $(TOP_SRC_AFS)/afs_chunk.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_chunk.c
afs_daemons.lo: $(TOP_SRC_AFS)/afs_daemons.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_daemons.c
afs_dir.lo: 	$(TOP_SRCDIR)/dir/dir.c
	$(LT_CCRULE) $(TOP_SRCDIR)/dir/dir.c
AFS_component_version_number.lo: AFS_component_version_number.c
	$(LT_CCRULE) AFS_component_version_number.c
afs_lock.lo: $(TOP_SRC_AFS)/afs_lock.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_lock.c
afs_memcache.lo: $(TOP_SRC_AFS)/afs_memcache.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_memcache.c
afs_fetchstore.lo: $(TOP_SRC_AFS)/afs_fetchstore.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_fetchstore.c
afs_stat.lo: $(TOP_SRC_AFS)/afs_stat.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_stat.c
fcrypt.lo: 	$(TOP_SRC_RXKAD)/fcrypt.c
	$(LT_CCRULE) $(TOP_SRC_RXKAD)/fcrypt.c
crypt_conn.lo: $(TOP_SRC_RXKAD)/crypt_conn.c
	$(LT_CCRULE) $(TOP_SRC_RXKAD)/crypt_conn.c
rxkad_client.lo: $(TOP_SRC_RXKAD)/rxkad_client.c
	$(LT_CCRULE) $(TOP_SRC_RXKAD)/rxkad_client.c
rxkad_common.lo: $(TOP_SRC_RXKAD)/rxkad_common.c
	$(LT_CCRULE) $(TOP_SRC_RXKAD)/rxkad_common.c
afs_exporter.lo: $(TOP_SRCDIR)/afs/afs_exporter.c
	$(LT_CCRULE) $(TOP_SRCDIR)/afs/afs_exporter.c
afs_nfsclnt.lo: $(TOP_SRC_AFS)/afs_nfsclnt.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_nfsclnt.c
rx.lo: $(TOP_SRC_RX)/rx.c
	$(LT_CCRULE) $(TOP_SRC_RX)/rx.c
rx_clock.lo: $(TOP_SRC_RX)/rx_clock.c
	$(LT_CCRULE) $(TOP_SRC_RX)/rx_clock.c
rx_event.lo: $(TOP_SRC_RX)/rx_event.c
	$(LT_CCRULE) $(TOP_SRC_RX)/rx_event.c
rx_globals.lo: $(TOP_SRC_RX)/rx_globals.c
	$(LT_CCRULE) $(TOP_SRC_RX)/rx_globals.c
rx_identity.lo: $(TOP_SRC_RX)/rx_identity.c
	$(LT_CCRULE) $(TOP_SRC_RX)/rx_identity.c
rx_misc.lo: $(TOP_SRC_RX)/rx_misc.c
	$(LT_CCRULE) $(TOP_SRC_RX)/rx_misc.c
rx_multi.lo: $(TOP_SRC_RX)/rx_multi.c
	$(LT_CCRULE) $(TOP_SRC_RX)/rx_multi.c
rx_null.lo: $(TOP_SRC_RX)/rx_null.c
	$(LT_CCRULE) $(TOP_SRC_RX)/rx_null.c
rx_opaque.lo: $(TOP_SRC_RX)/rx_opaque.c
	$(LT_CCRULE) $(TOP_SRC_RX)/rx_opaque.c
rx_getaddr.lo: $(TOP_SRC_RX)/rx_getaddr.c
	$(LT_CCRULE) $(TOP_SRC_RX)/rx_getaddr.c
rx_stats.lo: $(TOP_SRC_RX)/rx_stats.c
	$(LT_CCRULE) $(TOP_SRC_RX)/rx_stats.c
rx_packet.lo: $(TOP_SRC_RX)/rx_packet.c
	$(LT_CCRULE) $(TOP_SRC_RX)/rx_packet.c
rx_conncache.lo: $(TOP_SRCDIR)/rx/rx_conncache.c
	$(LT_CCRULE) $(TOP_SRCDIR)/rx/rx_conncache.c
rx_call.lo: $(TOP_SRCDIR)/rx/rx_call.c
	$(LT_CCRULE) $(TOP_SRCDIR)/rx/rx_call.c
rx_conn.lo: $(TOP_SRCDIR)/rx/rx_conn.c
	$(LT_CCRULE) $(TOP_SRCDIR)/rx/rx_conn.c
rx_peer.lo: $(TOP_SRCDIR)/rx/rx_peer.c
	$(LT_CCRULE) $(TOP_SRCDIR)/rx/rx_peer.c
xdr_rx.lo: $(TOP_SRC_RX)/xdr_rx.c
	$(LT_CCRULE) $(TOP_SRC_RX)/xdr_rx.c
xdr_int32.lo: $(TOP_SRC_RX)/xdr_int32.c
	$(LT_CCRULE) $(TOP_SRC_RX)/xdr_int32.c
xdr_int64.lo: $(TOP_SRC_RX)/xdr_int64.c
	$(LT_CCRULE) $(TOP_SRC_RX)/xdr_int64.c
afs_usrops.lo: $(TOP_SRC_AFS)/UKERNEL/afs_usrops.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/UKERNEL/afs_usrops.c
afsd.lo: $(TOP_SRCDIR)/afsd/afsd.c
	$(LT_CCRULE) $(TOP_SRCDIR)/afsd/afsd.c @CFLAGS_NOERROR@
afsd_uafs.lo: $(TOP_SRC_AFS)/UKERNEL/afsd_uafs.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/UKERNEL/afsd_uafs.c
afs_uuid.lo: $(TOP_SRCDIR)/util/uuid.c
	$(LT_CCRULE) $(TOP_SRCDIR)/util/uuid.c
assert.lo: $(TOP_SRCDIR)/opr/assert.c
	$(LT_CCRULE) $(TOP_SRCDIR)/opr/assert.c
xdr_afsuuid.lo: $(TOP_SRCDIR)/rx/xdr_afsuuid.c
	$(LT_CCRULE) $(TOP_SRCDIR)/rx/xdr_afsuuid.c
xdr_update.lo: $(TOP_SRCDIR)/rx/xdr_update.c
	$(LT_CCRULE) $(TOP_SRCDIR)/rx/xdr_update.c
xdr_refernce.lo: $(TOP_SRCDIR)/rx/xdr_refernce.c
	$(LT_CCRULE) $(TOP_SRCDIR)/rx/xdr_refernce.c
xdr.lo: $(TOP_SRCDIR)/rx/xdr.c
	$(LT_CCRULE) $(TOP_SRCDIR)/rx/xdr.c
osi_vnodeops.lo: $(TOP_SRC_AFS)/UKERNEL/osi_vnodeops.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/UKERNEL/osi_vnodeops.c
osi_vm.lo: $(TOP_SRC_AFS)/UKERNEL/osi_vm.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/UKERNEL/osi_vm.c
osi_groups.lo: $(TOP_SRC_AFS)/UKERNEL/osi_groups.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/UKERNEL/osi_groups.c
osi_gcpags.lo: $(TOP_SRC_AFS)/UKERNEL/osi_gcpags.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/UKERNEL/osi_gcpags.c
osi_vcache.lo: $(TOP_SRC_AFS)/UKERNEL/osi_vcache.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/UKERNEL/osi_vcache.c
Kcallback.ss.lo: $(TOP_OBJ_FSINT)/Kcallback.ss.c
	$(LT_CCRULE) $(TOP_OBJ_FSINT)/Kcallback.ss.c
Kvice.xdr.lo: $(TOP_OBJ_FSINT)/Kvice.xdr.c
	$(LT_CCRULE) $(TOP_OBJ_FSINT)/Kvice.xdr.c
Kvice.cs.lo: $(TOP_OBJ_FSINT)/Kvice.cs.c
	$(LT_CCRULE) $(TOP_OBJ_FSINT)/Kvice.cs.c
afsaux.lo: $(TOP_SRC_FSINT)/afsaux.c
	$(LT_CCRULE) $(TOP_SRC_FSINT)/afsaux.c
xdr_arrayn.lo: $(TOP_SRC_RX)/xdr_arrayn.c
	$(LT_CCRULE) $(TOP_SRC_RX)/xdr_arrayn.c
xdr_array.lo: $(TOP_SRC_RX)/xdr_array.c
	$(LT_CCRULE) $(TOP_SRC_RX)/xdr_array.c
Kvldbint.cs.lo: $(TOP_OBJ_VLSERVER)/Kvldbint.cs.c
	$(LT_CCRULE) $(TOP_OBJ_VLSERVER)/Kvldbint.cs.c
Kvldbint.xdr.lo: $(TOP_OBJ_VLSERVER)/Kvldbint.xdr.c
	$(LT_CCRULE) $(TOP_OBJ_VLSERVER)/Kvldbint.xdr.c
rx_kmutex.lo: $(TOP_SRC_RX)/UKERNEL/rx_kmutex.c
	$(LT_CCRULE) $(TOP_SRC_RX)/UKERNEL/rx_kmutex.c
rx_knet.lo: $(TOP_SRC_RX)/UKERNEL/rx_knet.c
	$(LT_CCRULE) $(TOP_SRC_RX)/UKERNEL/rx_knet.c
rx_kcommon.lo: $(TOP_SRCDIR)/rx/rx_kcommon.c
	$(LT_CCRULE) $(TOP_SRCDIR)/rx/rx_kcommon.c
afs_call.lo: $(TOP_SRC_AFS)/afs_call.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_call.c -DAFS_NONFSTRANS
afs_icl.lo: $(TOP_SRC_AFS)/afs_icl.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_icl.c -DAFS_NONFSTRANS
afs_pioctl.lo: $(TOP_SRC_AFS)/afs_pioctl.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_pioctl.c -DAFS_NONFSTRANS
afs_syscall.lo: $(TOP_SRC_AFS)/afs_syscall.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/afs_syscall.c @CFLAGS_NOERROR@ -DAFS_NONFSTRANS
osi_vfsops.lo: $(TOP_SRC_AFS)/UKERNEL/osi_vfsops.c
	$(LT_CCRULE) $(TOP_SRC_AFS)/UKERNEL/osi_vfsops.c -DAFS_NONFSTRANS
ktc.lo: 	$(TOP_SRCDIR)/auth/ktc.c
	$(LT_CCRULE) $(TOP_SRCDIR)/auth/ktc.c
cellconfig.lo: $(TOP_SRCDIR)/auth/cellconfig.c
	$(LT_CCRULE) $(TOP_SRCDIR)/auth/cellconfig.c
keys.lo: $(TOP_SRCDIR)/auth/keys.c
	$(LT_CCRULE) $(TOP_SRCDIR)/auth/keys.c
casestrcpy.lo: $(TOP_SRCDIR)/opr/casestrcpy.c
	$(LT_CCRULE) $(TOP_SRCDIR)/opr/casestrcpy.c
realms.lo: $(TOP_SRCDIR)/auth/realms.c
	$(LT_CCRULE) $(TOP_SRCDIR)/auth/realms.c
dirpath.lo: $(TOP_SRCDIR)/util/dirpath.c
	$(LT_CCRULE) $(TOP_SRCDIR)/util/dirpath.c
fileutil.lo: $(TOP_SRCDIR)/util/fileutil.c
	$(LT_CCRULE) $(TOP_SRCDIR)/util/fileutil.c
netrestrict.lo: $(TOP_SRCDIR)/auth/netrestrict.c
	$(LT_CCRULE) $(TOP_SRCDIR)/auth/netrestrict.c
rxstat.lo: $(TOP_SRC_RXSTAT)/rxstat.c
	$(LT_CCRULE) $(TOP_SRC_RXSTAT)/rxstat.c
Krxstat.ss.lo: $(TOP_OBJ_RXSTAT)/Krxstat.ss.c
	$(LT_CCRULE) $(TOP_OBJ_RXSTAT)/Krxstat.ss.c
Krxstat.xdr.lo: $(TOP_OBJ_RXSTAT)/Krxstat.xdr.c
	$(LT_CCRULE) $(TOP_OBJ_RXSTAT)/Krxstat.xdr.c
token.xdr.lo: $(TOP_OBJ_AUTH)/token.xdr.c
	$(LT_CCRULE) $(TOP_OBJ_AUTH)/token.xdr.c
token.lo: $(TOP_SRCDIR)/auth/token.c
	$(LT_CCRULE) $(TOP_SRCDIR)/auth/token.c
xdr_mem.lo: $(TOP_SRC_RX)/xdr_mem.c
	$(LT_CCRULE) $(TOP_SRC_RX)/xdr_mem.c
xdr_len.lo: $(TOP_SRC_RX)/xdr_len.c
	$(LT_CCRULE) $(TOP_SRC_RX)/xdr_len.c

$(PERLUAFS)/ukernel.pm: $(PERLUAFS)/ukernel_swig_perl.c
$(PERLUAFS)/ukernel_swig_perl.c: ${srcdir}/ukernel_swig.i
	mkdir -p $(PERLUAFS)
	$(SWIG) -perl5 -o $@ ${srcdir}/ukernel_swig.i

$(PERLUAFS)/ukernel_swig_perl.o: $(PERLUAFS)/ukernel_swig_perl.c
	${CC} -c ${CPPFLAGS} ${UAFS_CFLAGS} $(SWIG_PERL_CFLAGS) \
		$(MODULE_INCLUDE) -DUKERNEL $(SHLIB_CFLAGS) -o $@ \
		$(PERLUAFS)/ukernel_swig_perl.c

$(PERLUAFS)/ukernel.so: $(PERLUAFS)/ukernel_swig_perl.o libuafs_pic.la
	${TOP_OBJDIR}/src/config/shlib-build -d $(srcdir) -p -f $@ -- \
		$(SWIG_PERL_LDFLAGS) $(LDFLAGS) \
		$(PERLUAFS)/ukernel_swig_perl.o \
		.libs/libuafs_pic.a ${TOP_LIBDIR}/libcmd_pic.a \
		${TOP_LIBDIR}/libafsutil_pic.a \
		$(TOP_LIBDIR)/libopr_pic.a \
		$(LDFLAGS_roken) $(LDFLAGS_hcrypto) $(LIB_hcrypto) \
		$(LIB_roken) $(LIB_crypt) \
		$(XLIBS)

clean:
	$(LT_CLEAN)
	-$(RM) -rf PERLUAFS afs afsint config rx
	-$(RM) -rf h
	-$(RM) -f linktest $(AFS_OS_CLEAN)
	-$(RM) -f *.o *.a

install: libuafs.a libuafs_pic.la @LIBUAFS_BUILD_PERL@
	${INSTALL} -d ${DESTDIR}${libdir}
	${INSTALL_DATA} libuafs.a ${DESTDIR}${libdir}/libuafs.a
	${INSTALL_DATA} .libs/libuafs_pic.a ${DESTDIR}${libdir}/libuafs_pic.a
	if [ "x$(LIBUAFS_BUILD_PERL)" != "x" ] ; then \
		${INSTALL} -d ${DESTDIR}${libdir}/perl; \
		${INSTALL} -d ${DESTDIR}${libdir}/perl/AFS; \
		${INSTALL_DATA} PERLUAFS/ukernel.so ${DESTDIR}${libdir}/perl/ukernel.so; \
		${INSTALL_DATA} PERLUAFS/ukernel.pm ${DESTDIR}${libdir}/perl/AFS/ukernel.pm; \
	fi;

dest: $(TOP_INCDIR)/afs/param.h $(TOP_INCDIR)/afs/stds.h \
		$(TOP_INCDIR)/afs/afs_sysnames.h \
		$(TOP_INCDIR)/afs/afs_stats.h \
		$(TOP_SRCDIR)/afs/sysincludes.h \
		$(TOP_SRCDIR)/afs/UKERNEL/afs_usrops.h \
		libuafs.a libuafs_pic.la \
		@LIBUAFS_BUILD_PERL@
	${INSTALL} -d ${DEST}/root.perf/include/afs
	${INSTALL} -d ${DEST}/root.perf/lib
	${INSTALL_DATA} $(TOP_INCDIR)/afs/param.h \
		${DEST}/root.perf/include/afs/param.h
	${INSTALL_DATA} $(TOP_INCDIR)/afs/stds.h \
		${DEST}/root.perf/include/afs/stds.h
	${INSTALL_DATA} $(TOP_INCDIR)/afs/afs_sysnames.h \
		${DEST}/root.perf/include/afs/afs_sysnames.h
	${INSTALL_DATA} $(TOP_INCDIR)/afs/afs_stats.h \
		${DEST}/root.perf/include/afs/afs_stats.h
	${INSTALL_DATA} $(TOP_SRCDIR)/afs/UKERNEL/sysincludes.h \
		${DEST}/root.perf/include/afs/sysincludes.h
	${INSTALL_DATA} $(TOP_SRCDIR)/afs/UKERNEL/afs_usrops.h \
		${DEST}/root.perf/include/afs/afs_usrops.h
	${INSTALL_DATA} libuafs.a ${DEST}/root.perf/lib/libuafs.a
	${INSTALL_DATA} .libs/libuafs_pic.a ${DEST}/root.perf/lib/libuafs_pic.a
	if [ "x$(LIBUAFS_BUILD_PERL)" != "x" ] ; then \
		${INSTALL} -d ${DEST}/root.perf/lib/perl; \
		${INSTALL} -d ${DEST}/root.perf/lib/perl/AFS; \
		${INSTALL_DATA} PERLUAFS/ukernel.so ${DEST}/root.perf/lib/perl/ukernel.so; \
		${INSTALL_DATA} PERLUAFS/ukernel.pm ${DEST}/root.perf/lib/perl/AFS/ukernel.pm; \
	fi;

#
# Common directory and other build targets
#

h: $(TOP_SRC_AFS)/*.c $(TOP_SRC_VNOPS)/*.c $(TOP_SRC_RX)/*.c
	-$(RM) -rf h
	@TOP_SRCDIR@/libuafs/make_h_tree $(TOP_SRC_AFS) $(TOP_SRC_VNOPS) \
		$(TOP_SRC_RX)

include ${TOP_OBJDIR}/src/config/Makefile.version
