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