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

TOPDIR = ../..

include ${TOPDIR}/mak/config.mak

JAVASRCS = wrv.java MainFrame.java ModulesPanel.java ActivationPanel.java \
	   DeactivationPanel.java AboutPanel.java ProcessesPanel.java \
	   WrappersPanel.java LibrariesPanel.java DatabasePanel.java \
	   CriteriaBox.java CriteriaViewer.java

TOOLKITSPATH = ${TOPDIR}/toolkits
EVENTFSPATH = ${TOOLKITSPATH}/eventfs/src
NAILABSJTKPATH = ${TOOLKITSPATH}/nailabs-jtk

CLASSPATH = ${TOPDIR}/wr.classes${PATHSEP}${EVENTFSPATH}/classes${PATHSEP}${TOPDIR}/wr.classes/jcbwt350.jar${PATHSEP}${NAILABSJTKPATH}/src

INSTALLCLASSES = yes

.PHONY: install_scripts

INSTALL_TARGET = install_scripts

include ${TOPDIR}/mak/java.mak

install_scripts:
	@echo "Installing script for WRV in ${BINDIR}"
	@if [ ! "${BUILDPLATFORM}" = "Windows_NT" ]; then \
	   sed -e 's!^\(WRCLASSES=\).*$$!\1${CLASSDIR}!' \
	       -e 's!^\(WRVJNI=\).*$$!\1${LIBDIR}!' \
	       -e '/^EVENTFSPATH.*$$/d' -e '/^NAILABSJTKPATH.*$$/d' \
	       -e 's!^\(EVENTFSCLASSES=\).*$$!\1${CLASSDIR}!' \
	       -e 's!^\(EVENTFSJNI=\).*$$!\1${LIBDIR}!' \
	       -e 's!^\(NAILABSJTKCLASSES=\).*$$!\1${CLASSDIR}!' \
	       -e 's!:\.!:${CLASSDIR}!' -e 's!`pwd`!${LIBDIR}!' wrv | \
	   awk 'BEGIN { ignore=0; } \
	        /^#BEGIN IGNORE/ { ignore=1; next; } \
	        /^#END IGNORE/ { ignore=0; next; } \
	        { if(ignore != 1) print; }' > ${BINDIR}/wrv; \
	   chmod a+rx ${BINDIR}/wrv; \
	fi

