Print this page
10080 smatch Makefile changes for usr/src/cmd
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/ypcmd/Makefile
+++ new/usr/src/cmd/ypcmd/Makefile
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License (the "License").
6 6 # You may not use this file except in compliance with the License.
7 7 #
8 8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 # or http://www.opensolaris.org/os/licensing.
10 10 # See the License for the specific language governing permissions
11 11 # and limitations under the License.
12 12 #
13 13 # When distributing Covered Code, include this CDDL HEADER in each
14 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 # If applicable, add the following below this CDDL HEADER, with the
16 16 # fields enclosed by brackets "[]" replaced with your own identifying
17 17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 18 #
19 19 # CDDL HEADER END
20 20 #
21 21 #
22 22 # Copyright 2015 Gary Mills
23 23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 24 # Use is subject to license terms.
25 +# Copyright (c) 2018, Joyent, Inc.
25 26 #
26 27
27 28 BINPROG = ypmatch ypwhich ypcat
28 29 SBINPROG = makedbm ypalias ypinit yppoll ypset
29 30 NETYPPROG = ypbind ypxfr yppush udpublickey mkalias \
30 31 multi multi.awk stdethers stdhosts \
31 32 ypxfr_1perday ypxfr_1perhour ypxfr_2perday \
32 33 ypstart ypstop
33 34 NIS2LDAPPROG = ypxfrd ypserv ypxfr
34 35 SVCMETHOD = yp
35 36 PROG= $(BINPROG) $(SBINPROG) $(NETYPPROG) $(NIS2LDAPPROG) $(SVCMETHOD)
36 37
37 38 MANIFEST = server.xml client.xml xfr.xml
38 39
39 40 # These only need -lnsl
40 41 LNSLPROG = ypmatch ypwhich ypcat yppoll ypset \
41 42 ypbind ypxfr yppush mkalias stdhosts
42 43
43 44 include ../Makefile.cmd
44 45
45 46 ROOTMANIFESTDIR = $(ROOTSVCNETWORKNIS)
46 47
47 48 # installed directories
48 49 NETSVC = $(ROOTLIB)/netsvc
49 50 NETYP = $(NETSVC)/yp
50 51
51 52 ROOTVAR_YP = $(ROOT)/var/yp
52 53 ROOTBINDING = $(ROOTVAR_YP)/binding
53 54 ROOTDIRS = $(ROOT) $(ROOTUSR) $(ROOTLIB) $(ROOTETC) $(ROOTVAR) \
54 55 $(NETSVC) $(NETYP) $(ROOTVAR_YP) $(ROOTBINDING) \
55 56 $(ROOTUSRSBIN) $(ROOTBIN)
56 57
57 58 $(LNSLPROG) := LDLIBS += -lnsl
58 59 $(NIS2LDAPPROG) := LDLIBS += -lc -lnsl -lnisdb
59 60 stdethers := LDLIBS += -lsocket
60 61 makedbm := MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
61 62 makedbm := LDFLAGS += $(MAPFILES:%=-M%)
62 63
63 64 $(ROOTVAR_YP)/aliases := FILEMODE=555
64 65
65 66 YPFILES = Makefile aliases nicknames updaters
66 67 ETCFILES = publickey
67 68 ROOTYPFILES= $(YPFILES:%=$(ROOTVAR_YP)/%)
68 69 ROOTETCFILE= $(ETCFILES:%=$(ROOTETC)/%)
69 70
70 71 TXTS= $(ETCFILES:%=net_files/%) $(YPFILES:%=net_files/%)
71 72 SUBDIRS = yppasswd mknetid revnetgroup ypupdated yp2lscripts
72 73
73 74 YPBINDOBJ= yp_b_svc.o yp_b_subr.o rpc_bootstrap.o getlist.o
74 75 #
75 76 # Some sort of obsolete idea of common files which are only now used by a
76 77 # few minor utilities
77 78 #
78 79 COMMONOBJ= getlist.o yp_getalias.o
79 80
80 81 #
81 82 # Objects shared between all the major components
82 83 #
83 84 SHARED_DIR= ./shared
84 85 SHAREDOBJ= $(SHARED_DIR)/utils.o $(SHARED_DIR)/lockmap.o $(SHARED_DIR)/ancil.o
85 86 SHARESRC = $(SHAREOBJ:.o=.c)
86 87
87 88 YPXFROBJ = ypxfr.o ypxfrd_client.o ypxfrd_xdr.o
88 89 YPMATOBJ = ypmatch.o nick.o
89 90 YPWHIOBJ = ypwhich.o nick.o
90 91 YPCATOBJ = ypcat.o nick.o
91 92 UDPUBLICKEYOBJ = udpublickey.o
92 93 MKALIASOBJ = mkalias.o
93 94 STDETHERSOBJ = stdethers.o
94 95 STDHOSTSOBJ = stdhosts.o
95 96 #COMMONCLNTOBJ = clnt_create_rsvd.o
96 97 YPSERVOBJ = ypserv.o ypserv_map.o \
97 98 ypserv_proc.o ypserv_ancil.o \
98 99 ypserv_resolv.o ypserv_resolv_common.o \
99 100 ypv1_xdr.o ypserv_net_secure.o
100 101 YPPUSHOBJ = yppush.o
101 102 YPXFRDOBJ = ypxfrd_svc.o ypxfrd_xdr.o ypxfrd_server.o \
102 103 ypserv_net_secure.o
103 104
104 105 NETYPOBJ = $(YPXFROBJ) $(YPXFRDOBJ) $(YPSERVOBJ) $(YPPUSHOBJ) \
105 106 $(YPBINDOBJ) $(UDPUBLICKEYOBJ)
106 107 OBJS = $(NETYPOBJ) $(MKALIASOBJ) $(COMMONOBJ) $(SHAREDOBJ) \
107 108 $(YPPUSHOBJ) $(YPMATOBJ) $(YPWHIOBJ) $(YPCATOBJ) \
108 109 $(STDETHERSOBJ) $(STDHOSTSOBJ) makedbm.o ypalias.o pong.o
109 110
110 111 BINSRC = $(BINPROG:=.c)
111 112
112 113 SBINSRC = $(SBINPROG:=.c)
113 114
114 115 NETYPSRC = $(NETYPOBJ:.o=.c)
115 116
116 117 YPBINDSRC = $(YPBINSOBJ:.o=.c)
117 118
118 119 YPXFRSRC = $(YPXFROBJ:.o=.c)
119 120
120 121 YPSERVSRC = $(YPSERVOBJ:.o=.c)
121 122
122 123 YPPUSHSRC = $(YPPUSHOBJ:.o=.c)
123 124
124 125 YPXFRDSRC = $(YPXFRDOBJ:.o=.c)
125 126
126 127 YPMASTERSRC = $(YPMASTEROBJ:.o=.c)
127 128
128 129 YPALLSRC = $(YPALLOBJ:.o=.c)
129 130
130 131 COMMONSRC = $(COMMONOBJ:.o=.c)
131 132
132 133 #COMMONCLNTSRC = $(COMMONCLNTOBJ:.o=.c)
133 134
134 135 SRCS = $(BINSRC) $(SBINSRC) $(NETYPSRC) \
135 136 $(COMMONSRC) $(SHAREDSRC)
136 137
137 138 CLEANFILES = ypxfrd.h ypxfrd_xdr.c
138 139
139 140 IBINPROG= $(BINPROG:%=$(ROOTBIN)/%)
140 141 ISBINPROG= $(SBINPROG:%=$(ROOTUSRSBIN)/%)
141 142 INETYPPROG= $(NETYPPROG:%=$(NETYP)/%)
142 143 INIS2LDAPPROG = $(NIS2LDAPPROG:%=$(NETYP)/%)
143 144
144 145 NIS2LDAPINC = -I$(SRC)/lib/libnisdb/yptol
145 146
↓ open down ↓ |
111 lines elided |
↑ open up ↑ |
146 147 CERRWARN += -_gcc=-Wno-implicit-function-declaration
147 148 CERRWARN += -_gcc=-Wno-parentheses
148 149 CERRWARN += -_gcc=-Wno-unused-variable
149 150 CERRWARN += -_gcc=-Wno-uninitialized
150 151 CERRWARN += -_gcc=-Wno-switch
151 152 CERRWARN += -_gcc=-Wno-extra
152 153 CERRWARN += -_gcc=-Wno-unused-label
153 154 CERRWARN += -_gcc=-Wno-address
154 155 CERRWARN += -_gcc=-Wno-unused-function
155 156
157 +# too many unknown types
158 +SMATCH = off
159 +
156 160 #conditional assignments
157 161 ypalias.o := CPPFLAGS= -DMAIN $(CPPFLAGS.master)
158 162 makedbm.o := CPPFLAGS= $(CPPFLAGS.master)
159 163 yp_b_svc.o := CPPFLAGS += -DINIT_DEFAULT
160 164 ypxfrd_svc.o := CPPFLAGS += -Dmain=_main
161 165 ypxfr.o := CPPFLAGS += $(NIS2LDAPINC)
162 166 yppush.o := CPPFLAGS += $(NIS2LDAPINC)
163 167 $(NIS2LDAPPROG) := CPPFLAGS += $(NIS2LDAPINC)
164 168 $(SHAREDOBJ) := CPPFLAGS += -I$(SRC)/lib/libnisdb/yptol
165 169 $(ROOTVAR_YP)/Makefile := FILEMODE= 555
166 170 $(ROOTVAR_YP)/nicknames := FILEMODE= 644
167 171 $(ROOTVAR_YP)/updaters := FILEMODE= 500
168 172 $(ROOTETC)/publickey := FILEMODE= 644
169 173 # non-default file attributes to avoid conflict with rpcsrc
170 174 NETYP = $(NETSVC)/yp
171 175
172 176
173 177 all:= TARGET= all
174 178 install:= TARGET= install
175 179 clean:= TARGET= clean
176 180 clobber:= TARGET= clobber
177 181 lint:= TARGET= lint
178 182 cstyle := TARGET= cstyle
179 183
180 184 all: $(SHAREDOBJ) $(SUBDIRS) $(PROG) $(TXTS)
181 185
182 186 # install rules
183 187 $(ROOTVAR_YP)/% \
184 188 $(ROOTETC)/%: net_files/%
185 189 $(INS.file)
186 190
187 191 $(ROOTVAR_YP)/% : net_files/%
188 192 $(INS.file)
189 193
190 194 $(NETYP)/%: %
191 195 $(INS.file)
192 196
193 197 .KEEP_STATE:
194 198
195 199 $(SHAREDOBJ): $(SHAREDSRC)
196 200 $(COMPILE.c) $(SHAREDSRC) -o $@ $<
197 201
198 202 ypbind: $(YPBINDOBJ)
199 203 $(LINK.c) $(YPBINDOBJ) -o $@ $(LDLIBS)
200 204 $(POST_PROCESS)
201 205
202 206 makedbm ypalias: $$@.o $(COMMONOBJ) $$(MAPFILES)
203 207 $(LINK.c) -o $@ $@.o $(COMMONOBJ) $(LDLIBS)
204 208 $(POST_PROCESS)
205 209
206 210 ypmatch: $(YPMATOBJ)
207 211 $(LINK.c) -o $@ $(YPMATOBJ) $(LDLIBS)
208 212 $(POST_PROCESS)
209 213
210 214 ypwhich: $(YPWHIOBJ)
211 215 $(LINK.c) -o $@ $(YPWHIOBJ) $(LDLIBS)
212 216 $(POST_PROCESS)
213 217
214 218 ypcat: $(YPCATOBJ)
215 219 $(LINK.c) -o $@ $(YPCATOBJ) $(LDLIBS)
216 220 $(POST_PROCESS)
217 221
218 222 ypxfrd_xdr.c: ypxfrd.x
219 223 $(RM) ypxfrd_xdr.c; $(RPCGEN) -C -c ypxfrd.x -o ypxfrd_xdr.c
220 224
221 225 ypxfrd.h: ypxfrd.x
222 226 $(RM) ypxfrd.h; $(RPCGEN) -C -h ypxfrd.x -o ypxfrd.h
223 227
224 228 ypxfrd_xdr.o ypxfrd_client.o: ypxfrd.h
225 229
226 230 #clnt_create_rsvd.o ypxfr.o: clnt_create_rsvd.h
227 231
228 232 ypxfrd: $(YPXFRDOBJ) $(SHAREDOBJ)
229 233 $(LINK.cc) $(YPXFRDOBJ) $(SHAREDOBJ) \
230 234 -o $@ $(LDLIBS) -lc
231 235 $(POST_PROCESS)
232 236
233 237 ypxfr: $(YPXFROBJ) $(COMMONOBJ) $(YPMASTEROBJ) $(SHAREDOBJ)
234 238 $(LINK.cc) -o $@ $(YPXFROBJ) $(YPMASTEROBJ) $(COMMONOBJ) \
235 239 $(SHAREDOBJ) $(LDLIBS)
236 240 $(POST_PROCESS)
237 241
238 242 ypserv: $(YPSERVOBJ) $(COMMONOBJ) $(SHAREDOBJ)
239 243 $(LINK.cc) $(YPSERVOBJ) $(COMMONOBJ) \
240 244 $(SHAREDOBJ) -o $@ $(LDLIBS)
241 245 $(POST_PROCESS)
242 246
243 247 yppush: $(YPPUSHOBJ) $(COMMONOBJ)
244 248 $(LINK.c) $(YPPUSHOBJ) $(COMMONOBJ) -o $@ $(LDLIBS)
245 249 $(POST_PROCESS)
246 250
247 251 udpublickey: $(UDPUBLICKEYOBJ)
248 252 $(LINK.c) $(UDPUBLICKEYOBJ) -o $@ $(LDLIBS)
249 253 $(POST_PROCESS)
250 254
251 255 mkalias: $(MKALIASOBJ)
252 256 $(LINK.c) $(MKALIASOBJ) -o $@ $(LDLIBS)
253 257 $(POST_PROCESS)
254 258
255 259 stdethers: $(STDETHERSOBJ)
256 260 $(LINK.c) $(STDETHERSOBJ) -o $@ $(LDLIBS)
257 261 $(POST_PROCESS)
258 262
259 263 stdhosts: $(STDHOSTSOBJ)
260 264 $(LINK.c) $(STDHOSTSOBJ) -o $@ $(LDLIBS)
261 265 $(POST_PROCESS)
262 266
263 267 install: all $(PROG) $(ROOTDIRS) $(ROOTETCFILE) $(ROOTYPFILES) $(IBINPROG) \
264 268 $(ISBINPROG) $(INETYPPROG) $(INIS2LDAPPROG) $(SUBDIRS) $(ROOTMANIFEST) \
265 269 $(ROOTSVCMETHOD)
266 270
267 271 $(ROOTDIRS):
268 272 $(INS.dir)
269 273
270 274 $(SUBDIRS): FRC
271 275 @cd $@; pwd; $(MAKE) $(TARGET)
272 276
273 277 lint := CPPFLAGS += -I$(SRC)/lib/libnisdb/yptol
274 278
275 279 lint: $(SUBDIRS)
276 280 $(LINT.c) ypmatch.c nick.c -lnsl
277 281 $(LINT.c) ypwhich.c nick.c -lnsl
278 282 $(LINT.c) ypcat.c nick.c -lnsl
279 283 $(LINT.c) makedbm.c getlist.c yp_getalias.c
280 284 $(LINT.c) ypalias.c getlist.c yp_getalias.c
281 285 $(LINT.c) yp_b_svc.c yp_b_subr.c rpc_bootstrap.c getlist.c -lnsl
282 286 $(LINT.c) ypxfr.c ypxfrd_client.c ypxfrd_xdr.c getlist.c yp_getalias.c \
283 287 ./shared/utils.c ./shared/lockmap.c ./shared/ancil.c -lnsl
284 288 $(LINT.c) yppush.c getlist.c yp_getalias.c -lnsl
285 289 $(LINT.c) udpublickey.c
286 290 $(LINT.c) mkalias.c -lnsl
287 291 $(LINT.c) stdethers.c -lsocket
288 292 $(LINT.c) stdhosts.c -lnsl
289 293 $(LINT.c) ypxfrd_svc.c ypxfrd_xdr.c ypxfrd_server.c \
290 294 ypserv_net_secure.c \
291 295 ./shared/utils.c ./shared/lockmap.c ./shared/ancil.c \
292 296 -lnsl -lnisdb
293 297 $(LINT.c) ypserv.c ypserv_map.c ypserv_proc.c ypserv_ancil.c \
294 298 ypserv_resolv.c ypserv_resolv_common.c ypv1_xdr.c \
295 299 ypserv_net_secure.c getlist.c yp_getalias.c \
296 300 ./shared/utils.c ./shared/lockmap.c ./shared/ancil.c \
297 301 -lnsl -lnisdb
298 302
299 303 check: $(CHKMANIFEST)
300 304
301 305 cstyle: $(SUBDIRS)
302 306 ${CSTYLE} `echo $(SRCS) | sed 's/ypinit.c//'`
303 307
304 308 clean: $(SUBDIRS)
305 309 $(RM) $(OBJS) $(CLEANFILES)
306 310
307 311 clobber: clean $(SUBDIRS)
308 312
309 313 FRC:
310 314
311 315 include ../Makefile.targ
↓ open down ↓ |
146 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX