#  
#  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.

TOPDIR = ../../..

include $(TOPDIR)/mak/config.mak

PROG=napload
OBJS = pol.tab$(OBJ) main$(OBJ) systable$(OBJ) policy$(OBJ)

CXXFLAGS	+= -I${TOPDIR}/wr.include
CXXFLAGS	+= -I${TOPDIR}/wr.lib/libwrv
CXXFLAGS	+= -I${TOPDIR}/wss/include
CXXFLAGS	+= -I${TOPDIR}/wsi/${BUILDDIR}/include

UNIX_CXXFLAGS	+= -DIN_SANDBOX -g -Wall -O2

UNIX_LDFLAGS = -static -L${TOPDIR}/wr.lib/libwrv -L${TOPDIR}/wr.lib/libwrmod
UNIX_LDLIBS += -lwrv -lwrmod

CLEANFILES	+= lex.pol.c pol.tab.cc pol.tab.cc.output *.nap

include $(TOPDIR)/mak/prog.mak

YACC=bison
LEX=lex

pol.tab.cc: pol.y lex.pol.c
	${YACC} -v --no-lines -p pol -o pol.tab.cc pol.y

lex.pol.c: pol.l
	${LEX} -Ppol pol.l

systable.cc: gentable.awk
	awk -f gentable.awk /usr/include/sys/syscall.h >systable.cc

