Print this page
XXX Remove nawk(1)
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/head/Makefile
+++ new/usr/src/head/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.
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 2010 Sun Microsystems, Inc. All rights reserved.
23 23 # Use is subject to license terms.
24 24 #
25 25 # head/Makefile
26 26 #
27 27 # include global definitions
28 28 include ../Makefile.master
29 29
30 30 sparc_HDRS=
31 31 i386_HDRS= stack_unwind.h
32 32
33 33 # Headers are listed one per line so that TeamWare can auto-merge most changes
34 34
35 35 KRB5HDRS= mit_copyright.h mit-sipb-copyright.h
36 36
37 37 ATTRDB_HDRS= secdb.h auth_attr.h exec_attr.h prof_attr.h user_attr.h \
38 38 auth_list.h
39 39
40 40 HDRS= $($(MACH)_HDRS) $(ATTRDB_HDRS) \
41 41 aio.h \
42 42 alloca.h \
43 43 apptrace.h \
44 44 apptrace_impl.h \
45 45 ar.h \
46 46 archives.h \
47 47 assert.h \
48 48 atomic.h \
49 49 attr.h \
50 50 config_admin.h \
51 51 cpio.h \
52 52 crypt.h \
53 53 ctype.h \
54 54 deflt.h \
55 55 devid.h \
56 56 devmgmt.h \
57 57 devpoll.h \
58 58 dial.h \
59 59 dirent.h \
60 60 dlfcn.h \
61 61 door.h \
62 62 elf.h \
63 63 err.h \
64 64 errno.h \
65 65 euc.h \
66 66 exacct.h \
67 67 exacct_impl.h \
68 68 execinfo.h \
69 69 fatal.h \
70 70 fcntl.h \
71 71 float.h \
72 72 fmtmsg.h \
73 73 fnmatch.h \
74 74 ftw.h \
75 75 gelf.h \
76 76 getopt.h \
77 77 getwidth.h \
78 78 glob.h \
79 79 grp.h \
80 80 iconv.h \
81 81 ieeefp.h \
82 82 ifaddrs.h \
83 83 inttypes.h \
84 84 iso646.h \
85 85 klpd.h \
86 86 langinfo.h \
87 87 lastlog.h \
88 88 lber.h \
89 89 ldap.h \
90 90 libelf.h \
91 91 libgen.h \
92 92 libintl.h \
93 93 libw.h \
94 94 libzonecfg.h \
95 95 limits.h \
96 96 linenum.h \
97 97 link.h \
98 98 listen.h \
99 99 locale.h \
100 100 macros.h \
101 101 malloc.h \
102 102 mdmn_changelog.h \
103 103 memory.h \
104 104 meta.h \
105 105 meta_runtime.h \
106 106 metadyn.h \
107 107 mon.h \
108 108 monetary.h \
109 109 mp.h \
110 110 mqueue.h \
111 111 nan.h \
112 112 ndbm.h \
113 113 ndpd.h \
114 114 netconfig.h \
115 115 netdb.h \
116 116 netdir.h \
117 117 nl_types.h \
118 118 nlist.h \
119 119 note.h \
120 120 nsctl.h \
121 121 nsswitch.h \
122 122 nss_common.h \
123 123 nss_dbdefs.h \
124 124 nss_netdir.h \
125 125 paths.h \
126 126 pcsample.h \
127 127 pfmt.h \
128 128 pkgdev.h \
129 129 pkginfo.h \
130 130 pkglocs.h \
131 131 pkgstrct.h \
132 132 pkgtrans.h \
133 133 poll.h \
134 134 port.h \
135 135 priv.h \
136 136 priv_utils.h \
137 137 proc_service.h \
138 138 procfs.h \
139 139 prof.h \
140 140 project.h \
141 141 pthread.h \
142 142 pw.h \
143 143 pwd.h \
144 144 rctl.h \
145 145 re_comp.h \
146 146 regex.h \
147 147 regexp.h \
148 148 resolv.h \
149 149 rje.h \
150 150 rtld_db.h \
151 151 sac.h \
152 152 sched.h \
153 153 schedctl.h \
154 154 sdssc.h \
155 155 search.h \
156 156 semaphore.h \
157 157 setjmp.h \
158 158 sgtty.h \
159 159 shadow.h \
160 160 siginfo.h \
161 161 signal.h \
162 162 spawn.h \
163 163 stdarg.h \
164 164 stdbool.h \
165 165 stddef.h \
166 166 stdint.h \
167 167 stdio.h \
168 168 stdio_ext.h \
169 169 stdio_tag.h \
170 170 stdio_impl.h \
171 171 stdlib.h \
172 172 storclass.h \
173 173 string.h \
174 174 strings.h \
175 175 stropts.h \
176 176 synch.h \
177 177 sysexits.h \
178 178 syslog.h \
179 179 syms.h \
180 180 tar.h \
181 181 termio.h \
182 182 termios.h \
183 183 thread.h \
184 184 thread_db.h \
185 185 time.h \
186 186 tiuser.h \
187 187 tzfile.h \
188 188 ucontext.h \
189 189 ucred.h \
190 190 ulimit.h \
191 191 unistd.h \
192 192 userdefs.h \
193 193 ustat.h \
194 194 utime.h \
195 195 utmp.h \
196 196 utmpx.h \
197 197 valtools.h \
198 198 values.h \
199 199 varargs.h \
200 200 wait.h \
201 201 wchar.h \
202 202 wchar_impl.h \
203 203 wctype.h \
204 204 widec.h \
205 205 wordexp.h \
206 206 xti.h \
207 207 xti_inet.h \
208 208 zone.h
209 209
210 210 ISOHDRS = \
211 211 ctype_c99.h \
212 212 ctype_iso.h \
213 213 limits_iso.h \
214 214 locale_iso.h \
215 215 setjmp_iso.h \
216 216 signal_iso.h \
217 217 stdarg_c99.h \
218 218 stdarg_iso.h \
219 219 stddef_iso.h \
220 220 stdio_c99.h \
221 221 stdio_iso.h \
222 222 stdlib_c99.h \
223 223 stdlib_iso.h \
224 224 string_iso.h \
225 225 time_iso.h \
226 226 wchar_c99.h \
227 227 wchar_iso.h \
228 228 wctype_c99.h \
229 229 wctype_iso.h
230 230
231 231 ARPAHDRS = \
232 232 ftp.h \
233 233 inet.h \
234 234 nameser.h \
235 235 telnet.h \
236 236 tftp.h \
237 237 nameser_compat.h
238 238
239 239 AUDIOHDRS = \
240 240 au.h
241 241
242 242 UUIDHDRS = \
243 243 uuid.h
244 244
245 245 # rpcsvc headers which are just headers (not derived from a .x file)
246 246 RPCSVC_SRC_HDRS = \
247 247 bootparam.h \
248 248 daemon_utils.h \
249 249 dbm.h \
250 250 nis_db.h \
251 251 nislib.h \
252 252 svc_dg_priv.h \
253 253 yp_prot.h \
254 254 ypclnt.h \
255 255 yppasswd.h \
256 256 ypupd.h \
257 257 rpc_sztypes.h
258 258
259 259 # rpcsvc headers which are generated from .x files
260 260 RPCSVC_GEN_HDRS = \
261 261 bootparam_prot.h \
262 262 mount.h \
263 263 nfs_prot.h \
264 264 nfs4_prot.h \
265 265 nis.h \
266 266 nlm_prot.h \
267 267 rex.h \
268 268 rquota.h \
269 269 rstat.h \
270 270 rusers.h \
271 271 rwall.h \
272 272 spray.h \
273 273 ufs_prot.h \
274 274 nfs_acl.h
275 275
276 276 LVMRPCHDRS = \
277 277 mhdx.h mdiox.h meta_basic.h metad.h metamed.h metamhd.h metacl.h
278 278
279 279 SYMHDRASSERT = $(ROOT)/usr/include/iso/assert_iso.h
280 280 SYMHDRERRNO = $(ROOT)/usr/include/iso/errno_iso.h
281 281 SYMHDRFLOAT = $(ROOT)/usr/include/iso/float_iso.h
282 282 SYMHDRISO646 = $(ROOT)/usr/include/iso/iso646_iso.h
283 283
284 284 RPCGENFLAGS = -C -h
285 285 rpcsvc/rwall.h := RPCGENFLAGS += -M
286 286 meta_basic.h := RPCGENFLAGS += -M
287 287 metad.h := RPCGENFLAGS += -M
288 288 metamed.h := RPCGENFLAGS += -M
289 289 mhdx.h := RPCGENFLAGS += -M
290 290 mdiox.h := RPCGENFLAGS += -M
291 291 metamhd.h := RPCGENFLAGS += -M
292 292 metacl.h := RPCGENFLAGS += -M
293 293
294 294 # rpcsvc rpcgen source (.x files)
295 295 #
296 296 # yp.x is an attempt at codifying what was hand coded in RPCL.
297 297 # Unfortunately it doesn't quite work. (The handcoded stuff isn't
298 298 # expressable in RPCL) this is due to the fact that YP was written
299 299 # before rpcgen existed. Hence, yp_prot.h cannot be derived from yp.x
300 300 #
301 301 # There is no `.h' for nis_object.x because it is included by nis.x and
302 302 # the resulting .h is nis.h.
303 303
304 304 RPCSVCPROTS = \
305 305 $(RPCSVC_GEN_HDRS:%.h=%.x) nis_object.x yp.x
306 306
307 307 LVMSVCPROTS = \
308 308 $(LVMRPCHDRS:%.h=%.x)
309 309
310 310 RPCSVCHDRS= $(RPCSVC_SRC_HDRS) $(RPCSVC_GEN_HDRS)
311 311
312 312 PROTOHDRS= dumprestore.h routed.h ripngd.h rwhod.h timed.h
313 313
314 314 ROOTHDRS= $(HDRS:%=$(ROOT)/usr/include/%) \
315 315 $(KRB5HDRS:%=$(ROOT)/usr/include/kerberosv5/%) \
316 316 $(ISOHDRS:%=$(ROOT)/usr/include/iso/%) \
317 317 $(ARPAHDRS:%=$(ROOT)/usr/include/arpa/%) \
318 318 $(AUDIOHDRS:%=$(ROOT)/usr/include/audio/%) \
319 319 $(UUIDHDRS:%=$(ROOT)/usr/include/uuid/%) \
320 320 $(RPCSVCHDRS:%=$(ROOT)/usr/include/rpcsvc/%) \
321 321 $(RPCSVCPROTS:%=$(ROOT)/usr/include/rpcsvc/%) \
322 322 $(LVMRPCHDRS:%=$(ROOT)/usr/include/%) \
323 323 $(PROTOHDRS:%=$(ROOT)/usr/include/protocols/%)
324 324
325 325 DIRS= iso arpa audio rpcsvc protocols security uuid kerberosv5
326 326 ROOTDIRS= $(DIRS:%=$(ROOT)/usr/include/%)
327 327
328 328 SED= sed
329 329
330 330 # check files really don't exist
331 331 #
332 332 # should do something with the rpcsvc headers
333 333
334 334 iso/%.check: iso/%.h
335 335 $(DOT_H_CHECK)
336 336
337 337 arpa/%.check: arpa/%.h
338 338 $(DOT_H_CHECK)
339 339
340 340 audio/%.check: audio/%.h
341 341 $(DOT_H_CHECK)
342 342
343 343 rpcsvc/%.check: rpcsvc/%.h
344 344 $(DOT_H_CHECK)
345 345
346 346 rpcsvc/%.check: rpcsvc/%.x
347 347 $(DOT_X_CHECK)
348 348
349 349 protocols/%.check: protocols/%.h
350 350 $(DOT_H_CHECK)
351 351
352 352 kerberosv5/%.check: kerberosv5/%.h
353 353 $(DOT_H_CHECK)
354 354
355 355 uuid/%.check: uuid/%.h
356 356 $(DOT_H_CHECK)
357 357
358 358 # Note that the derived headers (rpcgen) are not checked at this time. These
359 359 # need work at the source level and rpcgen itself has a bug which causes a
360 360 # cstyle violation. Furthermore, there seems to be good reasons for the
361 361 # generated headers to not pass all of the hdrchk rules.
362 362 #
363 363 # Add the following to the CHECKHDRS list to activate the .x checks:
364 364 # $(RPCSVCPROTS:%.x=rpcsvc/%.check) \
365 365 #
366 366 CHECKHDRS= $(HDRS:%.h=%.check) \
367 367 $(KRB5HDRS:%.h=kerberosv5/%.check) \
368 368 $(ISOHDRS:%.h=iso/%.check) \
369 369 $(ARPAHDRS:%.h=arpa/%.check) \
370 370 $(AUDIOHDRS:%.h=audio/%.check) \
371 371 $(UUIDHDRS:%.h=uuid/%.check) \
372 372 $(RPCSVC_SRC_HDRS:%.h=rpcsvc/%.check) \
373 373 $(PROTOHDRS:%.h=protocols/%.check)
374 374
375 375 # headers which won't quite meet the standards...
376 376 #
377 377 # assert.h is required by ansi-c to *not* be idempotent (section 4.1.2).
378 378 # Hence the trailing guard is not the last thing in the file nor can it
379 379 # be without playing silly games.
380 380
381 381 assert.check := HDRCHK_TAIL = | grep -v "end guard wrong" | true
382 382
383 383 # install rules
384 384
385 385 $(ROOT)/usr/include/security/%: security/%
386 386 $(INS.file)
387 387
388 388 $(ROOT)/usr/include/protocols/%: protocols/%
389 389 $(INS.file)
390 390
391 391 $(ROOT)/usr/include/rpcsvc/%: rpcsvc/%
392 392 $(INS.file)
393 393
394 394 $(ROOT)/usr/include/kerberosv5/%: kerberosv5/%
395 395 $(INS.file)
396 396
397 397 $(ROOT)/usr/include/arpa/%: arpa/%
398 398 $(INS.file)
399 399
400 400 $(ROOT)/usr/include/audio/%: audio/%
401 401 $(INS.file)
402 402
403 403 $(ROOT)/usr/include/iso/%: iso/%
404 404 $(INS.file)
405 405
406 406 $(ROOT)/usr/include/uuid/%: uuid/%
407 407 $(INS.file)
408 408
409 409 $(ROOT)/usr/include/%: %
410 410 $(INS.file)
411 411
412 412 .KEEP_STATE:
413 413
414 414 .PARALLEL: $(ROOTHDRS) $(CHECKHDRS)
415 415
416 416 install_h: $(ROOTDIRS) .WAIT $(ROOTHDRS) $(SYMHDRASSERT) $(SYMHDRERRNO) \
417 417 $(SYMHDRFLOAT) $(SYMHDRISO646)
418 418
419 419 check: $(CHECKHDRS)
420 420
421 421 clean clobber:
422 422 $(RM) $(LVMRPCHDRS);
423 423 cd rpcsvc ; $(RM) $(RPCSVC_GEN_HDRS)
424 424
425 425 $(ROOTDIRS):
426 426 $(INS.dir)
427 427
428 428 $(SYMHDRASSERT):
429 429 -$(RM) $@; $(SYMLINK) ../assert.h $@
430 430
431 431 $(SYMHDRERRNO):
432 432 -$(RM) $@; $(SYMLINK) ../errno.h $@
433 433
434 434 $(SYMHDRFLOAT):
435 435 -$(RM) $@; $(SYMLINK) ../float.h $@
436 436
437 437 $(SYMHDRISO646):
438 438 -$(RM) $@; $(SYMLINK) ../iso646.h $@
439 439
440 440 rpcsvc/%.h: rpcsvc/%.x
441 441 $(RPCGEN) $(RPCGENFLAGS) $< -o $@
442 442
443 443 rpcsvc/nis.h: rpcsvc/nis.x
444 444 $(RPCGEN) $(RPCGENFLAGS) rpcsvc/nis.x |\
445 445 $(SED) -e '/EDIT_START/,$$ d' > $@
446 446
447 447 meta_basic.h: ../uts/common/sys/lvm/meta_basic.x
448 448 $(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/meta_basic.x | \
449 449 awk '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
450 450 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
451 451 { print $0 } \
452 452 ' > $@
453 453
454 454 metad.h: metad.x
455 455 $(RPCGEN) $(RPCGENFLAGS) metad.x | \
456 456 awk '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
457 457 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
458 458 { print $0 } \
459 459 ' > $@
↓ open down ↓ |
459 lines elided |
↑ open up ↑ |
460 460
461 461 mhdx.h: ../uts/common/sys/lvm/mhdx.x
462 462 $(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/mhdx.x | \
463 463 awk '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
464 464 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
465 465 { print $0 } \
466 466 ' > $@
467 467
468 468 mdiox.h: ../uts/common/sys/lvm/mdiox.x
469 469 $(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/mdiox.x | \
470 - nawk '{sub(/sys\/lvm\/md_mhdx/, "mhdx"); print $$0}' | \
471 - nawk '{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
470 + /usr/xpg4/bin/awk '{sub(/sys\/lvm\/md_mhdx/, "mhdx"); print $$0}' | \
471 + /usr/xpg4/bin/awk '{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
472 472 awk '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
473 473 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
474 474 { print $0 } \
475 475 ' > $@
476 476
477 477 metamed.h: ../uts/common/sys/lvm/metamed.x
478 478 $(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/metamed.x | \
479 - nawk '{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
479 + /usr/xpg4/bin/awk '{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
480 480 awk '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
481 481 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
482 482 { print $0 } \
483 483 ' > $@
484 484
485 485 metamhd.h: metamhd.x
486 486 $(RPCGEN) $(RPCGENFLAGS) metamhd.x | \
487 487 awk '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
488 488 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
489 489 { print $0 } \
490 490 ' > $@
491 491
492 492 metacl.h: metacl.x
493 493 $(RPCGEN) $(RPCGENFLAGS) metacl.x | \
494 494 awk '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
495 495 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
496 496 { print $0 } \
497 497 ' > $@
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX