xref: /titanic_52/usr/src/cmd/keyserv/Makefile (revision 1cb6af97c6f66f456d4f726ef056e1ebc0f73305)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29SBINPROG = keyserv newkey
30BINPROG	= keylogout keylogin domainname chkey
31
32MANIFEST= keyserv.xml
33
34PROG= $(SBINPROG) $(BINPROG)
35
36HDRS= key_prot.h
37
38DEFAULTFILES = keyserv.dfl
39
40KEYSERVOBJS = keyserv.o
41KEYLOGOUTOBJS = keylogout.o
42KEYLOGINOBJS = keylogin.o
43CHKEYOBJS = chkey.o
44NEWKEYOBJS = newkey.o
45UPDATEOBJS = update.o
46
47DOMAINNAMEOBJS = domainname.o
48K_OBJS = setkey.o detach.o key_generic.o keyserv_cache.o
49CHANGE_OBJS  = update.o chkey_common.o
50OUTSIDE_UTIL_OBJS = selfcheck.o
51
52OBJS	= $(KEYSERVOBJS) $(KEYLOGOUTOBJS) $(KEYLOGINOBJS) $(CHKEYOBJS) \
53	$(NEWKEYOBJS) $(UPDATEOBJS) $(DOMAINNAMEOBJS) \
54	$(K_OBJS)  $(CHANGE_OBJS)
55SRCS	= $(OBJS:.o=.c)
56
57SED=	sed
58
59include ../Makefile.cmd
60
61IBINPROG=		$(BINPROG:%=$(ROOTBIN)/%)
62ISBINPROG=		$(SBINPROG:%=$(ROOTUSRSBIN)/%)
63
64ROOTMANIFESTDIR=	$(ROOTSVCNETWORKRPC)
65
66$(ROOTUSRSBIN)/keyserv \
67$(ROOTUSRSBIN)/newkey :=			OWNER=		root
68$(ROOTUSRSBIN)/keyserv \
69$(ROOTUSRSBIN)/newkey :=			GROUP=		sys
70
71$(ROOTBIN)/chkey :=				OWNER=		root
72$(ROOTBIN)/chkey :=				GROUP=		sys
73$(ROOTBIN)/chkey :=				FILEMODE=	4555
74
75$(ROOTKEYSERVDFLT) :=				OWNER=		root
76$(ROOTKEYSERVDFLT) :=				GROUP=		sys
77$(ROOTKEYSERVDFLT) :=				FILEMODE=	444
78
79$(ROOTMANIFEST) :=				FILEMODE=	444
80
81CPPFLAGS += -I. -I$(SRC)/lib/libnsl/include -I$(SRC)/lib/libsldap/common \
82		-D_REENTRANT
83
84LDLIBS +=	-lnsl
85chkey :=	LDLIBS += -lsldap
86keyserv :=	LDLIBS += -lmp -lcmd
87newkey  :=	LDLIBS += -lsldap -lsocket
88
89.KEEP_STATE:
90
91all: $(PROG)
92
93keyserv: $(K_OBJS)  $(KEYSERVOBJS)
94	$(LINK.c) $(K_OBJS)  $(KEYSERVOBJS) -o $@ $(LDLIBS)
95	$(POST_PROCESS)
96
97keylogout: $(KEYLOGOUTOBJS)
98	$(LINK.c) $(KEYLOGOUTOBJS) -o $@ $(LDLIBS)
99	$(POST_PROCESS)
100
101keylogin: $(KEYLOGINOBJS)
102	$(LINK.c) $(KEYLOGINOBJS) -o $@ $(LDLIBS)
103	$(POST_PROCESS)
104
105chkey: $(CHKEYOBJS) $(CHANGE_OBJS)
106	$(LINK.c) $(CHANGE_OBJS) $(CHKEYOBJS) -o $@ $(LDLIBS)
107	$(POST_PROCESS)
108
109newkey:$(CHANGE_OBJS)  $(NEWKEYOBJS) $(OUTSIDE_UTIL_OBJS)
110	$(LINK.c) $(CHANGE_OBJS)  $(NEWKEYOBJS) $(OUTSIDE_UTIL_OBJS) \
111	-o $@ $(LDLIBS)
112	$(POST_PROCESS)
113
114update: $(UPDATEOBJS)
115	$(LINK.c)  $(UPDATEOBJS) -o $@ $(LDLIBS)
116	$(POST_PROCESS)
117
118domainname: $(DOMAINNAMEOBJS)
119	$(LINK.c) $(DOMAINNAMEOBJS) -o $@ $(LDLIBS)
120	$(POST_PROCESS)
121
122selfcheck.o: ../fs.d/nfs/lib/selfcheck.c
123	$(COMPILE.c) ../fs.d/nfs/lib/selfcheck.c
124
125install: all $(DIRS) $(IBINPROG) $(ISBINPROG) $(ROOTETCDEFAULTFILES) \
126	$(ROOTMANIFEST)
127
128clean:
129	$(RM) $(OBJS)
130
131lint: lint_SRCS
132
133check:	$(CHKMANIFEST)
134
135key_prot.h : $(ROOT)/usr/include/rpcsvc/key_prot.x
136	$(RPCGEN) -h $(ROOT)/usr/include/rpcsvc/key_prot.x > key_prot.h
137
138include ../Makefile.targ
139