move 32-bit libs to lib/i386 subdirs & 64-bit libs to lib/
[unleashed.git] / usr / src / cmd / rpcsvc / Makefile
blob27097988d6feb9a27008326b23c39ed1a74f5ca4
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
25 # Copyright (c) 2018, Joyent, Inc.
27 PROTOCOL_DIR= $(ROOT)/usr/include/rpcsvc
29 BINPROG= rusers rup
30 SBINPROG= rwall spray
31 RPROG= rpc.rusersd
32 SPROG= rpc.sprayd
33 WPROG= rpc.rwalld
34 TPROG= rpc.rstatd
36 PROG= $(BINPROG) $(SBINPROG) $(RPROG) $(SPROG) $(WPROG) $(TPROG)
38 MANIFEST= \
39 rusers.xml \
40 spray.xml \
41 wall.xml \
42 rstat.xml
44 SVCMETHOD=
46 SCLNTOBJS= spray.o spray_clnt.o
47 SSVCOBJS= spray_subr.o spray_svc.o
48 WCLNTOBJS = rwall.o rwall_clnt.o
49 WSVCOBJS= rwall_subr.o rwall_svc.o
50 TSVCOBJS= rstat_main.o rstat_proc.o rstat_svc.o rstat_v2_svc.o rstat_v2_xdr.o
52 DERIVED_FILES = rstat.x rstat.h rstat_svc.c rstat_v2.h rstat_v2_svc.c \
53 rstat_v2_xdr.c spray.x spray.h spray_clnt.c spray_svc.c \
54 rwall.x rwall.h rwall_svc.c rwall_clnt.c
56 include ../Makefile.cmd
58 ROOTMANIFESTDIR= $(ROOTSVCNETWORKRPC)
60 CPPFLAGS= -I. $(CPPFLAGS.master)
61 CERRWARN += -Wno-implicit-function-declaration
62 CERRWARN += -Wno-unused-variable
63 CERRWARN += -Wno-parentheses
64 CERRWARN += -Wno-extra
65 CERRWARN += -Wno-unused-function
67 # not linted
68 SMATCH=off
70 $(BINPROG) := LDLIBS += -lrpcsvc
71 $(RPROG) := LDLIBS += -lrpcsvc
72 $(SPROG) := LDLIBS += -lrpcsvc
73 $(TPROG) := LDLIBS += -lrpcsvc
74 spray := LDLIBS += -lrpcsvc
77 SUBDIRS= rpc.bootparamd
78 OBJS= $(SCLNTOBJS) $(SSVCOBJS) $(WCLNTOBJS) $(WSVCOBJS) $(TSVCOBJS)
79 SRCS= $(OBJS:%.o=%.c) rusers.c rpc.rusersd.c rup.c
81 ETCFILES= rpc
83 TXTS= $(ETCFILES:%=net_files/%)
85 NETSVC= $(ROOTLIB64)/netsvc
86 NIS = $(NETSVC)/nis
87 RWALL= $(NETSVC)/rwall
88 RUSERS= $(NETSVC)/rusers
89 SPRAY= $(NETSVC)/spray
90 RSTAT= $(NETSVC)/rstat
92 ROOTDIRS= \
93 $(NETSVC) \
94 $(NIS) \
95 $(RWALL) \
96 $(RUSERS) \
97 $(SPRAY) \
98 $(RSTAT)
100 IBINPROG= $(BINPROG:%=$(ROOTBIN)/%)
101 ISBINPROG= $(SBINPROG:%=$(ROOTUSRSBIN)/%)
102 IWPROG= $(WPROG:%=$(RWALL)/%)
103 ISPROG= $(SPROG:%=$(SPRAY)/%)
104 IRPROG= $(RPROG:%=$(RUSERS)/%)
105 ITPROG= $(TPROG:%=$(RSTAT)/%)
106 IETCFILES= $(ETCFILES:%=$(ROOTETC)/%)
108 # non-default file attributes
109 $(ROOTETC)/rpc := FILEMODE= 0644
111 all:= TARGET= all
112 install:= TARGET= install
113 clean:= TARGET= clean
114 clobber:= TARGET= clobber
116 rpc.rstatd:= LDLIBS += -lkstat
118 # install rules
120 $(RWALL)/% $(SPRAY)/% $(RUSERS)/% $(RSTAT)/%: %
121 $(INS.file)
123 $(ROOTETC)/%: ./net_files/%
124 $(INS.file)
126 .KEEP_STATE:
128 all: $(PROG) $(TXTS) $(SUBDIRS)
130 # multi-object targets
132 spray: $(SCLNTOBJS)
133 $(LINK.c) $(SCLNTOBJS) -o $@ $(LDLIBS)
134 $(POST_PROCESS)
136 spray_svc.o spray_clnt.o: spray.h
138 rpc.sprayd: $(SSVCOBJS)
139 $(LINK.c) $(SSVCOBJS) -o $@ $(LDLIBS)
140 $(POST_PROCESS)
142 rwall_svc.o rwall_clnt.o: rwall.h
144 rwall: $(WCLNTOBJS)
145 $(LINK.c) $(WCLNTOBJS) -o $@ $(LDLIBS)
146 $(POST_PROCESS)
148 rpc.rwalld: $(WSVCOBJS)
149 $(LINK.c) $(WSVCOBJS) -o $@ $(LDLIBS)
150 $(POST_PROCESS)
152 rstat_main.o: rstat.h rstat_v2.h
154 rstat_svc.o: rstat.h
156 rstat_V2_svc.o rstat_V2_xdr.o: rstat_v2.h
158 rpc.rstatd: $(TSVCOBJS)
159 $(LINK.c) $(TSVCOBJS) -o $@ $(LDLIBS)
160 $(POST_PROCESS)
162 install: $(PROG) $(TXTS) .WAIT $(ROOTDIRS) .WAIT $(IBINPROG) $(ISBINPROG) \
163 $(IWPROG) $(ISPROG) $(IRPROG) $(ITPROG) $(IETCFILES) $(SUBDIRS) \
164 $(ROOTMANIFEST) $(ROOTSVCMETHOD)
166 $(ROOTDIRS):
167 $(INS.dir)
169 $(SUBDIRS): FRC
170 @cd $@; pwd; $(MAKE) $(TARGET)
173 # Derived files
176 rstat.x: $(PROTOCOL_DIR)/rstat.x
177 $(RM) rstat.x
178 $(CP) $(PROTOCOL_DIR)/rstat.x rstat.x
180 rstat.h: $(PROTOCOL_DIR)/rstat.h
181 $(RM) rstat.h
182 $(CP) $(PROTOCOL_DIR)/rstat.h rstat.h
184 rstat_svc.c: rstat.x
185 $(RPCGEN) -C -m rstat.x > $@
187 rstat_v2.h: rstat_v2.x
188 $(RPCGEN) -C -h rstat_v2.x > $@
190 rstat_v2_svc.c: rstat_v2.x
191 $(RPCGEN) -C -m rstat_v2.x > $@
193 rstat_v2_xdr.c: rstat_v2.x
194 $(RPCGEN) -c rstat_v2.x > $@
196 spray.x: $(PROTOCOL_DIR)/spray.x
197 $(RM) spray.x
198 $(CP) $(PROTOCOL_DIR)/spray.x spray.x
200 spray.h: $(PROTOCOL_DIR)/spray.h
201 $(RM) spray.h
202 $(CP) $(PROTOCOL_DIR)/spray.h spray.h
204 spray_svc.c: spray.x
205 $(RPCGEN) -s datagram_v -s circuit_v spray.x > $@
207 spray_clnt.c: spray.x
208 $(RPCGEN) -l spray.x > $@
210 rwall.x: $(PROTOCOL_DIR)/rwall.x
211 $(RM) rwall.x
212 $(CP) $(PROTOCOL_DIR)/rwall.x rwall.x
214 rwall.h: $(PROTOCOL_DIR)/rwall.h
215 $(RM) rwall.h
216 $(CP) $(PROTOCOL_DIR)/rwall.h rwall.h
218 rwall_svc.c: rwall.x
219 $(RPCGEN) -A -s datagram_v rwall.x > $@
221 rwall_clnt.c: rwall.x
222 $(RPCGEN) -l -M rwall.x > $@
224 check: $(CHKMANIFEST)
226 clean: $(SUBDIRS)
227 -$(RM) $(OBJS) $(DERIVED_FILES)
229 clobber: $(SUBDIRS)
231 FRC:
233 include ../Makefile.targ