--- old/usr/src/cmd/ypcmd/Makefile	2015-03-13 12:28:29.904893892 -0400
+++ new/usr/src/cmd/ypcmd/Makefile	2015-03-13 12:28:29.911924115 -0400
@@ -22,6 +22,8 @@
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2015 RackTop Systems.
+#
 
 BINPROG = ypmatch ypwhich ypcat
 SBINPROG = makedbm ypalias ypinit yppoll ypset
@@ -49,12 +51,18 @@
 		$(NETSVC) $(NETYP) $(ROOTVAR_YP) $(ROOTBINDING) \
 		$(ROOTUSRSBIN) $(ROOTBIN)
 
-$(BINPROG) :=	LDLIBS += -lnsl
-$(NETYPPROG) :=	LDLIBS += -lnsl
 $(NIS2LDAPPROG) := LDLIBS += -lc -lnsl -lnisdb
 ypinit :=	LDLIBS += -lnsl
 yppoll :=	LDLIBS += -lnsl
 ypset :=	LDLIBS += -lnsl
+ypbind :=	LDLIBS += -lnsl
+ypmatch :=	LDLIBS += -lnsl
+ypwhich :=	LDLIBS += -lnsl
+ypcat :=	LDLIBS += -lnsl
+yppush :=	LDLIBS += -lnsl
+mkalias :=	LDLIBS += -lnsl
+stdhosts :=	LDLIBS += -lnsl
+stdethers :=	LDLIBS += -lsocket
 makedbm :=	MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
 makedbm :=	LDFLAGS += $(MAPFILES:%=-M%)
 
@@ -68,7 +76,6 @@
 TXTS=	$(ETCFILES:%=net_files/%) $(YPFILES:%=net_files/%)
 SUBDIRS = yppasswd mknetid revnetgroup ypupdated yp2lscripts
 
-YPBINDOBJ= yp_b_svc.o yp_b_subr.o rpc_bootstrap.o getlist.o
 #
 # Some sort of obsolete idea of common files which are only now used by a 
 # few minor utilities
@@ -80,17 +87,19 @@
 #
 SHARED_DIR= ./shared
 SHAREDOBJ= $(SHARED_DIR)/utils.o $(SHARED_DIR)/lockmap.o $(SHARED_DIR)/ancil.o
-SHARESRC = $(SHAREOBJ:.o=.c)
+SHAREDSRC = $(SHAREDOBJ:%.o=%.c)
 
+YPBINDOBJ= yp_b_svc.o yp_b_subr.o rpc_bootstrap.o getlist.o
 YPXFROBJ = ypxfr.o ypxfrd_client.o ypxfrd_xdr.o
 YPMATOBJ = ypmatch.o nick.o
 YPWHIOBJ = ypwhich.o nick.o
 YPCATOBJ = ypcat.o nick.o
+MAKEDBMOBJ = makedbm.o
+YPALIASOBJ = ypalias.o
 UDPUBLICKEYOBJ = udpublickey.o
 MKALIASOBJ = mkalias.o
 STDETHERSOBJ = stdethers.o
 STDHOSTSOBJ = stdhosts.o
-#COMMONCLNTOBJ =	clnt_create_rsvd.o
 YPSERVOBJ = ypserv.o ypserv_map.o \
 		ypserv_proc.o ypserv_ancil.o \
 		ypserv_resolv.o ypserv_resolv_common.o \
@@ -103,31 +112,27 @@
 		$(YPBINDOBJ) $(UDPUBLICKEYOBJ)
 OBJS = $(NETYPOBJ) $(MKALIASOBJ) $(COMMONOBJ) $(SHAREDOBJ) \
 	$(YPPUSHOBJ) $(YPMATOBJ) $(YPWHIOBJ) $(YPCATOBJ) \
-	$(STDETHERSOBJ) $(STDHOSTSOBJ) makedbm.o ypalias.o pong.o
-
-BINSRC = $(BINPROG:=.c)
-
-SBINSRC = $(SBINPROG:=.c)
-
-NETYPSRC = $(NETYPOBJ:.o=.c)
-
-YPBINDSRC = $(YPBINSOBJ:.o=.c)
-
-YPXFRSRC =	$(YPXFROBJ:.o=.c)
+	$(STDETHERSOBJ) $(STDHOSTSOBJ) $(MAKEDBMOBJ) $(YPALIASOBJ)
 
-YPSERVSRC =	$(YPSERVOBJ:.o=.c)
-
-YPPUSHSRC =	$(YPPUSHOBJ:.o=.c)
-
-YPXFRDSRC =	$(YPXFRDOBJ:.o=.c)
-
-YPMASTERSRC =	$(YPMASTEROBJ:.o=.c)
-
-YPALLSRC =	$(YPALLOBJ:.o=.c)
-
-COMMONSRC = 	$(COMMONOBJ:.o=.c)
-
-#COMMONCLNTSRC =	$(COMMONCLNTOBJ:.o=.c)
+BINSRC =	$(BINPROG:%=%.c)
+SBINSRC =	$(SBINPROG:%=%.c)
+NETYPSRC =	$(NETYPOBJ:%.o=%.c)
+YPBINDSRC =	$(YPBINSOBJ:%.o=%.c)
+YPXFRSRC =	$(YPXFROBJ:%.o=%.c)
+YPMATSRC =	$(YPMATOBJ:%.o=%.c)
+YPWHISRC =	$(YPWHIOBJ:%.o=%.c)
+YPCATSRC =	$(YPCATOBJ:%.o=%.c)
+MAKEDBMSRC =	$(MAKEDBMOBJ:%.o=%.c)
+YPALIASSRC =	$(YPALIASOBJ:%.o=%.c)
+UDPUBLICKEYSRC =	$(UDPUBLICKEYOBJ:%.o=%.c)
+MKALIASSRC =	$(MKALIASOBJ:%.o=%.c)
+STDETHERSSRC =	$(STDETHERSOBJ:%.o=%.c)
+STDHOSTSSRC =	$(STDHOSTSOBJ:%.o=%.c)
+YPSERVSRC =	$(YPSERVOBJ:%.o=%.c)
+YPPUSHSRC =	$(YPPUSHOBJ:%.o=%.c)
+YPXFRDSRC =	$(YPXFRDOBJ:%.o=%.c)
+YPALLSRC =	$(YPALLOBJ:%.o=%.c)
+COMMONSRC = 	$(COMMONOBJ:%.o=%.c)
 
 SRCS = $(BINSRC) $(SBINSRC) $(NETYPSRC) \
 	$(COMMONSRC) $(SHAREDSRC)
@@ -152,12 +157,12 @@
 CERRWARN +=	-_gcc=-Wno-unused-function
 
 #conditional assignments
-ypalias.o :=	CPPFLAGS= -DMAIN $(CPPFLAGS.master)
-makedbm.o :=	CPPFLAGS= $(CPPFLAGS.master)
-yp_b_svc.o :=	CPPFLAGS += -DINIT_DEFAULT
+$(YPALIASOBJ) :=	CPPFLAGS= -DMAIN $(CPPFLAGS.master)
+$(MAKEDBMOBJ) :=	CPPFLAGS= $(CPPFLAGS.master)
+$(YPBINDOBJ) :=	CPPFLAGS += -DINIT_DEFAULT
 ypxfrd_svc.o := CPPFLAGS += -Dmain=_main
-ypxfr.o := CPPFLAGS += $(NIS2LDAPINC)
-yppush.o := CPPFLAGS += $(NIS2LDAPINC)
+$(YPXFROBJ) := CPPFLAGS += $(NIS2LDAPINC)
+$(YPPUSHOBJ) := CPPFLAGS += $(NIS2LDAPINC)
 $(NIS2LDAPPROG) := CPPFLAGS += $(NIS2LDAPINC)
 $(SHAREDOBJ) := CPPFLAGS += -I$(SRC)/lib/libnisdb/yptol
 $(ROOTVAR_YP)/Makefile := FILEMODE= 555
@@ -175,7 +180,7 @@
 lint:=		TARGET= lint
 cstyle :=	TARGET= cstyle
 
-all: $(SHAREDOBJ) $(SUBDIRS) $(PROG) $(TXTS) 
+all: $(SHAREDOBJ) .WAIT $(SUBDIRS) $(PROG) $(TXTS)
 
 # install rules
 $(ROOTVAR_YP)/% \
@@ -190,8 +195,8 @@
 
 .KEEP_STATE:
 
-$(SHAREDOBJ): $(SHAREDSRC)
-	$(COMPILE.c) $(SHAREDSRC) -o $@ $<
+$(SHARED_DIR)/%.o: $(SHARED_DIR)/%.c
+	$(COMPILE.c) -o $@ $<
 
 ypbind: $(YPBINDOBJ)
 	$(LINK.c) $(YPBINDOBJ) -o $@ $(LDLIBS)
@@ -221,21 +226,16 @@
 
 ypxfrd_xdr.o ypxfrd_client.o: ypxfrd.h
 
-#clnt_create_rsvd.o ypxfr.o: clnt_create_rsvd.h
-
 ypxfrd: $(YPXFRDOBJ) $(SHAREDOBJ)
-	$(LINK.cc) $(YPXFRDOBJ) $(SHAREDOBJ) \
-	-o $@ $(LDLIBS) -lc
+	$(LINK.cc) $(YPXFRDOBJ) $(SHAREDOBJ) -o $@ $(LDLIBS)
 	$(POST_PROCESS)
 
-ypxfr: $(YPXFROBJ) $(COMMONOBJ) $(YPMASTEROBJ) $(SHAREDOBJ)
-	$(LINK.cc) -o $@ $(YPXFROBJ) $(YPMASTEROBJ) $(COMMONOBJ) \
-		$(SHAREDOBJ) $(LDLIBS)
+ypxfr: $(YPXFROBJ) $(COMMONOBJ) $(SHAREDOBJ)
+	$(LINK.cc) -o $@ $(YPXFROBJ) $(COMMONOBJ) $(SHAREDOBJ) $(LDLIBS)
 	$(POST_PROCESS)
 
 ypserv: $(YPSERVOBJ) $(COMMONOBJ) $(SHAREDOBJ)
-	$(LINK.cc) $(YPSERVOBJ) $(COMMONOBJ) \
-		$(SHAREDOBJ) -o $@ $(LDLIBS)
+	$(LINK.cc) $(YPSERVOBJ) $(COMMONOBJ) $(SHAREDOBJ) -o $@ $(LDLIBS)
 	$(POST_PROCESS)
 
 yppush: $(YPPUSHOBJ) $(COMMONOBJ)
@@ -243,15 +243,15 @@
 	$(POST_PROCESS)
 
 udpublickey: $(UDPUBLICKEYOBJ)
-	$(LINK.c) $(UDPUBLICKEYOBJ) -o $@
+	$(LINK.c) $(UDPUBLICKEYOBJ) -o $@ $(LDLIBS)
 	$(POST_PROCESS)
 
 mkalias: $(MKALIASOBJ)
-	$(LINK.c) $(MKALIASOBJ) -o $@ -lnsl
+	$(LINK.c) $(MKALIASOBJ) -o $@ $(LDLIBS)
 	$(POST_PROCESS)
 
 stdethers: $(STDETHERSOBJ)
-	$(LINK.c) $(STDETHERSOBJ) -o $@ -lsocket
+	$(LINK.c) $(STDETHERSOBJ) -o $@ $(LDLIBS)
 	$(POST_PROCESS)
 
 stdhosts: $(STDHOSTSOBJ)
@@ -271,28 +271,19 @@
 lint := CPPFLAGS += -I$(SRC)/lib/libnisdb/yptol
 
 lint:	$(SUBDIRS)
-	$(LINT.c) ypmatch.c nick.c -lnsl
-	$(LINT.c) ypwhich.c nick.c -lnsl
-	$(LINT.c) ypcat.c nick.c -lnsl
-	$(LINT.c) makedbm.c getlist.c yp_getalias.c
-	$(LINT.c) ypalias.c getlist.c yp_getalias.c
-	$(LINT.c) yp_b_svc.c yp_b_subr.c rpc_bootstrap.c getlist.c -lnsl
-	$(LINT.c) ypxfr.c ypxfrd_client.c ypxfrd_xdr.c getlist.c yp_getalias.c \
-		./shared/utils.c ./shared/lockmap.c ./shared/ancil.c -lnsl
-	$(LINT.c) yppush.c getlist.c yp_getalias.c -lnsl
-	$(LINT.c) udpublickey.c
-	$(LINT.c) mkalias.c -lnsl
-	$(LINT.c) stdethers.c -lsocket
-	$(LINT.c) stdhosts.c -lnsl
-	$(LINT.c) ypxfrd_svc.c ypxfrd_xdr.c ypxfrd_server.c \
-		ypserv_net_secure.c \
-		./shared/utils.c ./shared/lockmap.c ./shared/ancil.c \
-		-lnsl -lnisdb
-	$(LINT.c) ypserv.c ypserv_map.c ypserv_proc.c ypserv_ancil.c \
-		ypserv_resolv.c ypserv_resolv_common.c ypv1_xdr.c \
-		ypserv_net_secure.c getlist.c yp_getalias.c \
-		./shared/utils.c ./shared/lockmap.c ./shared/ancil.c \
-		-lnsl -lnisdb
+	$(LINT.c) $(UDPUBLICKEYSRC) $(LDLIBS)
+	$(LINT.c) $(MAKEDBMSRC) $(COMMONSRC) $(LDLIBS)
+	$(LINT.c) $(YPALIASSRC) $(COMMONSRC) $(LDLIBS)
+	$(LINT.c) $(YPMATSRC) $(LDLIBS) -lnsl
+	$(LINT.c) $(YPWHISRC) $(LDLIBS) -lnsl
+	$(LINT.c) $(YPCATSRC) $(LDLIBS) -lnsl
+	$(LINT.c) $(YPBINDSRC) $(LDLIBS) -lnsl
+	$(LINT.c) $(MKALIASSRC) $(LDLIBS) -lnsl
+	$(LINT.c) $(STDHOSTSSRC) $(LDLIBS) -lnsl
+	$(LINT.c) $(STDETHERSSRC) $(LDLIBS) -lsocket
+	$(LINT.c) $(YPPUSHSRC) $(COMMONSRC) $(LDLIBS) -lnsl
+	$(LINT.c) $(YPXFRSRC) $(COMMONSRC) $(SHAREDSRC) $(LDLIBS) -lnsl -lnisdb
+	$(LINT.c) $(YPSERVSRC) $(COMMONSRC) $(SHAREDSRC) $(LDLIBS) -lnsl -lnisdb
 
 check: $(CHKMANIFEST)
 
