#  
#  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.9 2001/04/05 18:41:28 stevek Exp $
#

TOPDIR = ../..

include ${TOPDIR}/mak/config.mak

LIBBASE = gswtknative

LIBDEPENDS += ${TOPDIR}/wr.lib/libwrv/${LIBPRFX}wrv${PIC}${LIBEXT}
LIBDEPENDS += ${TOPDIR}/wr.lib/libcrit/${LIBPRFX}crit${PIC}${LIBEXT}
LIBDEPENDS += ${TOPDIR}/wr.lib/libre/${LIBPRFX}re${PIC}${LIBEXT}
LIBDEPENDS += ${TOPDIR}/wr.lib/libwrmod/${LIBPRFX}wrmod${PIC}${LIBEXT}

SHLIB_MAJOR = 1
SHLIB_MINOR = 0

BUILD_SHARED = yes
BUILD_STATIC = no
BUILD_PIC = no

VIEWERPATH	= ${TOPDIR}/wr.classes/com/gswtk/viewer
EVENTPATH	= ${TOPDIR}/wr.classes/com/gswtk/event
DBPATH		= ${TOPDIR}/wr.classes/com/gswtk/db
UIPATH		= ${TOPDIR}/wr.classes/com/gswtk/ui

JNIOBJ		= _jni${SHOBJ}

OBJS		= WrapperViewer_jni${OBJ}

LDADD		+= ${TOPDIR}/wr.lib/libwrv/${LIBPRFX}wrv${PIC}${LIBEXT}
LDADD		+= ${TOPDIR}/wr.lib/libcrit/${LIBPRFX}crit${PIC}${LIBEXT}
LDADD		+= ${TOPDIR}/wr.lib/libre/${LIBPRFX}re${PIC}${LIBEXT}
LDADD		+= ${TOPDIR}/wr.lib/libwrmod/${LIBPRFX}wrmod${PIC}${LIBEXT}
WINNT_LDLIBS	= ${LDADD}
FREEBSD5_LDADD	+= /usr/lib/libstdc++.a /usr/lib/libgcc_pic.a

.PHONY: install_links

INSTALL_TARGET	= install_links

include ${TOPDIR}/mak/library.mak

install_links:
	@SHORTLIB=`echo "${SHLIBRARY}" | sed 's/\.${SHLIB_MAJOR}\.${SHLIB_MINOR}$$//'`; \
	if [ ! "$${SHORTLIB}" = "${SHLIBRARY}" ]; then \
	   ${RM} ${LIBDIR}/$${SHORTLIB}; \
	   ${LN} ${SHLIBRARY} ${LIBDIR}/$${SHORTLIB}; \
	fi

# Dependencies
WrapperViewer${JNIOBJ}: ${VIEWERPATH}/WrapperViewer_jni/WrapperViewer${JNIOBJ}
	${LN} ${VIEWERPATH}/WrapperViewer_jni/WrapperViewer${JNIOBJ} \
	      WrapperViewer${JNIOBJ}

