1e3320f40Smarkfen#
2e3320f40Smarkfen# CDDL HEADER START
3e3320f40Smarkfen#
4e3320f40Smarkfen# The contents of this file are subject to the terms of the
5e3320f40Smarkfen# Common Development and Distribution License (the "License").
6e3320f40Smarkfen# You may not use this file except in compliance with the License.
7e3320f40Smarkfen#
8e3320f40Smarkfen# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9e3320f40Smarkfen# or http://www.opensolaris.org/os/licensing.
10e3320f40Smarkfen# See the License for the specific language governing permissions
11e3320f40Smarkfen# and limitations under the License.
12e3320f40Smarkfen#
13e3320f40Smarkfen# When distributing Covered Code, include this CDDL HEADER in each
14e3320f40Smarkfen# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15e3320f40Smarkfen# If applicable, add the following below this CDDL HEADER, with the
16e3320f40Smarkfen# fields enclosed by brackets "[]" replaced with your own identifying
17e3320f40Smarkfen# information: Portions Copyright [yyyy] [name of copyright owner]
18e3320f40Smarkfen#
19e3320f40Smarkfen# CDDL HEADER END
20e3320f40Smarkfen#
21e3320f40Smarkfen#
223afe87ebSRoger A. Faulkner# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23e3320f40Smarkfen# Use is subject to license terms.
24e3320f40Smarkfen#
25*5661bb76SJohn Levon# Copyright (c) 2018, Joyent, Inc.
26e3320f40Smarkfen
27e3320f40SmarkfenPROG=		ikeadm ipsecalgs ipsecconf ipseckey ikecert
28e3320f40SmarkfenSOCKETPROG=	ipsecalgs ipsecconf ipseckey
295d3b8cb7SBill SommerfeldTSOLPROG=	ipseckey
30e3320f40SmarkfenSRCS=           ikeadm.c ipsecalgs.c ipsecconf.c ipseckey.c
31e3320f40Smarkfen
32e3320f40Smarkfeninclude ../../../Makefile.cmd
33e3320f40Smarkfen
34e3320f40SmarkfenMANIFEST=	ipsecalgs.xml policy.xml manual-key.xml
35e3320f40Smarkfen
36e3320f40SmarkfenROOTMANIFESTDIR=	$(ROOTSVCNETWORKIPSEC)
37e3320f40Smarkfen$(ROOTMANIFEST)		:= FILEMODE= 444
38e3320f40Smarkfeninclude ../../Makefile.cmd-inet
39e3320f40Smarkfen
40e3320f40SmarkfenCOMMONSRCS=	$(CMDINETCOMMONDIR)/$(COMMONOBJS:.o=.c)
41e3320f40SmarkfenSRCS+=		$(COMMONSRCS)
42e3320f40Smarkfen
43e3320f40Smarkfen#
44e3320f40Smarkfen# Message catalog
45e3320f40Smarkfen#
46e3320f40SmarkfenPOFILES=	ikeadm.po ipsecalgs.po ipsecconf.po ipseckey.po
47e3320f40SmarkfenPOFILE=		ipsecutils.po
48e3320f40Smarkfen
49e3320f40Smarkfenall:=		TARGET= all
50e3320f40Smarkfeninstall:=	TARGET= install
51e3320f40Smarkfenclean:=		TARGET= clean
52e3320f40Smarkfenclobber:=	TARGET= clobber
53e3320f40Smarkfenlint:=		TARGET= lint
54e3320f40Smarkfen
55e3320f40SmarkfenCLOBBERFILES +=	$(PROG) $(POFILES)
56e3320f40SmarkfenCLEANFILES += $(PROG) $(POFILES)
57e3320f40Smarkfen
58e3320f40SmarkfenCPPFLAGS +=     -DSYSV -DBSD_COMP -I$(CMDINETCOMMONDIR) -I.
597014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-parentheses
607014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-uninitialized
617014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-switch
62e3320f40Smarkfen
63*5661bb76SJohn Levon# not linted
64*5661bb76SJohn LevonSMATCH=off
65*5661bb76SJohn Levon
66e3320f40SmarkfenCFLAGS += $(XSTRCONST)
67e3320f40SmarkfenLDLIBS += -lipsecutil -lnsl
685d3b8cb7SBill Sommerfeld
695d3b8cb7SBill SommerfeldLAZYLIBS = $(ZLAZYLOAD) -ltsol $(ZNOLAZYLOAD)
705d3b8cb7SBill Sommerfeldlint := LAZYLIBS = -ltsol
715d3b8cb7SBill Sommerfeld
725d3b8cb7SBill Sommerfeld$(TSOLPROG)	:=	LDLIBS += $(LAZYLIBS)
73e3320f40Smarkfen$(SOCKETPROG)	:=      LDLIBS += -lsocket
74e3320f40Smarkfen
75e3320f40Smarkfen.KEEP_STATE:
76e3320f40Smarkfen
77e3320f40Smarkfen.PARALLEL:
78e3320f40Smarkfen
793afe87ebSRoger A. Faulkner.NO_PARALLEL:	$(CHKMANIFEST)
803afe87ebSRoger A. Faulkner
81e3320f40Smarkfenall: $(PROG)
82e3320f40Smarkfen
83e3320f40Smarkfen#
84e3320f40Smarkfen# message catalog
85e3320f40Smarkfen#
86e3320f40Smarkfen
87e3320f40Smarkfen$(POFILE): $(POFILES)
88e3320f40Smarkfen	$(RM) $@
89e3320f40Smarkfen	cat $(POFILES) >> $@
90e3320f40Smarkfen
91e3320f40Smarkfen$(COMMONOBJS): $(COMMONSRCS)
92e3320f40Smarkfen	$(COMPILE.c) $(COMMONSRCS)
93e3320f40Smarkfen
94e3320f40Smarkfen$(ROOTUSRSBINLINKS):
95e3320f40Smarkfen	-$(RM) $@; $(SYMLINK) ../../sbin/$(@F) $@
96e3320f40Smarkfen
97e3320f40Smarkfeninstall: $(PROG) $(ROOTFS_PROG) .WAIT $(ROOTUSRSBINPROG) \
98e3320f40Smarkfen	 $(ROOTUSRSBINLINKS) $(ROOTETCDEFAULTFILES) $(ROOTMANIFEST)
99e3320f40Smarkfen
100e3320f40Smarkfenlint:
101e3320f40Smarkfen	$(LINT.c) -erroff=E_NAME_USED_NOT_DEF2 \
102e3320f40Smarkfen	-erroff=E_NAME_MULTIPLY_DEF2 $(SRCS) $(LDLIBS)
103e3320f40Smarkfen
104e3320f40Smarkfencheck:	$(CHKMANIFEST)
105e3320f40Smarkfen
106e3320f40Smarkfenclean:
107e3320f40Smarkfen	-$(RM) $(CLEANFILES)
108e3320f40Smarkfen
109e3320f40Smarkfen
110e3320f40Smarkfeninclude ../../../Makefile.targ
111e3320f40Smarkfen
112