xref: /illumos-gate/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/Makefile (revision 1edba515a3484e0f74b638b203d462b3112ac84d)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# Copyright (c) 2018, Joyent, Inc.
26# Copyright 2024 Oxide Computer Company
27
28PROG=		ikeadm ipsecalgs ipsecconf ipseckey ikecert
29SOCKETPROG=	ipsecalgs ipsecconf ipseckey
30TSOLPROG=	ipseckey
31SRCS=		ikeadm.c ipsecalgs.c ipsecconf.c ipseckey.c
32SBINLINKS=	tcpkey
33
34include ../../../Makefile.cmd
35
36MANIFEST=	ipsecalgs.xml policy.xml manual-key.xml tcpkey.xml
37SVCMETHOD=	net-tcpkey
38
39ROOTMANIFESTDIR=	$(ROOTSVCNETWORKIPSEC)
40$(ROOTMANIFEST)		:= FILEMODE= 444
41include ../../Makefile.cmd-inet
42
43ROOTUSRSBINLINKS = $(SBINLINKS:%=$(ROOTUSRSBIN)/%)
44$(ROOTUSRSBIN)/tcpkey := INSLINKTARGET = $(ROOTUSRSBIN)/ipseckey
45
46COMMONSRCS=	$(CMDINETCOMMONDIR)/$(COMMONOBJS:.o=.c)
47SRCS+=		$(COMMONSRCS)
48
49#
50# Message catalog
51#
52POFILES=	ikeadm.po ipsecalgs.po ipsecconf.po ipseckey.po
53POFILE=		ipsecutils.po
54
55all:=		TARGET= all
56install:=	TARGET= install
57clean:=		TARGET= clean
58clobber:=	TARGET= clobber
59
60CLOBBERFILES +=	$(PROG) $(POFILES)
61CLEANFILES += $(PROG) $(POFILES)
62
63CPPFLAGS +=	-DSYSV -DBSD_COMP -I$(CMDINETCOMMONDIR) -I.
64CERRWARN +=	-_gcc=-Wno-parentheses
65CERRWARN +=	$(CNOWARN_UNINIT)
66CERRWARN +=	-_gcc=-Wno-switch
67
68# not linted
69SMATCH=off
70
71LDLIBS += -lipsecutil -lnsl
72
73LAZYLIBS = $(ZLAZYLOAD) -ltsol $(ZNOLAZYLOAD)
74
75$(TSOLPROG)	:=	LDLIBS += $(LAZYLIBS)
76$(SOCKETPROG)	:=	LDLIBS += -lsocket
77
78.KEEP_STATE:
79
80.PARALLEL:
81
82.NO_PARALLEL:	$(CHKMANIFEST)
83
84all: $(PROG)
85
86#
87# message catalog
88#
89
90$(POFILE): $(POFILES)
91	$(RM) $@
92	cat $(POFILES) >> $@
93
94$(COMMONOBJS): $(COMMONSRCS)
95	$(COMPILE.c) $(COMMONSRCS)
96
97$(ROOTUSRSBINLINKS): $(ROOTUSRSBINPROG)
98	$(INS.link)
99
100install: $(PROG) $(ROOTFS_PROG) .WAIT $(ROOTUSRSBINPROG) \
101	 $(ROOTUSRSBINLINKS) $(ROOTETCDEFAULTFILES) $(ROOTMANIFEST) \
102	 $(ROOTSVCMETHOD) $(ROOTUSRSBINLINKS)
103
104check:	$(CHKMANIFEST)
105
106clean:
107	-$(RM) $(CLEANFILES)
108
109
110include ../../../Makefile.targ
111