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>
31 # include global definitions
32 include ..
/Makefile.master
35 i386_HDRS
= stack_unwind.h
37 # Headers are listed one per line so that TeamWare can auto-merge most changes
39 KRB5HDRS
= mit_copyright.h mit-sipb-copyright.h
41 ATTRDB_HDRS
= secdb.h auth_attr.h exec_attr.h prof_attr.h user_attr.h \
44 HDRS
= $($(MACH
)_HDRS
) $(ATTRDB_HDRS
) \
255 # rpcsvc headers which are just headers (not derived from a .x file)
269 # rpcsvc headers which are generated from .x files
286 mhdx.h mdiox.h meta_basic.h metad.h metamed.h metamhd.h metacl.h
288 SYMHDRASSERT
= $(ROOT
)/usr
/include/iso
/assert_iso.h
289 SYMHDRERRNO
= $(ROOT
)/usr
/include/iso
/errno_iso.h
290 SYMHDRFLOAT
= $(ROOT
)/usr
/include/iso
/float_iso.h
291 SYMHDRISO646
= $(ROOT
)/usr
/include/iso
/iso646_iso.h
294 rpcsvc
/rwall.h
:= RPCGENFLAGS
+= -M
295 meta_basic.h
:= RPCGENFLAGS
+= -M
296 metad.h
:= RPCGENFLAGS
+= -M
297 metamed.h
:= RPCGENFLAGS
+= -M
298 mhdx.h
:= RPCGENFLAGS
+= -M
299 mdiox.h
:= RPCGENFLAGS
+= -M
300 metamhd.h
:= RPCGENFLAGS
+= -M
301 metacl.h
:= RPCGENFLAGS
+= -M
303 # rpcsvc rpcgen source (.x files)
305 # yp.x is an attempt at codifying what was hand coded in RPCL.
306 # Unfortunately it doesn't quite work. (The handcoded stuff isn't
307 # expressable in RPCL) this is due to the fact that YP was written
308 # before rpcgen existed. Hence, yp_prot.h cannot be derived from yp.x
310 # There is no `.h' for nis_object.x because it is included by nis.x and
311 # the resulting .h is nis.h.
314 $(RPCSVC_GEN_HDRS
:%.h
=%.x
) nis_object.x yp.x
317 $(LVMRPCHDRS
:%.h
=%.x
)
319 RPCSVCHDRS
= $(RPCSVC_SRC_HDRS
) $(RPCSVC_GEN_HDRS
)
321 PROTOHDRS
= dumprestore.h routed.h ripngd.h rwhod.h timed.h
323 ROOTHDRS
= $(HDRS
:%=$(ROOT
)/usr
/include/%) \
324 $(KRB5HDRS
:%=$(ROOT
)/usr
/include/kerberosv5
/%) \
325 $(ISOHDRS
:%=$(ROOT
)/usr
/include/iso
/%) \
326 $(ARPAHDRS
:%=$(ROOT
)/usr
/include/arpa
/%) \
327 $(AUDIOHDRS
:%=$(ROOT
)/usr
/include/audio
/%) \
328 $(UUIDHDRS
:%=$(ROOT
)/usr
/include/uuid
/%) \
329 $(RPCSVCHDRS
:%=$(ROOT
)/usr
/include/rpcsvc
/%) \
330 $(RPCSVCPROTS
:%=$(ROOT
)/usr
/include/rpcsvc
/%) \
331 $(LVMRPCHDRS
:%=$(ROOT
)/usr
/include/%) \
332 $(PROTOHDRS
:%=$(ROOT
)/usr
/include/protocols
/%)
334 DIRS
= iso arpa audio rpcsvc protocols security uuid kerberosv5
335 ROOTDIRS
= $(DIRS
:%=$(ROOT
)/usr
/include/%)
339 # check files really don't exist
341 # should do something with the rpcsvc headers
346 arpa
/%.
check: arpa
/%.h
349 audio
/%.
check: audio
/%.h
352 rpcsvc
/%.
check: rpcsvc
/%.h
355 rpcsvc
/%.
check: rpcsvc
/%.x
358 protocols
/%.
check: protocols
/%.h
361 kerberosv5
/%.
check: kerberosv5
/%.h
364 uuid
/%.
check: uuid
/%.h
367 # Note that the derived headers (rpcgen) are not checked at this time. These
368 # need work at the source level and rpcgen itself has a bug which causes a
369 # cstyle violation. Furthermore, there seems to be good reasons for the
370 # generated headers to not pass all of the hdrchk rules.
372 # Add the following to the CHECKHDRS list to activate the .x checks:
373 # $(RPCSVCPROTS:%.x=rpcsvc/%.check) \
375 CHECKHDRS
= $(HDRS
:%.h
=%.
check) \
376 $(KRB5HDRS
:%.h
=kerberosv5
/%.
check) \
377 $(ISOHDRS
:%.h
=iso
/%.
check) \
378 $(ARPAHDRS
:%.h
=arpa
/%.
check) \
379 $(AUDIOHDRS
:%.h
=audio
/%.
check) \
380 $(UUIDHDRS
:%.h
=uuid
/%.
check) \
381 $(RPCSVC_SRC_HDRS
:%.h
=rpcsvc
/%.
check) \
382 $(PROTOHDRS
:%.h
=protocols
/%.
check)
384 # headers which won't quite meet the standards...
386 # assert.h is required by ansi-c to *not* be idempotent (section 4.1.2).
387 # Hence the trailing guard is not the last thing in the file nor can it
388 # be without playing silly games.
390 assert.
check := HDRCHK_TAIL
= | grep
-v
"end guard wrong" | true
394 $(ROOT
)/usr
/include/security
/%: security
/%
397 $(ROOT
)/usr
/include/protocols
/%: protocols
/%
400 $(ROOT
)/usr
/include/rpcsvc
/%: rpcsvc
/%
403 $(ROOT
)/usr
/include/kerberosv5
/%: kerberosv5
/%
406 $(ROOT
)/usr
/include/arpa
/%: arpa
/%
409 $(ROOT
)/usr
/include/audio
/%: audio
/%
412 $(ROOT
)/usr
/include/iso
/%: iso
/%
415 $(ROOT
)/usr
/include/uuid
/%: uuid
/%
418 $(ROOT
)/usr
/include/%: %
423 .PARALLEL
: $(ROOTHDRS
) $(CHECKHDRS
)
425 install_h
: $(ROOTDIRS
) .WAIT
$(ROOTHDRS
) $(SYMHDRASSERT
) $(SYMHDRERRNO
) \
426 $(SYMHDRFLOAT
) $(SYMHDRISO646
)
432 cd rpcsvc
; $(RM
) $(RPCSVC_GEN_HDRS
)
438 -$(RM
) $@
; $(SYMLINK
) ..
/assert.h
$@
441 -$(RM
) $@
; $(SYMLINK
) ..
/errno.h
$@
444 -$(RM
) $@
; $(SYMLINK
) ..
/float.h
$@
447 -$(RM
) $@
; $(SYMLINK
) ..
/iso646.h
$@
449 rpcsvc
/%.h
: rpcsvc
/%.x
450 $(RPCGEN
) $(RPCGENFLAGS
) $< -o
$@
452 rpcsvc
/nis.h
: rpcsvc
/nis.x
453 $(RPCGEN
) $(RPCGENFLAGS
) rpcsvc
/nis.x |\
454 $(SED
) -e
'/EDIT_START/,$$ d' > $@
456 meta_basic.h
: ..
/uts
/common
/sys
/lvm
/meta_basic.x
457 $(RPCGEN
) $(RPCGENFLAGS
) ..
/uts
/common
/sys
/lvm
/meta_basic.x | \
458 awk
'/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
459 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
464 $(RPCGEN
) $(RPCGENFLAGS
) metad.x | \
465 awk
'/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
466 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
470 mhdx.h
: ..
/uts
/common
/sys
/lvm
/mhdx.x
471 $(RPCGEN
) $(RPCGENFLAGS
) ..
/uts
/common
/sys
/lvm
/mhdx.x | \
472 awk
'/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
473 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
477 mdiox.h
: ..
/uts
/common
/sys
/lvm
/mdiox.x
478 $(RPCGEN
) $(RPCGENFLAGS
) ..
/uts
/common
/sys
/lvm
/mdiox.x | \
479 nawk
'{sub(/sys\/lvm\/md_mhdx/, "mhdx"); print $$0}' | \
480 nawk
'{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
481 awk
'/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
482 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
486 metamed.h
: ..
/uts
/common
/sys
/lvm
/metamed.x
487 $(RPCGEN
) $(RPCGENFLAGS
) ..
/uts
/common
/sys
/lvm
/metamed.x | \
488 nawk
'{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
489 awk
'/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
490 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
495 $(RPCGEN
) $(RPCGENFLAGS
) metamhd.x | \
496 awk
'/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
497 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
502 $(RPCGEN
) $(RPCGENFLAGS
) metacl.x | \
503 awk
'/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
504 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \