Makefile revision 24fe0b3bf671e123467ce1df0b67cadd3614c8e4
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync# CDDL HEADER START
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync# The contents of this file are subject to the terms of the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync# Common Development and Distribution License (the "License").
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync# You may not use this file except in compliance with the License.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync# or http://www.opensolaris.org/os/licensing.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync# See the License for the specific language governing permissions
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync# and limitations under the License.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync# When distributing Covered Code, include this CDDL HEADER in each
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync# If applicable, add the following below this CDDL HEADER, with the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync# fields enclosed by brackets "[]" replaced with your own identifying
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync# information: Portions Copyright [yyyy] [name of copyright owner]
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync# CDDL HEADER END
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync# Use is subject to license terms.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync# cmd/rpcsvc/Makefile
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncPROTOCOL_DIR= $(ROOT)/usr/include/rpcsvc
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncBINPROG= rusers rup
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncSBINPROG= rwall spray
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncRPROG= rpc.rusersd
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncSPROG= rpc.sprayd
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncWPROG= rpc.rwalld
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncTPROG= rpc.rstatd
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncPROG= $(BINPROG) $(SBINPROG) $(RPROG) $(SPROG) $(WPROG) $(TPROG)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncMANIFEST= \
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync nisplus.xml \
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rusers.xml \
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync spray.xml \
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync wall.xml \
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rstat.xml
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncSVCMETHOD= \
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync nisplus
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncSCLNTOBJS= spray.o spray_clnt.o
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncSSVCOBJS= spray_subr.o spray_svc.o
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncWCLNTOBJS = rwall.o rwall_clnt.o
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncWSVCOBJS= rwall_subr.o rwall_svc.o
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncTSVCOBJS= rstat_main.o rstat_proc.o rstat_svc.o rstat_v2_svc.o rstat_v2_xdr.o
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncDERIVED_FILES = rstat.x rstat.h rstat_svc.c rstat_v2.h rstat_v2_svc.c \
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rstat_v2_xdr.c spray.x spray.h spray_clnt.c spray_svc.c \
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync rwall.x rwall.h rwall_svc.c rwall_clnt.c
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncinclude ../Makefile.cmd
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncROOTMANIFESTDIR= $(ROOTSVCNETWORKRPC)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncCPPFLAGS= -I. $(CPPFLAGS.master)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncLDLIBS += -lnsl
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncrusers := CFLAGS += -v
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync$(BINPROG) := LDLIBS += -lrpcsvc
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync$(RPROG) := LDLIBS += -lrpcsvc
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync$(SPROG) := LDLIBS += -lrpcsvc
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync$(TPROG) := LDLIBS += -lrpcsvc
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncspray := LDLIBS += -lrpcsvc
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncSUBDIRS= rpc.bootparamd nis/utils nis/bin nis/cachemgr nis/rpc.nisd \
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync nis/rpc.nispasswdd
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncOBJS= $(SCLNTOBJS) $(SSVCOBJS) $(WCLNTOBJS) $(WSVCOBJS) $(TSVCOBJS)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncSRCS= $(OBJS:%.o=%.c) rusers.c rpc.rusersd.c rup.c
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncETCFILES= rpc
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncTXTS= $(ETCFILES:%=net_files/%)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncNETSVC= $(ROOTLIB)/netsvc
NIS = $(NETSVC)/nis
RWALL= $(NETSVC)/rwall
RUSERS= $(NETSVC)/rusers
SPRAY= $(NETSVC)/spray
RSTAT= $(NETSVC)/rstat
ROOTVAR_NIS= $(ROOT)/var/nis
ROOTDIRS= \
$(NETSVC) \
$(NIS) \
$(RWALL) \
$(RUSERS) \
$(SPRAY) \
$(RSTAT) \
$(ROOTVAR_NIS)
IBINPROG= $(BINPROG:%=$(ROOTBIN)/%)
ISBINPROG= $(SBINPROG:%=$(ROOTUSRSBIN)/%)
IWPROG= $(WPROG:%=$(RWALL)/%)
ISPROG= $(SPROG:%=$(SPRAY)/%)
IRPROG= $(RPROG:%=$(RUSERS)/%)
ITPROG= $(TPROG:%=$(RSTAT)/%)
IETCFILES= $(ETCFILES:%=$(ROOTETC)/%)
# non-default file attributes
$(ROOTETC)/rpc := FILEMODE= 0644
all:= TARGET= all
install:= TARGET= install
clean:= TARGET= clean
clobber:= TARGET= clobber
lint:= TARGET= lint
rpc.rstatd:= LDLIBS += -lkstat
rwall:= CPPFLAGS += -D_REENTRANT
rpc.rwalld:= CPPFLAGS += -D_REENTRANT
# install rules
$(RWALL)/% $(SPRAY)/% $(RUSERS)/% $(RSTAT)/%: %
$(INS.file)
$(ROOTETC)/%: ./net_files/%
$(INS.file)
.KEEP_STATE:
all: $(PROG) $(TXTS) $(SUBDIRS)
# multi-object targets
#
spray: $(SCLNTOBJS)
$(LINK.c) $(SCLNTOBJS) -o $@ $(LDLIBS)
$(POST_PROCESS)
spray_svc.o spray_clnt.o: spray.h
rpc.sprayd: $(SSVCOBJS)
$(LINK.c) $(SSVCOBJS) -o $@ $(LDLIBS)
$(POST_PROCESS)
rwall_svc.o rwall_clnt.o: rwall.h
rwall: $(WCLNTOBJS)
$(LINK.c) $(WCLNTOBJS) -o $@ $(LDLIBS)
$(POST_PROCESS)
rpc.rwalld: $(WSVCOBJS)
$(LINK.c) $(WSVCOBJS) -o $@ $(LDLIBS)
$(POST_PROCESS)
rstat_main.o: rstat.h rstat_v2.h
rstat_svc.o: rstat.h
rstat_V2_svc.o rstat_V2_xdr.o: rstat_v2.h
rpc.rstatd: $(TSVCOBJS)
$(LINK.c) $(TSVCOBJS) -o $@ $(LDLIBS)
$(POST_PROCESS)
install: $(PROG) $(TXTS) .WAIT $(ROOTDIRS) .WAIT $(IBINPROG) $(ISBINPROG) \
$(IWPROG) $(ISPROG) $(IRPROG) $(ITPROG) $(IETCFILES) $(SUBDIRS) \
$(ROOTMANIFEST) $(ROOTSVCMETHOD)
$(ROOTDIRS):
$(INS.dir)
$(SUBDIRS): FRC
@cd $@; pwd; $(MAKE) $(TARGET)
#
# Derived files
#
rstat.x: $(PROTOCOL_DIR)/rstat.x
$(RM) rstat.x
$(CP) $(PROTOCOL_DIR)/rstat.x rstat.x
rstat.h: $(PROTOCOL_DIR)/rstat.h
$(RM) rstat.h
$(CP) $(PROTOCOL_DIR)/rstat.h rstat.h
rstat_svc.c: rstat.x
$(RPCGEN) -C -m rstat.x > $@
rstat_v2.h: rstat_v2.x
$(RPCGEN) -C -h rstat_v2.x > $@
rstat_v2_svc.c: rstat_v2.x
$(RPCGEN) -C -m rstat_v2.x > $@
rstat_v2_xdr.c: rstat_v2.x
$(RPCGEN) -c rstat_v2.x > $@
spray.x: $(PROTOCOL_DIR)/spray.x
$(RM) spray.x
$(CP) $(PROTOCOL_DIR)/spray.x spray.x
spray.h: $(PROTOCOL_DIR)/spray.h
$(RM) spray.h
$(CP) $(PROTOCOL_DIR)/spray.h spray.h
spray_svc.c: spray.x
$(RPCGEN) -s datagram_v -s circuit_v spray.x > $@
spray_clnt.c: spray.x
$(RPCGEN) -l spray.x > $@
rwall.x: $(PROTOCOL_DIR)/rwall.x
$(RM) rwall.x
$(CP) $(PROTOCOL_DIR)/rwall.x rwall.x
rwall.h: $(PROTOCOL_DIR)/rwall.h
$(RM) rwall.h
$(CP) $(PROTOCOL_DIR)/rwall.h rwall.h
rwall_svc.c: rwall.x
$(RPCGEN) -A -s datagram_v rwall.x > $@
rwall_clnt.c: rwall.x
$(RPCGEN) -l -M rwall.x > $@
check: $(CHKMANIFEST)
clean: $(SUBDIRS)
-$(RM) $(OBJS) $(DERIVED_FILES)
clobber: $(SUBDIRS)
lint:
$(LINT.c) $(WCLNTOBJS:%.o=%.c) -lnsl -lrpcsvc
$(LINT.c) $(WSVCOBJS:%.o=%.c) -lnsl -lrpcsvc
$(LINT.c) rusers.c -lnsl -lrpcsvc
FRC:
include ../Makefile.targ