155505Sshin# Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
255505Sshin# All rights reserved.
355505Sshin# 
455505Sshin# Redistribution and use in source and binary forms, with or without
555505Sshin# modification, are permitted provided that the following conditions
655505Sshin# are met:
755505Sshin# 1. Redistributions of source code must retain the above copyright
855505Sshin#    notice, this list of conditions and the following disclaimer.
955505Sshin# 2. Redistributions in binary form must reproduce the above copyright
1055505Sshin#    notice, this list of conditions and the following disclaimer in the
1155505Sshin#    documentation and/or other materials provided with the distribution.
1255505Sshin# 3. Neither the name of the project nor the names of its contributors
1355505Sshin#    may be used to endorse or promote products derived from this software
1455505Sshin#    without specific prior written permission.
1555505Sshin# 
1655505Sshin# THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
1755505Sshin# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1855505Sshin# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1955505Sshin# ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
2055505Sshin# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2155505Sshin# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2255505Sshin# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2355505Sshin# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2455505Sshin# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2555505Sshin# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2655505Sshin# SUCH DAMAGE.
2780029Sobrien#
2855505Sshin# $FreeBSD$
2955505Sshin
30160747Syar.include <bsd.own.mk>
31160747Syar
3255505SshinPROG=	setkey
3380029SobrienMAN=	setkey.8
3455505SshinSRCS=	setkey.c parse.y token.l
35160747SyarWARNS?=	1
3680029Sobrien
3769453SobrienCFLAGS+= -I${.CURDIR} -I${.CURDIR}/../../lib/libipsec
3880029SobrienYFLAGS=	-d
3980029Sobrien
4058681SbdeDPADD=	${LIBL} ${LIBY}
4158681SbdeLDADD=	-ll -ly
4255505Sshin
4380029SobrienCLEANFILES=	y.tab.c y.tab.h key_test.o keytest
4480029Sobrien
45122108Sume# libpfkey
4662583Sitojun# ipsec_strerror.c is for avoiding shlib reference to non-exported function.
47171135Sgnn.PATH: ${.CURDIR}/../../lib/libipsec ${.CURDIR}/../../sys/netipsec
4862583SitojunSRCS+= pfkey.c pfkey_dump.c key_debug.c ipsec_strerror.c
49171135SgnnCFLAGS+= -I${.CURDIR}/../../lib/libipsec -I${.CURDIR}/../../sys/netipsec
5062583Sitojun
5180029SobrienSRCS+=	y.tab.h
5255505Sshiny.tab.h: parse.y
53160747SyarCFLAGS+= -DIPSEC_DEBUG -DYY_NO_UNPUT
54160747Syar.if ${MK_INET6_SUPPORT} != "no"
55160747SyarCFLAGS+= -DINET6
56160747Syar.endif
57160747SyarCFLAGS+= -I.
5858681SbdeDPADD+=	${LIBIPSEC}
5955505SshinLDADD+=	-lipsec
6055505SshinCLEANFILES+=	scriptdump y.tab.h
6155505Sshin
6296738Sume#SCRIPTS= scriptdump
6355505Sshin
64245492SeadlerLOCALPREFIX=	/usr/local
6575286Sru
6655505Sshinscriptdump: scriptdump.pl
6755505Sshin	sed -e 's#@LOCALPREFIX@#${LOCALPREFIX}#' < $> > scriptdump
6855505Sshin
6955505Sshin.include <bsd.prog.mk>
70