xref: /illumos-gate/usr/src/cmd/rpcsvc/Makefile (revision a192e900f6d2b0e1a822e3252c0dfd795ed49d76)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5*a192e900Samaguire# Common Development and Distribution License (the "License").
6*a192e900Samaguire# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
22*a192e900Samaguire# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
267c478bd9Sstevel@tonic-gate#
277c478bd9Sstevel@tonic-gate# cmd/rpcsvc/Makefile
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gatePROTOCOL_DIR= $(ROOT)/usr/include/rpcsvc
307c478bd9Sstevel@tonic-gate
317c478bd9Sstevel@tonic-gateBINPROG= rusers rup
327c478bd9Sstevel@tonic-gateSBINPROG= rwall spray
337c478bd9Sstevel@tonic-gateRPROG= rpc.rusersd
347c478bd9Sstevel@tonic-gateSPROG= rpc.sprayd
357c478bd9Sstevel@tonic-gateWPROG= rpc.rwalld
367c478bd9Sstevel@tonic-gateTPROG= rpc.rstatd
377c478bd9Sstevel@tonic-gate
387c478bd9Sstevel@tonic-gatePROG= $(BINPROG) $(SBINPROG) $(RPROG) $(SPROG) $(WPROG) $(TPROG)
397c478bd9Sstevel@tonic-gate
407c478bd9Sstevel@tonic-gateMANIFEST= \
417c478bd9Sstevel@tonic-gate	nisplus.xml \
427c478bd9Sstevel@tonic-gate	rusers.xml \
437c478bd9Sstevel@tonic-gate	spray.xml \
447c478bd9Sstevel@tonic-gate	wall.xml \
457c478bd9Sstevel@tonic-gate	rstat.xml
467c478bd9Sstevel@tonic-gate
477c478bd9Sstevel@tonic-gateSVCMETHOD= \
487c478bd9Sstevel@tonic-gate	nisplus
497c478bd9Sstevel@tonic-gate
507c478bd9Sstevel@tonic-gateSCLNTOBJS= spray.o spray_clnt.o
517c478bd9Sstevel@tonic-gateSSVCOBJS= spray_subr.o spray_svc.o
527c478bd9Sstevel@tonic-gateWCLNTOBJS = rwall.o rwall_clnt.o
537c478bd9Sstevel@tonic-gateWSVCOBJS= rwall_subr.o rwall_svc.o
547c478bd9Sstevel@tonic-gateTSVCOBJS= rstat_main.o rstat_proc.o rstat_svc.o rstat_v2_svc.o rstat_v2_xdr.o
557c478bd9Sstevel@tonic-gate
567c478bd9Sstevel@tonic-gateDERIVED_FILES = rstat.x rstat.h rstat_svc.c rstat_v2.h rstat_v2_svc.c \
577c478bd9Sstevel@tonic-gate		rstat_v2_xdr.c spray.x spray.h spray_clnt.c spray_svc.c \
587c478bd9Sstevel@tonic-gate		rwall.x rwall.h rwall_svc.c rwall_clnt.c
597c478bd9Sstevel@tonic-gate
607c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd
617c478bd9Sstevel@tonic-gate
627c478bd9Sstevel@tonic-gateROOTMANIFESTDIR=	$(ROOTSVCNETWORKRPC)
637c478bd9Sstevel@tonic-gate
647c478bd9Sstevel@tonic-gateCPPFLAGS= -I. $(CPPFLAGS.master)
657c478bd9Sstevel@tonic-gateLDLIBS += -lnsl
667c478bd9Sstevel@tonic-gaterusers :=	CFLAGS += -v
677c478bd9Sstevel@tonic-gate$(BINPROG) :=	LDLIBS += -lrpcsvc
687c478bd9Sstevel@tonic-gate$(RPROG) :=	LDLIBS += -lrpcsvc
697c478bd9Sstevel@tonic-gate$(SPROG) :=	LDLIBS += -lrpcsvc
707c478bd9Sstevel@tonic-gate$(TPROG) :=	LDLIBS += -lrpcsvc
717c478bd9Sstevel@tonic-gatespray :=	LDLIBS += -lrpcsvc
727c478bd9Sstevel@tonic-gate
737c478bd9Sstevel@tonic-gateCP=	cp
747c478bd9Sstevel@tonic-gate
757c478bd9Sstevel@tonic-gateSUBDIRS= rpc.bootparamd nis/utils nis/bin nis/cachemgr nis/rpc.nisd \
767c478bd9Sstevel@tonic-gate	 nis/rpc.nispasswdd
777c478bd9Sstevel@tonic-gateOBJS= $(SCLNTOBJS) $(SSVCOBJS) $(WCLNTOBJS) $(WSVCOBJS) $(TSVCOBJS)
787c478bd9Sstevel@tonic-gateSRCS= $(OBJS:%.o=%.c) rusers.c rpc.rusersd.c rup.c
797c478bd9Sstevel@tonic-gate
807c478bd9Sstevel@tonic-gateETCFILES= rpc
817c478bd9Sstevel@tonic-gate
827c478bd9Sstevel@tonic-gateTXTS= $(ETCFILES:%=net_files/%)
837c478bd9Sstevel@tonic-gate
847c478bd9Sstevel@tonic-gateNETSVC=	$(ROOTLIB)/netsvc
857c478bd9Sstevel@tonic-gateNIS = $(NETSVC)/nis
867c478bd9Sstevel@tonic-gateRWALL= $(NETSVC)/rwall
877c478bd9Sstevel@tonic-gateRUSERS= $(NETSVC)/rusers
887c478bd9Sstevel@tonic-gateSPRAY= $(NETSVC)/spray
897c478bd9Sstevel@tonic-gateRSTAT= $(NETSVC)/rstat
907c478bd9Sstevel@tonic-gateROOTVAR_NIS= $(ROOT)/var/nis
917c478bd9Sstevel@tonic-gate
927c478bd9Sstevel@tonic-gateROOTDIRS= \
937c478bd9Sstevel@tonic-gate		$(NETSVC) \
947c478bd9Sstevel@tonic-gate		$(NIS) \
957c478bd9Sstevel@tonic-gate		$(RWALL) \
967c478bd9Sstevel@tonic-gate		$(RUSERS) \
977c478bd9Sstevel@tonic-gate		$(SPRAY) \
987c478bd9Sstevel@tonic-gate		$(RSTAT) \
997c478bd9Sstevel@tonic-gate		$(ROOTVAR_NIS)
1007c478bd9Sstevel@tonic-gate
1017c478bd9Sstevel@tonic-gateIBINPROG=		$(BINPROG:%=$(ROOTBIN)/%)
1027c478bd9Sstevel@tonic-gateISBINPROG=		$(SBINPROG:%=$(ROOTUSRSBIN)/%)
1037c478bd9Sstevel@tonic-gateIWPROG=			$(WPROG:%=$(RWALL)/%)
1047c478bd9Sstevel@tonic-gateISPROG=			$(SPROG:%=$(SPRAY)/%)
1057c478bd9Sstevel@tonic-gateIRPROG=			$(RPROG:%=$(RUSERS)/%)
1067c478bd9Sstevel@tonic-gateITPROG=			$(TPROG:%=$(RSTAT)/%)
1077c478bd9Sstevel@tonic-gateIETCFILES=		$(ETCFILES:%=$(ROOTETC)/%)
1087c478bd9Sstevel@tonic-gate
1097c478bd9Sstevel@tonic-gate# non-default file attributes
1107c478bd9Sstevel@tonic-gate$(ROOTDIRS) :=					OWNER=		root
1117c478bd9Sstevel@tonic-gate$(ROOTDIRS) :=					GROUP=		sys
1127c478bd9Sstevel@tonic-gate
1137c478bd9Sstevel@tonic-gate$(ROOTETC)/rpc :=				FILEMODE=	0644
1147c478bd9Sstevel@tonic-gate$(ROOTETC)/rpc :=				OWNER=		root
1157c478bd9Sstevel@tonic-gate$(ROOTETC)/rpc :=				GROUP=		sys
1167c478bd9Sstevel@tonic-gate
1177c478bd9Sstevel@tonic-gateall:=		TARGET= all
1187c478bd9Sstevel@tonic-gateinstall:=	TARGET= install
1197c478bd9Sstevel@tonic-gateclean:=		TARGET= clean
1207c478bd9Sstevel@tonic-gateclobber:=	TARGET= clobber
1217c478bd9Sstevel@tonic-gatelint:=		TARGET= lint
1227c478bd9Sstevel@tonic-gate
1237c478bd9Sstevel@tonic-gaterpc.rstatd:=	LDLIBS += -lkstat
1247c478bd9Sstevel@tonic-gaterwall:=		CPPFLAGS += -D_REENTRANT
1257c478bd9Sstevel@tonic-gaterpc.rwalld:=	CPPFLAGS += -D_REENTRANT
1267c478bd9Sstevel@tonic-gate
1277c478bd9Sstevel@tonic-gate# install rules
1287c478bd9Sstevel@tonic-gate
1297c478bd9Sstevel@tonic-gate$(RWALL)/% $(SPRAY)/% $(RUSERS)/% $(RSTAT)/%: %
1307c478bd9Sstevel@tonic-gate	$(INS.file)
1317c478bd9Sstevel@tonic-gate
1327c478bd9Sstevel@tonic-gate$(ROOTETC)/%: ./net_files/%
1337c478bd9Sstevel@tonic-gate	$(INS.file)
1347c478bd9Sstevel@tonic-gate
1357c478bd9Sstevel@tonic-gate.KEEP_STATE:
1367c478bd9Sstevel@tonic-gate
1377c478bd9Sstevel@tonic-gateall: $(PROG) $(TXTS) $(SUBDIRS)
1387c478bd9Sstevel@tonic-gate
1397c478bd9Sstevel@tonic-gate# multi-object targets
1407c478bd9Sstevel@tonic-gate#
1417c478bd9Sstevel@tonic-gatespray:	$(SCLNTOBJS)
1427c478bd9Sstevel@tonic-gate	$(LINK.c) $(SCLNTOBJS) -o $@ $(LDLIBS)
1437c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1447c478bd9Sstevel@tonic-gate
1457c478bd9Sstevel@tonic-gatespray_svc.o spray_clnt.o: spray.h
1467c478bd9Sstevel@tonic-gate
1477c478bd9Sstevel@tonic-gaterpc.sprayd: $(SSVCOBJS)
1487c478bd9Sstevel@tonic-gate	$(LINK.c) $(SSVCOBJS) -o $@ $(LDLIBS)
1497c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1507c478bd9Sstevel@tonic-gate
1517c478bd9Sstevel@tonic-gaterwall_svc.o rwall_clnt.o: rwall.h
1527c478bd9Sstevel@tonic-gate
1537c478bd9Sstevel@tonic-gaterwall: $(WCLNTOBJS)
1547c478bd9Sstevel@tonic-gate	$(LINK.c) $(WCLNTOBJS) -o $@ $(LDLIBS)
1557c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1567c478bd9Sstevel@tonic-gate
1577c478bd9Sstevel@tonic-gaterpc.rwalld: $(WSVCOBJS)
1587c478bd9Sstevel@tonic-gate	$(LINK.c) $(WSVCOBJS) -o $@ $(LDLIBS)
1597c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1607c478bd9Sstevel@tonic-gate
1617c478bd9Sstevel@tonic-gaterstat_main.o:	rstat.h rstat_v2.h
1627c478bd9Sstevel@tonic-gate
1637c478bd9Sstevel@tonic-gaterstat_svc.o: rstat.h
1647c478bd9Sstevel@tonic-gate
1657c478bd9Sstevel@tonic-gaterstat_V2_svc.o rstat_V2_xdr.o: rstat_v2.h
1667c478bd9Sstevel@tonic-gate
1677c478bd9Sstevel@tonic-gaterpc.rstatd: $(TSVCOBJS)
1687c478bd9Sstevel@tonic-gate	$(LINK.c) $(TSVCOBJS) -o $@ $(LDLIBS)
1697c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1707c478bd9Sstevel@tonic-gate
1717c478bd9Sstevel@tonic-gateinstall: $(PROG) $(TXTS) .WAIT $(ROOTDIRS) .WAIT $(IBINPROG) $(ISBINPROG) \
1727c478bd9Sstevel@tonic-gate	$(IWPROG) $(ISPROG) $(IRPROG) $(ITPROG) $(IETCFILES) $(SUBDIRS) \
1737c478bd9Sstevel@tonic-gate	$(ROOTMANIFEST) $(ROOTSVCMETHOD)
1747c478bd9Sstevel@tonic-gate
1757c478bd9Sstevel@tonic-gate$(ROOTDIRS):
1767c478bd9Sstevel@tonic-gate	$(INS.dir)
1777c478bd9Sstevel@tonic-gate
1787c478bd9Sstevel@tonic-gate$(SUBDIRS): FRC
1797c478bd9Sstevel@tonic-gate	@cd $@; pwd; $(MAKE) $(TARGET)
1807c478bd9Sstevel@tonic-gate
1817c478bd9Sstevel@tonic-gate#
1827c478bd9Sstevel@tonic-gate# Derived files
1837c478bd9Sstevel@tonic-gate#
1847c478bd9Sstevel@tonic-gate
1857c478bd9Sstevel@tonic-gaterstat.x: $(PROTOCOL_DIR)/rstat.x
1867c478bd9Sstevel@tonic-gate	$(RM) rstat.x
1877c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/rstat.x rstat.x
1887c478bd9Sstevel@tonic-gate
1897c478bd9Sstevel@tonic-gaterstat.h: $(PROTOCOL_DIR)/rstat.h
1907c478bd9Sstevel@tonic-gate	$(RM) rstat.h
1917c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/rstat.h rstat.h
1927c478bd9Sstevel@tonic-gate
1937c478bd9Sstevel@tonic-gaterstat_svc.c: rstat.x
1947c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -m rstat.x > $@
1957c478bd9Sstevel@tonic-gate
1967c478bd9Sstevel@tonic-gaterstat_v2.h: rstat_v2.x
1977c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -h rstat_v2.x > $@
1987c478bd9Sstevel@tonic-gate
1997c478bd9Sstevel@tonic-gaterstat_v2_svc.c: rstat_v2.x
2007c478bd9Sstevel@tonic-gate	$(RPCGEN) -C -m rstat_v2.x > $@
2017c478bd9Sstevel@tonic-gate
2027c478bd9Sstevel@tonic-gaterstat_v2_xdr.c: rstat_v2.x
2037c478bd9Sstevel@tonic-gate	$(RPCGEN) -c rstat_v2.x > $@
2047c478bd9Sstevel@tonic-gate
2057c478bd9Sstevel@tonic-gatespray.x: $(PROTOCOL_DIR)/spray.x
2067c478bd9Sstevel@tonic-gate	$(RM) spray.x
2077c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/spray.x spray.x
2087c478bd9Sstevel@tonic-gate
2097c478bd9Sstevel@tonic-gatespray.h: $(PROTOCOL_DIR)/spray.h
2107c478bd9Sstevel@tonic-gate	$(RM) spray.h
2117c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/spray.h spray.h
2127c478bd9Sstevel@tonic-gate
2137c478bd9Sstevel@tonic-gatespray_svc.c: spray.x
2147c478bd9Sstevel@tonic-gate	$(RPCGEN) -s datagram_v -s circuit_v spray.x > $@
2157c478bd9Sstevel@tonic-gate
2167c478bd9Sstevel@tonic-gatespray_clnt.c: spray.x
2177c478bd9Sstevel@tonic-gate	$(RPCGEN) -l spray.x > $@
2187c478bd9Sstevel@tonic-gate
2197c478bd9Sstevel@tonic-gaterwall.x: $(PROTOCOL_DIR)/rwall.x
2207c478bd9Sstevel@tonic-gate	$(RM) rwall.x
2217c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/rwall.x rwall.x
2227c478bd9Sstevel@tonic-gate
2237c478bd9Sstevel@tonic-gaterwall.h: $(PROTOCOL_DIR)/rwall.h
2247c478bd9Sstevel@tonic-gate	$(RM) rwall.h
2257c478bd9Sstevel@tonic-gate	$(CP) $(PROTOCOL_DIR)/rwall.h rwall.h
2267c478bd9Sstevel@tonic-gate
2277c478bd9Sstevel@tonic-gaterwall_svc.c: rwall.x
2287c478bd9Sstevel@tonic-gate	$(RPCGEN) -A -s datagram_v rwall.x > $@
2297c478bd9Sstevel@tonic-gate
2307c478bd9Sstevel@tonic-gaterwall_clnt.c: rwall.x
2317c478bd9Sstevel@tonic-gate	$(RPCGEN) -l -M rwall.x > $@
2327c478bd9Sstevel@tonic-gate
2337c478bd9Sstevel@tonic-gatecheck:	$(CHKMANIFEST)
2347c478bd9Sstevel@tonic-gate
2357c478bd9Sstevel@tonic-gateclean: $(SUBDIRS)
2367c478bd9Sstevel@tonic-gate	-$(RM) $(OBJS) $(DERIVED_FILES)
2377c478bd9Sstevel@tonic-gate
238*a192e900Samaguireclobber: $(SUBDIRS)
2397c478bd9Sstevel@tonic-gate
2407c478bd9Sstevel@tonic-gatelint:
2417c478bd9Sstevel@tonic-gate	$(LINT.c) $(WCLNTOBJS:%.o=%.c) -lnsl -lrpcsvc
2427c478bd9Sstevel@tonic-gate	$(LINT.c) $(WSVCOBJS:%.o=%.c) -lnsl -lrpcsvc
2437c478bd9Sstevel@tonic-gate	$(LINT.c) rusers.c -lnsl -lrpcsvc
2447c478bd9Sstevel@tonic-gate
2457c478bd9Sstevel@tonic-gateFRC:
246*a192e900Samaguire
247*a192e900Samaguireinclude ../Makefile.targ
248