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]
22 # Copyright 2011 Nexenta Systems, Inc. All rights reserved.
24 # Copyright 2010 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
27 # Copyright 2013 Garrett D'Amore <garrett@damore.org>
28 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
32 # include global definitions
33 include ..
/Makefile.master
36 i386_HDRS
= stack_unwind.h
38 # Headers are listed one per line so that TeamWare can auto-merge most changes
40 KRB5HDRS
= mit_copyright.h mit-sipb-copyright.h
42 ATTRDB_HDRS
= secdb.h auth_attr.h exec_attr.h prof_attr.h user_attr.h \
45 HDRS
= $($(MACH
)_HDRS
) $(ATTRDB_HDRS
) \
261 # rpcsvc headers which are just headers (not derived from a .x file)
275 # rpcsvc headers which are generated from .x files
292 mhdx.h mdiox.h meta_basic.h metad.h metamed.h metamhd.h metacl.h
294 SYMHDRASSERT
= $(ROOT
)/usr
/include/iso
/assert_iso.h
295 SYMHDRERRNO
= $(ROOT
)/usr
/include/iso
/errno_iso.h
296 SYMHDRFLOAT
= $(ROOT
)/usr
/include/iso
/float_iso.h
297 SYMHDRISO646
= $(ROOT
)/usr
/include/iso
/iso646_iso.h
300 rpcsvc
/rwall.h
:= RPCGENFLAGS
+= -M
301 meta_basic.h
:= RPCGENFLAGS
+= -M
302 metad.h
:= RPCGENFLAGS
+= -M
303 metamed.h
:= RPCGENFLAGS
+= -M
304 mhdx.h
:= RPCGENFLAGS
+= -M
305 mdiox.h
:= RPCGENFLAGS
+= -M
306 metamhd.h
:= RPCGENFLAGS
+= -M
307 metacl.h
:= RPCGENFLAGS
+= -M
309 # rpcsvc rpcgen source (.x files)
311 # yp.x is an attempt at codifying what was hand coded in RPCL.
312 # Unfortunately it doesn't quite work. (The handcoded stuff isn't
313 # expressable in RPCL) this is due to the fact that YP was written
314 # before rpcgen existed. Hence, yp_prot.h cannot be derived from yp.x
316 # There is no `.h' for nis_object.x because it is included by nis.x and
317 # the resulting .h is nis.h.
320 $(RPCSVC_GEN_HDRS
:%.h
=%.x
) nis_object.x yp.x
323 $(LVMRPCHDRS
:%.h
=%.x
)
325 RPCSVCHDRS
= $(RPCSVC_SRC_HDRS
) $(RPCSVC_GEN_HDRS
)
327 PROTOHDRS
= dumprestore.h routed.h ripngd.h rwhod.h timed.h
329 ROOTHDRS
= $(HDRS
:%=$(ROOT
)/usr
/include/%) \
330 $(KRB5HDRS
:%=$(ROOT
)/usr
/include/kerberosv5
/%) \
331 $(ISOHDRS
:%=$(ROOT
)/usr
/include/iso
/%) \
332 $(ARPAHDRS
:%=$(ROOT
)/usr
/include/arpa
/%) \
333 $(AUDIOHDRS
:%=$(ROOT
)/usr
/include/audio
/%) \
334 $(UUIDHDRS
:%=$(ROOT
)/usr
/include/uuid
/%) \
335 $(RPCSVCHDRS
:%=$(ROOT
)/usr
/include/rpcsvc
/%) \
336 $(RPCSVCPROTS
:%=$(ROOT
)/usr
/include/rpcsvc
/%) \
337 $(LVMRPCHDRS
:%=$(ROOT
)/usr
/include/%) \
338 $(PROTOHDRS
:%=$(ROOT
)/usr
/include/protocols
/%)
340 DIRS
= iso arpa audio rpcsvc protocols security uuid kerberosv5
341 ROOTDIRS
= $(DIRS
:%=$(ROOT
)/usr
/include/%)
343 # check files really don't exist
345 # should do something with the rpcsvc headers
350 arpa
/%.
check: arpa
/%.h
353 audio
/%.
check: audio
/%.h
356 rpcsvc
/%.
check: rpcsvc
/%.h
359 rpcsvc
/%.
check: rpcsvc
/%.x
362 protocols
/%.
check: protocols
/%.h
365 kerberosv5
/%.
check: kerberosv5
/%.h
368 uuid
/%.
check: uuid
/%.h
371 # Note that the derived headers (rpcgen) are not checked at this time. These
372 # need work at the source level and rpcgen itself has a bug which causes a
373 # cstyle violation. Furthermore, there seems to be good reasons for the
374 # generated headers to not pass all of the hdrchk rules.
376 # Add the following to the CHECKHDRS list to activate the .x checks:
377 # $(RPCSVCPROTS:%.x=rpcsvc/%.check) \
379 CHECKHDRS
= $(HDRS
:%.h
=%.
check) \
380 $(KRB5HDRS
:%.h
=kerberosv5
/%.
check) \
381 $(ISOHDRS
:%.h
=iso
/%.
check) \
382 $(ARPAHDRS
:%.h
=arpa
/%.
check) \
383 $(AUDIOHDRS
:%.h
=audio
/%.
check) \
384 $(UUIDHDRS
:%.h
=uuid
/%.
check) \
385 $(RPCSVC_SRC_HDRS
:%.h
=rpcsvc
/%.
check) \
386 $(PROTOHDRS
:%.h
=protocols
/%.
check)
388 # headers which won't quite meet the standards...
390 # assert.h is required by ansi-c to *not* be idempotent (section 4.1.2).
391 # Hence the trailing guard is not the last thing in the file nor can it
392 # be without playing silly games.
394 assert.
check := HDRCHK_TAIL
= | grep
-v
"end guard wrong" | true
398 $(ROOT
)/usr
/include/security
/%: security
/%
401 $(ROOT
)/usr
/include/protocols
/%: protocols
/%
404 $(ROOT
)/usr
/include/rpcsvc
/%: rpcsvc
/%
407 $(ROOT
)/usr
/include/kerberosv5
/%: kerberosv5
/%
410 $(ROOT
)/usr
/include/arpa
/%: arpa
/%
413 $(ROOT
)/usr
/include/audio
/%: audio
/%
416 $(ROOT
)/usr
/include/iso
/%: iso
/%
419 $(ROOT
)/usr
/include/uuid
/%: uuid
/%
422 $(ROOT
)/usr
/include/%: %
427 .PARALLEL
: $(ROOTHDRS
) $(CHECKHDRS
)
429 install_h
: $(ROOTDIRS
) .WAIT
$(ROOTHDRS
) $(SYMHDRASSERT
) $(SYMHDRERRNO
) \
430 $(SYMHDRFLOAT
) $(SYMHDRISO646
)
436 cd rpcsvc
; $(RM
) $(RPCSVC_GEN_HDRS
)
442 -$(RM
) $@
; $(SYMLINK
) ..
/assert.h
$@
445 -$(RM
) $@
; $(SYMLINK
) ..
/errno.h
$@
448 -$(RM
) $@
; $(SYMLINK
) ..
/float.h
$@
451 -$(RM
) $@
; $(SYMLINK
) ..
/iso646.h
$@
453 rpcsvc
/%.h
: rpcsvc
/%.x
454 $(RPCGEN
) $(RPCGENFLAGS
) $< -o
$@
456 rpcsvc
/nis.h
: rpcsvc
/nis.x
457 $(RPCGEN
) $(RPCGENFLAGS
) rpcsvc
/nis.x |\
458 $(SED
) -e
'/EDIT_START/,$$ d' > $@
460 meta_basic.h
: ..
/uts
/common
/sys
/lvm
/meta_basic.x
461 $(RPCGEN
) $(RPCGENFLAGS
) ..
/uts
/common
/sys
/lvm
/meta_basic.x | \
462 $(AWK
) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
463 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
468 $(RPCGEN
) $(RPCGENFLAGS
) metad.x | \
469 $(AWK
) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
470 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
474 mhdx.h
: ..
/uts
/common
/sys
/lvm
/mhdx.x
475 $(RPCGEN
) $(RPCGENFLAGS
) ..
/uts
/common
/sys
/lvm
/mhdx.x | \
476 $(AWK
) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
477 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
481 mdiox.h
: ..
/uts
/common
/sys
/lvm
/mdiox.x
482 $(RPCGEN
) $(RPCGENFLAGS
) ..
/uts
/common
/sys
/lvm
/mdiox.x | \
483 $(AWK
) '{sub(/sys\/lvm\/md_mhdx/, "mhdx"); print $$0}' | \
484 $(AWK
) '{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
485 $(AWK
) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
486 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
490 metamed.h
: ..
/uts
/common
/sys
/lvm
/metamed.x
491 $(RPCGEN
) $(RPCGENFLAGS
) ..
/uts
/common
/sys
/lvm
/metamed.x | \
492 $(AWK
) '{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
493 $(AWK
) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
494 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
499 $(RPCGEN
) $(RPCGENFLAGS
) metamhd.x | \
500 $(AWK
) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
501 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
506 $(RPCGEN
) $(RPCGENFLAGS
) metacl.x | \
507 $(AWK
) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
508 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \