xref: /illumos-gate/usr/src/cmd/keyserv/Makefile (revision 1261b05561db859f9c9c1418718a0a9a2930e0cb)
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
27SBINPROG = keyserv newkey
28BINPROG	= keylogout keylogin domainname chkey
29
30MANIFEST= keyserv.xml
31
32PROG= $(SBINPROG) $(BINPROG)
33
34HDRS= key_prot.h
35
36DEFAULTFILES = keyserv.dfl
37
38KEYSERVOBJS = keyserv.o
39KEYLOGOUTOBJS = keylogout.o
40KEYLOGINOBJS = keylogin.o
41CHKEYOBJS = chkey.o
42NEWKEYOBJS = newkey.o
43UPDATEOBJS = update.o
44
45DOMAINNAMEOBJS = domainname.o
46K_OBJS = setkey.o detach.o key_generic.o keyserv_cache.o
47CHANGE_OBJS  = update.o chkey_common.o
48OUTSIDE_UTIL_OBJS = selfcheck.o
49
50OBJS	= $(KEYSERVOBJS) $(KEYLOGOUTOBJS) $(KEYLOGINOBJS) $(CHKEYOBJS) \
51	$(NEWKEYOBJS) $(UPDATEOBJS) $(DOMAINNAMEOBJS) \
52	$(K_OBJS)  $(CHANGE_OBJS)
53SRCS	= $(OBJS:.o=.c)
54
55include ../Makefile.cmd
56
57IBINPROG=		$(BINPROG:%=$(ROOTBIN)/%)
58ISBINPROG=		$(SBINPROG:%=$(ROOTUSRSBIN)/%)
59
60ROOTMANIFESTDIR=	$(ROOTSVCNETWORKRPC)
61
62$(ROOTBIN)/chkey :=				FILEMODE=	4555
63
64$(ROOTKEYSERVDFLT) :=				FILEMODE=	444
65
66CPPFLAGS += -I. -I$(SRC)/lib/libnsl/include -I$(SRC)/lib/libsldap/common \
67		-D_REENTRANT
68
69CERRWARN +=	-_gcc=-Wno-implicit-function-declaration
70CERRWARN +=	-_gcc=-Wno-parentheses
71CERRWARN +=	$(CNOWARN_UNINIT)
72CERRWARN +=	-_gcc=-Wno-unused-variable
73CERRWARN +=	-_gcc=-Wno-address
74CERRWARN +=	-_gcc=-Wno-unused-function
75
76# not linted
77SMATCH=off
78
79LDLIBS +=	-lnsl
80chkey :=	LDLIBS += -lsldap
81keyserv :=	LDLIBS += -lmp
82newkey  :=	LDLIBS += -lsldap -lsocket
83
84.KEEP_STATE:
85
86all: $(PROG)
87
88keyserv: $(K_OBJS)  $(KEYSERVOBJS)
89	$(LINK.c) $(K_OBJS)  $(KEYSERVOBJS) -o $@ $(LDLIBS)
90	$(POST_PROCESS)
91
92keylogout: $(KEYLOGOUTOBJS)
93	$(LINK.c) $(KEYLOGOUTOBJS) -o $@ $(LDLIBS)
94	$(POST_PROCESS)
95
96keylogin: $(KEYLOGINOBJS)
97	$(LINK.c) $(KEYLOGINOBJS) -o $@ $(LDLIBS)
98	$(POST_PROCESS)
99
100chkey: $(CHKEYOBJS) $(CHANGE_OBJS)
101	$(LINK.c) $(CHANGE_OBJS) $(CHKEYOBJS) -o $@ $(LDLIBS)
102	$(POST_PROCESS)
103
104newkey:$(CHANGE_OBJS)  $(NEWKEYOBJS) $(OUTSIDE_UTIL_OBJS)
105	$(LINK.c) $(CHANGE_OBJS)  $(NEWKEYOBJS) $(OUTSIDE_UTIL_OBJS) \
106	-o $@ $(LDLIBS)
107	$(POST_PROCESS)
108
109update: $(UPDATEOBJS)
110	$(LINK.c)  $(UPDATEOBJS) -o $@ $(LDLIBS)
111	$(POST_PROCESS)
112
113domainname: $(DOMAINNAMEOBJS)
114	$(LINK.c) $(DOMAINNAMEOBJS) -o $@ $(LDLIBS)
115	$(POST_PROCESS)
116
117selfcheck.o: ../fs.d/nfs/lib/selfcheck.c
118	$(COMPILE.c) ../fs.d/nfs/lib/selfcheck.c
119
120install: all $(DIRS) $(IBINPROG) $(ISBINPROG) $(ROOTETCDEFAULTFILES) \
121	$(ROOTMANIFEST)
122
123clean:
124	$(RM) $(OBJS) $(OUTSIDE_UTIL_OBJS)
125
126lint: lint_SRCS
127
128check:	$(CHKMANIFEST)
129
130key_prot.h : $(ROOT)/usr/include/rpcsvc/key_prot.x
131	$(RPCGEN) -h $(ROOT)/usr/include/rpcsvc/key_prot.x > key_prot.h
132
133include ../Makefile.targ
134