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