# 
# Copyright (C) 1999, 2000, 2001  Network Associates, Incorporated (NAI)
# All rights reserved.
#
# This file is part of the NAI Generic Software Wrappers Toolkit
# (GSWTK).  See ftp://ftp.tislabs.com/pub/wrappers/ for the latest
# distribution.
#
# The GSWTK is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# The GSWTK is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
# $Id: Makefile,v 1.14 2001/04/30 20:25:06 stevek Exp $

TOPDIR = ..

# Turn off symorder call on VFS lkm
VFS_KMOD	= true

include ${TOPDIR}/mak/config.mak

KERNEL_SOURCE	= true

JAVA_SUBDIR	= classes
SUBDIR		+= libs ${BUILDDIR}

.PHONY: libeventfskernelall libeventfskernelclean
.PHONY: libeventfskerneltest libeventfskernelposttest

WINNT_POSTTARGET	+= libeventfskernelall
WINNT_POSTTARGETCLEAN	+= libeventfskernelclean

ADLER32PATH	= ${TOPDIR}/src/libs/adler32

# DEBUG_FLAGS	+= -DEVENTFS_DIAGNOSTICS=1
UNIX_DEBUG_FLAGS	+= -g

CFLAGS		+= ${MYCFLAGS}
CFLAGS		+= -I${TOPDIR}/src -I${ADLER32PATH} -I${TOPDIR}/include
CFLAGS		+= -I${TOPDIR}/src/${BUILDDIR}
CFLAGS		+= -DEFSLINKAGE=EXPORT -DPDLINKAGE=IMPORT
CFLAGS		+= ${DEBUG_FLAGS}
UNIX_CFLAGS	+= -O2 -Wall ${UNIX_DEBUG_FLAGS}
WINNT_CFLAGS	+= /GX -DUNICODE -D_UNICODE ${WINNT_DEBUG_FLAGS}

KMOD		= eventfs
OBJS		= eventfs_common${OBJ} adler32${OBJ}
SOLARIS_OBJS    = ${BUILDDIR}/eventfs_mod${OBJ} \
		  ${BUILDDIR}/eventfs_vfsops${OBJ} \
		  ${BUILDDIR}/eventfs_subr${OBJ} \
		  ${BUILDDIR}/eventfs_vnops${OBJ}
FREEBSD_OBJS    = ${BUILDDIR}/*${OBJ}
LINUX_OBJS	= ${BUILDDIR}/eventfs_proc${OBJ}
WINNT_OBJS	= ${BUILDDIR}/${LIBPRFX}kmod_eventfs_${BUILDDIR}${LIBEXT}

SOLARIS_KMOD_CATEGORY	= fs
LINUX_KMOD_CATEGORY	= misc


include ${TOPDIR}/mak/module.mak

adler32${OBJ}: ${ADLER32PATH}/adler32${OBJ}
	${LN} ${ADLER32PATH}/adler32${OBJ} $@

libeventfskernelall:
	@(cd ${BUILDDIR}/libs/libeventfskernel; ${MAKE} all)

libeventfskernelclean:
	@(cd ${BUILDDIR}/libs/libeventfskernel; ${MAKE} clean)

libeventfskerneltest:
	@(cd ${BUILDDIR}/libs/libeventfskernel; ${MAKE} test)

libeventfskernelposttest:
	@(cd ${BUILDDIR}/libs/libeventfskernel; ${MAKE} posttest)

