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]
23 # Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
25 # Copyright 2013 Garrett D'Amore <garrett@damore.org>
26 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
27 # Copyright 2016 Nexenta Systems, Inc.
33 # include global definitions
34 include ..
/Makefile.master
37 i386_HDRS
= stack_unwind.h
39 # Headers are listed one per line so that TeamWare can auto-merge most changes
41 KRB5HDRS
= mit_copyright.h mit-sipb-copyright.h
43 ATTRDB_HDRS
= secdb.h auth_attr.h exec_attr.h prof_attr.h user_attr.h \
46 HDRS
= $($(MACH
)_HDRS
) $(ATTRDB_HDRS
) \
257 # rpcsvc headers which are just headers (not derived from a .x file)
271 # rpcsvc headers which are generated from .x files
287 SYMHDRASSERT
= $(ROOT
)/usr
/include/iso
/assert_iso.h
288 SYMHDRERRNO
= $(ROOT
)/usr
/include/iso
/errno_iso.h
289 SYMHDRFLOAT
= $(ROOT
)/usr
/include/iso
/float_iso.h
290 SYMHDRISO646
= $(ROOT
)/usr
/include/iso
/iso646_iso.h
293 rpcsvc
/rwall.h
:= RPCGENFLAGS
+= -M
295 # rpcsvc rpcgen source (.x files)
297 # yp.x is an attempt at codifying what was hand coded in RPCL.
298 # Unfortunately it doesn't quite work. (The handcoded stuff isn't
299 # expressable in RPCL) this is due to the fact that YP was written
300 # before rpcgen existed. Hence, yp_prot.h cannot be derived from yp.x
302 # There is no `.h' for nis_object.x because it is included by nis.x and
303 # the resulting .h is nis.h.
306 $(RPCSVC_GEN_HDRS
:%.h
=%.x
) nis_object.x yp.x
308 RPCSVCHDRS
= $(RPCSVC_SRC_HDRS
) $(RPCSVC_GEN_HDRS
)
310 PROTOHDRS
= dumprestore.h routed.h ripngd.h rwhod.h timed.h
312 ROOTHDRS
= $(HDRS
:%=$(ROOT
)/usr
/include/%) \
313 $(KRB5HDRS
:%=$(ROOT
)/usr
/include/kerberosv5
/%) \
314 $(ISOHDRS
:%=$(ROOT
)/usr
/include/iso
/%) \
315 $(ARPAHDRS
:%=$(ROOT
)/usr
/include/arpa
/%) \
316 $(AUDIOHDRS
:%=$(ROOT
)/usr
/include/audio
/%) \
317 $(UUIDHDRS
:%=$(ROOT
)/usr
/include/uuid
/%) \
318 $(RPCSVCHDRS
:%=$(ROOT
)/usr
/include/rpcsvc
/%) \
319 $(RPCSVCPROTS
:%=$(ROOT
)/usr
/include/rpcsvc
/%) \
320 $(PROTOHDRS
:%=$(ROOT
)/usr
/include/protocols
/%)
322 DIRS
= iso arpa audio rpcsvc protocols security uuid kerberosv5
323 ROOTDIRS
= $(DIRS
:%=$(ROOT
)/usr
/include/%)
325 # check files really don't exist
327 # should do something with the rpcsvc headers
332 arpa
/%.
check: arpa
/%.h
335 audio
/%.
check: audio
/%.h
338 rpcsvc
/%.
check: rpcsvc
/%.h
341 rpcsvc
/%.
check: rpcsvc
/%.x
344 protocols
/%.
check: protocols
/%.h
347 kerberosv5
/%.
check: kerberosv5
/%.h
350 uuid
/%.
check: uuid
/%.h
353 # Note that the derived headers (rpcgen) are not checked at this time. These
354 # need work at the source level and rpcgen itself has a bug which causes a
355 # cstyle violation. Furthermore, there seems to be good reasons for the
356 # generated headers to not pass all of the hdrchk rules.
358 # Add the following to the CHECKHDRS list to activate the .x checks:
359 # $(RPCSVCPROTS:%.x=rpcsvc/%.check) \
361 CHECKHDRS
= $(HDRS
:%.h
=%.
check) \
362 $(KRB5HDRS
:%.h
=kerberosv5
/%.
check) \
363 $(ISOHDRS
:%.h
=iso
/%.
check) \
364 $(ARPAHDRS
:%.h
=arpa
/%.
check) \
365 $(AUDIOHDRS
:%.h
=audio
/%.
check) \
366 $(UUIDHDRS
:%.h
=uuid
/%.
check) \
367 $(RPCSVC_SRC_HDRS
:%.h
=rpcsvc
/%.
check) \
368 $(PROTOHDRS
:%.h
=protocols
/%.
check)
370 # headers which won't quite meet the standards...
372 # assert.h is required by ansi-c to *not* be idempotent (section 4.1.2).
373 # Hence the trailing guard is not the last thing in the file nor can it
374 # be without playing silly games.
376 assert.
check := HDRCHK_TAIL
= | grep
-v
"end guard wrong" | true
380 $(ROOT
)/usr
/include/security
/%: security
/%
383 $(ROOT
)/usr
/include/protocols
/%: protocols
/%
386 $(ROOT
)/usr
/include/rpcsvc
/%: rpcsvc
/%
389 $(ROOT
)/usr
/include/kerberosv5
/%: kerberosv5
/%
392 $(ROOT
)/usr
/include/arpa
/%: arpa
/%
395 $(ROOT
)/usr
/include/audio
/%: audio
/%
398 $(ROOT
)/usr
/include/iso
/%: iso
/%
401 $(ROOT
)/usr
/include/uuid
/%: uuid
/%
404 $(ROOT
)/usr
/include/%: %
409 .PARALLEL
: $(ROOTHDRS
) $(CHECKHDRS
)
411 install_h
: $(ROOTDIRS
) .WAIT
$(ROOTHDRS
) $(SYMHDRASSERT
) $(SYMHDRERRNO
) \
412 $(SYMHDRFLOAT
) $(SYMHDRISO646
)
417 cd rpcsvc
; $(RM
) $(RPCSVC_GEN_HDRS
)
423 -$(RM
) $@
; $(SYMLINK
) ..
/assert.h
$@
426 -$(RM
) $@
; $(SYMLINK
) ..
/errno.h
$@
429 -$(RM
) $@
; $(SYMLINK
) ..
/float.h
$@
432 -$(RM
) $@
; $(SYMLINK
) ..
/iso646.h
$@
434 rpcsvc
/%.h
: rpcsvc
/%.x
435 $(RPCGEN
) $(RPCGENFLAGS
) $< -o
$@
437 rpcsvc
/nis.h
: rpcsvc
/nis.x
438 $(RPCGEN
) $(RPCGENFLAGS
) rpcsvc
/nis.x |\
439 $(SED
) -e
'/EDIT_START/,$$ d' > $@