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

MYINCLUDES	=
MYCFLAGS	=
MYCXXFLAGS	=

BUILD_SHARED	= yes
UNIX_BUILD_PIC	= yes
WINNT_BUILD_STATIC = no

COPY_SHARED_TO_BIN = yes

SHLIB_MAJOR	= 1
SHLIB_MINOR	= 0

LIBBASE		= crit
OBJS		= criteria.tab${OBJ} processor${OBJ}
LINUX_OBJS	= mktemp${OBJ}
SOLARIS_OBJS	= mktemp${OBJ}
WINNT_OBJS	= mktemp${OBJ}
HEADERS		= libcrit.h

#CXXFLAGS	+= -DDEBUG_CRIT_PROCESSOR=1

CXXFLAGS	+= -D_CRITEXT="\"${CRITEXT}\""
CXXFLAGS	+= -I ${TOPDIR}/wr.lib/libwdl -I ${TOPDIR}/wr.lib/libwrmod
CXXFLAGS	+= -I ${TOPDIR}/wr.lib/libre

UNIX_CXXFLAGS	+= -g -Wall -O2
UNIX_CFLAGS	+= -g -Wall -O2

WINNT_LDLIBS	+= ../libwrmod/${LIBPRFX}wrmod${LIBEXT}
WINNT_LDLIBS	+= ../libre/${LIBPRFX}re${LIBEXT}

CLEANFILES	+= lex.criteria.c criteria.tab.cc criteria.tab.cc.output

include ${TOPDIR}/mak/library.mak

criteria.tab${OBJ}: criteria.tab.cc process.pl Makefile
	@${PERL} -- process.pl ${COMPILE.cc} criteria.tab.cc

criteria.tab.i: criteria.tab.cc process.pl Makefile
	${RM} $@
	@${PERL} -- process.pl ${COMPILE.cc} ${INCLUDES} ${CPPFLAGS} criteria.tab.cc > $@

criteria.tab.cc: criteria.y lex.criteria.c
	${YACC} ${YACC_FLAGS} -t -v -p criteria -o criteria.tab.cc criteria.y

lex.criteria.c: criteria.l
	${LEX} ${LEX_FLAGS} -Sflex.skl -Pcriteria criteria.l

