# 
# 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.8 2001/04/05 18:40:30 stevek Exp $
TOPDIR = ../../..

include ${TOPDIR}/mak/config.mak

WRAPPER = ${IDW}

include ${TOPDIR}/wr.mak/wrapper.mak

#TESTPROG = lpr ping ps passwd fingerd
#TESTPROG = passwd chfn chsh xterm lpr lpq lprm fingerd ping
#TESTPROG = finger fingerd ping traceroute mailq
#TESTPROG = finger ping fingerd passwd ftpd
#TESTPROG = mail.local sendmail mailq
#TESTPROG = mountd ftpd httpd 
#TESTPROG = fingerd passwd sendmail lpr lpd lpq ping chfn mail.local ftpd
TESTPROG = ps

idw: 
	rm -rf pegan.wr
	cd ../../PEGram; pegc -g ex2.peg > ../idwrappers/peg-test/pegan.wr

idw1: 
	rm -rf pegan.wr
	cd ../../PEGram; pegc fingerd.peg > ../idwrappers/peg-test/pegan.wr

wridw:
	rm -rf ${WRAPPER}.wr
	rcp wrids:project/IDW/SpecIDS/pegram/${WRAPPER}.wr .

all: ${WRAPPER}.wmo

load: ${WRAPPER}.wmo
	wrload ${WRAPPER}.wmo

test: ${WRAPPER}.wmo
	wrload ${WRAPPER}.wmo
	for i in ${TESTPROG}; do \
           make $$i; \
	done;
	wrstat -M

testc: ${WRAPPER}.wmo
	wrload ${WRAPPER}.wmo
	-wra 'user == chung ==> ${WRAPPER}'
	wrstat -M

imapd ipop2d ipop3d imapd-4.0 imapd-4.1:
	-wra 'prog == /usr/local/libexec/imapd-4.1 ==> ${WRAPPER}'

fingerd comsat bootpd getty telnetd tftpd rlogind rexecd rbootd registerd:
	-wra 'prog == /usr/libexec/$@ ==> ${WRAPPER}'

mail.local rshd ftpd: 
	-wra 'prog == /usr/libexec/$@ ==> ${WRAPPER}'
	

at atq atrm finger chfn passwd chsh lpr lpq lprm quota rlogin rsh mailq: 
	-wra 'prog == /usr/bin/$@ ==> ${WRAPPER}'

newaliases: 
	-wra 'prog == /usr/bin/$@ ==> ${WRAPPER}'

mountd:
	-wra 'prog == /sbin/$@ ==> ${WRAPPER}'

traceroute sendmail lpd:
	-wra 'prog == /usr/sbin/$@ ==> ${WRAPPER}'

ps ping:
	-wra 'prog == /bin/$@ ==> ${WRAPPER}'

netscape:
	-wra 'prog == /usr/local/netscape-4.5/$@==> ${WRAPPER}'

xterm xload:
	-wra 'prog == /usr/X11R6/bin/$@ ==> ${WRAPPER}'

httpd:
	-wra 'prog == /usr/local/sbin/$@ ==> ${WRAPPER}'

rdistd:
	-wra 'prog == /usr/home/ko/bin/$@ ==> ${WRAPPER}'


