17c478bdstevel@tonic-gate#
27c478bdstevel@tonic-gate# CDDL HEADER START
37c478bdstevel@tonic-gate#
47c478bdstevel@tonic-gate# The contents of this file are subject to the terms of the
5a192e90amaguire# Common Development and Distribution License (the "License").
6a192e90amaguire# You may not use this file except in compliance with the License.
77c478bdstevel@tonic-gate#
87c478bdstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bdstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bdstevel@tonic-gate# See the License for the specific language governing permissions
117c478bdstevel@tonic-gate# and limitations under the License.
127c478bdstevel@tonic-gate#
137c478bdstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bdstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bdstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bdstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bdstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bdstevel@tonic-gate#
197c478bdstevel@tonic-gate# CDDL HEADER END
207c478bdstevel@tonic-gate#
217c478bdstevel@tonic-gate#
221f03f04Peter Shoults# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bdstevel@tonic-gate# Use is subject to license terms.
247c478bdstevel@tonic-gate#
255661bb7John Levon# Copyright (c) 2018, Joyent, Inc.
267c478bdstevel@tonic-gate
277c478bdstevel@tonic-gateTESTPROG = gssdtest
287c478bdstevel@tonic-gate
297c478bdstevel@tonic-gateOUTPUT_OPTION = -I.
307c478bdstevel@tonic-gate
317c478bdstevel@tonic-gatePROG= gssd
327c478bdstevel@tonic-gate
337c478bdstevel@tonic-gateMANIFEST=	gss.xml
347c478bdstevel@tonic-gate
357c478bdstevel@tonic-gateGSSD_BASEOBJS = gssd.o gssd_proc.o gssd_generic.o gssd_getuid.o
367c478bdstevel@tonic-gateGSSC_BASEOBJS = gssdtest.o gssd_release_name_and_type.o gssd_clnt_stubs.o \
377c478bdstevel@tonic-gate		gssd_handle.o
387c478bdstevel@tonic-gate
397c478bdstevel@tonic-gateGD_OBJS	= gssd_svc.o
407c478bdstevel@tonic-gateGC_OBJS	= gssd_clnt.o
415661bb7John LevonG_OBJS	= gssd_xdr.o
427c478bdstevel@tonic-gateGSSDOBJS = $(GSSD_BASEOBJS) $(GD_OBJS) $(G_OBJS)
437c478bdstevel@tonic-gateGSSCOBJS = $(GSSC_BASEOBJS) $(GC_OBJS) $(G_OBJS)
447c478bdstevel@tonic-gate
457c478bdstevel@tonic-gateGSSD_LINTS = $(GSSD_BASEOBJS:.o=.c)
467c478bdstevel@tonic-gateGSSC_LINTS = $(GSSC_BASEOBJS:.o=.c)
477c478bdstevel@tonic-gate
487c478bdstevel@tonic-gateROBJS	= $(GD_OBJS) $(GC_OBJS) $(G_OBJS)
497c478bdstevel@tonic-gateOBJS	= $(GSSD_BASEOBJS) $(GD_OBJS) $(GSSC_BASEOBJS) $(GC_OBJS) $(G_OBJS)
507c478bdstevel@tonic-gateSRCS	= $(OBJS:.o=.c)
517c478bdstevel@tonic-gateRSRC	= $(ROBJS:.o=.c)
527c478bdstevel@tonic-gateRSRC 	+= gssd.h
537c478bdstevel@tonic-gate
547c478bdstevel@tonic-gateCLOBBERFILES += $(TESTPROG)
557c478bdstevel@tonic-gate
567c478bdstevel@tonic-gateinclude ../../Makefile.cmd
577c478bdstevel@tonic-gate
587c478bdstevel@tonic-gateROOTMANIFESTDIR=	$(ROOTSVCNETWORKRPC)
597c478bdstevel@tonic-gate
607c478bdstevel@tonic-gateTEXT_DOMAIN = SUNW_OST_NETRPC
617c478bdstevel@tonic-gatePOFILE = $(PROG).po
627c478bdstevel@tonic-gatePOFILES = generic.po
637c478bdstevel@tonic-gate
647c478bdstevel@tonic-gate#
657c478bdstevel@tonic-gate# Override $ROOTLIB
667c478bdstevel@tonic-gate#
677c478bdstevel@tonic-gateROOTLIB=	$(ROOT)/usr/lib/gss
687c478bdstevel@tonic-gate
697c478bdstevel@tonic-gateDIRS=	$(ROOTLIB)
707c478bdstevel@tonic-gate
717c478bdstevel@tonic-gateCPPFLAGS += -I$(SRC)/uts/common/gssapi/include
725661bb7John LevonCOPTFLAG += $(XESS) #-I$(KINCDIR)
737c478bdstevel@tonic-gate
747014882Richard LoweCERRWARN += -_gcc=-Wno-unused-variable
757014882Richard LoweCERRWARN += -_gcc=-Wno-implicit-function-declaration
767014882Richard LoweCERRWARN += -_gcc=-Wno-parentheses
77d3b5f56John LevonCERRWARN += $(CNOWARN_UNINIT)
787014882Richard Lowe
795661bb7John Levon# not linted
805661bb7John LevonSMATCH=off
815661bb7John Levon
827c478bdstevel@tonic-gateLDLIBS += -lgss -lnsl
837c478bdstevel@tonic-gate
8424da5b3riegssd :=	MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
8524da5b3riegssd :=	LDFLAGS += $(MAPFILES:%=-M%)
8624da5b3rie
877c478bdstevel@tonic-gate$(GPROGS) := CPPFLAGS += -DSYSV -DSunOS=50 
887c478bdstevel@tonic-gate
897c478bdstevel@tonic-gate.KEEP_STATE:
907c478bdstevel@tonic-gate
917c478bdstevel@tonic-gateall: $(PROG) $(TESTPROG)
927c478bdstevel@tonic-gate
937c478bdstevel@tonic-gate$(ROOTLIB):
947c478bdstevel@tonic-gate	$(INS.dir)
957c478bdstevel@tonic-gate
967c478bdstevel@tonic-gate$(ROOTLIB)/%:	%
977c478bdstevel@tonic-gate	$(INS.file)
987c478bdstevel@tonic-gate
9924da5b3riegssd:	$(GSSDOBJS) $$(MAPFILES)
1007c478bdstevel@tonic-gate	$(LINK.c) $(GSSDOBJS) -o $@ $(LDLIBS)
1017c478bdstevel@tonic-gate	$(POST_PROCESS)
1027c478bdstevel@tonic-gate
1037c478bdstevel@tonic-gategssdtest:       $(GSSCOBJS) 
1047c478bdstevel@tonic-gate	$(LINK.c) $(GSSCOBJS) -o $@ $(LDLIBS)
1057c478bdstevel@tonic-gate	$(POST_PROCESS)
1067c478bdstevel@tonic-gate
1077c478bdstevel@tonic-gateGSSDX=	$(SRC)/uts/common/gssapi/gssd.x
1087c478bdstevel@tonic-gategssd.x:	$(GSSDX)
1097c478bdstevel@tonic-gate	rm -f $@
1107c478bdstevel@tonic-gate	cp $(GSSDX) $@
1117c478bdstevel@tonic-gate
1127c478bdstevel@tonic-gate#  Rules to generate derived rpcgen files from gssd.x spec file.
1137c478bdstevel@tonic-gate
1141f03f04Peter Shoults# NOTE WELL: There is code in gssd that assumes gssd is NOT
1151f03f04Peter Shoults# multi-threaded.  Do NOT add -A to the rpcgen argument list in the
1161f03f04Peter Shoults# Makefile unless you also remove this assumption.
1171f03f04Peter Shoults
1187c478bdstevel@tonic-gategssd.h:        gssd.x
1197c478bdstevel@tonic-gate	$(RM) $@
1207c478bdstevel@tonic-gate	$(RPCGEN) -M -h gssd.x > $@
1217c478bdstevel@tonic-gate
1227c478bdstevel@tonic-gategssd_clnt.c:   gssd.x
1237c478bdstevel@tonic-gate	$(RM) $@
1247c478bdstevel@tonic-gate	$(RPCGEN) -M -l gssd.x > $@
1257c478bdstevel@tonic-gate
1267c478bdstevel@tonic-gategssd_svc.c:    gssd.x
1277c478bdstevel@tonic-gate	$(RM) $@
1287c478bdstevel@tonic-gate	$(RPCGEN) -M -m gssd.x > $@
1297c478bdstevel@tonic-gate
1307c478bdstevel@tonic-gategssd_xdr.c:    gssd.x
1317c478bdstevel@tonic-gate	$(RM) $@
1327c478bdstevel@tonic-gate	$(RPCGEN) -M -c gssd.x > $@
1337c478bdstevel@tonic-gate
1347c478bdstevel@tonic-gate$(OBJS): gssd.h
1357c478bdstevel@tonic-gate
1367c478bdstevel@tonic-gateinstall: all $(DIRS) $(ROOTLIBPROG) $(ROOTMANIFEST)
1377c478bdstevel@tonic-gate
1387c478bdstevel@tonic-gateinstall_h:
1397c478bdstevel@tonic-gate
1407c478bdstevel@tonic-gateclean:
1417c478bdstevel@tonic-gate	$(RM) $(OBJS) $(RSRC) gssd.x
1427c478bdstevel@tonic-gate
1437c478bdstevel@tonic-gatelint_gssd:
1447c478bdstevel@tonic-gate	$(LINT.c) $(GSSD_LINTS)
1457c478bdstevel@tonic-gate
1467c478bdstevel@tonic-gatelint_gssc:
1477c478bdstevel@tonic-gate	$(LINT.c) $(GSSC_LINTS)
1487c478bdstevel@tonic-gate
1497c478bdstevel@tonic-gatelint:	lint_gssd lint_gssc
1507c478bdstevel@tonic-gate
1517c478bdstevel@tonic-gatecheck:	$(CHKMANIFEST)
1527c478bdstevel@tonic-gate
1537c478bdstevel@tonic-gateinclude ../../Makefile.targ
1547c478bdstevel@tonic-gate
1557c478bdstevel@tonic-gate$(POFILE): $(DERIVED_FILES) .WAIT $(POFILES)
1567c478bdstevel@tonic-gate	$(RM) $@
1577c478bdstevel@tonic-gate	$(CAT) $(POFILES) > $@
1587c478bdstevel@tonic-gate
1597c478bdstevel@tonic-gategeneric.po: FRC
1607c478bdstevel@tonic-gate	$(RM) messages.po
1617c478bdstevel@tonic-gate	$(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext *.[ch]`
1627c478bdstevel@tonic-gate	$(SED) "/^domain/d" messages.po > $@
1637c478bdstevel@tonic-gate	$(RM) messages.po
1647c478bdstevel@tonic-gate
1657c478bdstevel@tonic-gateFRC:
1667c478bdstevel@tonic-gate
167