xref: /titanic_44/usr/src/cmd/gss/gssd/Makefile (revision a398035bff356df3a17376cda89486682fb1f23b)
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
26TESTPROG = gssdtest
27
28OUTPUT_OPTION = -I.
29
30PROG= gssd
31
32MANIFEST=	gss.xml
33
34GSSD_BASEOBJS = gssd.o gssd_proc.o gssd_generic.o gssd_getuid.o
35GSSC_BASEOBJS = gssdtest.o gssd_release_name_and_type.o gssd_clnt_stubs.o \
36		gssd_handle.o
37
38GD_OBJS	= gssd_svc.o
39GC_OBJS	= gssd_clnt.o
40G_OBJS	= gssd_xdr.o
41GSSDOBJS = $(GSSD_BASEOBJS) $(GD_OBJS) $(G_OBJS)
42GSSCOBJS = $(GSSC_BASEOBJS) $(GC_OBJS) $(G_OBJS)
43
44GSSD_LINTS = $(GSSD_BASEOBJS:.o=.c)
45GSSC_LINTS = $(GSSC_BASEOBJS:.o=.c)
46
47ROBJS	= $(GD_OBJS) $(GC_OBJS) $(G_OBJS)
48OBJS	= $(GSSD_BASEOBJS) $(GD_OBJS) $(GSSC_BASEOBJS) $(GC_OBJS) $(G_OBJS)
49SRCS	= $(OBJS:.o=.c)
50RSRC	= $(ROBJS:.o=.c)
51RSRC 	+= gssd.h
52
53CLOBBERFILES += $(TESTPROG)
54
55include ../../Makefile.cmd
56
57ROOTMANIFESTDIR=	$(ROOTSVCNETWORKRPC)
58
59TEXT_DOMAIN = SUNW_OST_NETRPC
60POFILE = $(PROG).po
61POFILES = generic.po
62
63#
64# Override $ROOTLIB
65#
66ROOTLIB=	$(ROOT)/usr/lib/gss
67
68DIRS=	$(ROOTLIB)
69
70$(ROOTLIB)/gssd :=	OWNER=	root
71$(ROOTLIB)/gssd :=	GROUP=	bin
72
73CPPFLAGS += -I$(SRC)/uts/common/gssapi/include
74COPTFLAG += $(XESS) #-I$(KINCDIR)
75
76LDLIBS += -lgss -lnsl
77
78gssd :=	MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
79gssd :=	LDFLAGS += $(MAPFILES:%=-M%)
80
81$(GPROGS) := CPPFLAGS += -DSYSV -DSunOS=50
82
83.KEEP_STATE:
84
85all: $(PROG) $(TESTPROG)
86
87$(ROOTLIB):
88	$(INS.dir)
89
90$(ROOTLIB)/%:	%
91	$(INS.file)
92
93gssd:	$(GSSDOBJS) $$(MAPFILES)
94	$(LINK.c) $(GSSDOBJS) -o $@ $(LDLIBS)
95	$(POST_PROCESS)
96
97gssdtest:       $(GSSCOBJS)
98	$(LINK.c) $(GSSCOBJS) -o $@ $(LDLIBS)
99	$(POST_PROCESS)
100
101GSSDX=	$(SRC)/uts/common/gssapi/gssd.x
102gssd.x:	$(GSSDX)
103	rm -f $@
104	cp $(GSSDX) $@
105
106#  Rules to generate derived rpcgen files from gssd.x spec file.
107
108# NOTE WELL: There is code in gssd that assumes gssd is NOT
109# multi-threaded.  Do NOT add -A to the rpcgen argument list in the
110# Makefile unless you also remove this assumption.
111
112gssd.h:        gssd.x
113	$(RM) $@
114	$(RPCGEN) -M -h gssd.x > $@
115
116gssd_clnt.c:   gssd.x
117	$(RM) $@
118	$(RPCGEN) -M -l gssd.x > $@
119
120gssd_svc.c:    gssd.x
121	$(RM) $@
122	$(RPCGEN) -M -m gssd.x > $@
123
124gssd_xdr.c:    gssd.x
125	$(RM) $@
126	$(RPCGEN) -M -c gssd.x > $@
127
128$(OBJS): gssd.h
129
130install: all $(DIRS) $(ROOTLIBPROG) $(ROOTMANIFEST)
131
132install_h:
133
134clean:
135	$(RM) $(OBJS) $(RSRC) gssd.x
136
137lint_gssd:
138	$(LINT.c) $(GSSD_LINTS)
139
140lint_gssc:
141	$(LINT.c) $(GSSC_LINTS)
142
143lint:	lint_gssd lint_gssc
144
145check:	$(CHKMANIFEST)
146
147include ../../Makefile.targ
148
149# EXPORT DELETE START
150# Special targets to clean up the source tree for export distribution
151# The WS target modifies the SCCS files as well, so a working workspace
152# can be shipped.
153# Warning: These targets change the source tree, the first only at the
154#		plain source level, but the second changes the guts!
155EXPORT_SRC:
156	$(RM) Makefile+ gssd_clnt_stubs.c+ gssd_proc.c+ gssdtest.c+
157	sed -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \
158		< Makefile > Makefile+
159	$(MV) Makefile+ Makefile
160	sed -e "/EXPORT DELETE START/,/EXPORT DELETE END/d" \
161		< gssd_clnt_stubs.c > gssd_clnt_stubs.c+
162	$(MV) gssd_clnt_stubs.c+ gssd_clnt_stubs.c
163	sed -e "/EXPORT DELETE START/,/EXPORT DELETE END/d" \
164		< gssd_proc.c > gssd_proc.c+
165	$(MV) gssd_proc.c+ gssd_proc.c
166	sed -e "/EXPORT DELETE START/,/EXPORT DELETE END/d" \
167		< gssdtest.c > gssdtest.c+
168	$(MV) gssdtest.c+ gssdtest.c
169	$(CHMOD) 444  Makefile gssd_clnt_stubs.c gssd_proc.c gssdtest.c
170
171# EXPORT DELETE END
172
173$(POFILE): $(DERIVED_FILES) .WAIT $(POFILES)
174	$(RM) $@
175	$(CAT) $(POFILES) > $@
176
177generic.po: FRC
178	$(RM) messages.po
179	$(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext *.[ch]`
180	$(SED) "/^domain/d" messages.po > $@
181	$(RM) messages.po
182
183FRC:
184
185