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