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 2017 Nexenta Systems, Inc.
30 # include global definitions
31 include ..
/Makefile.master
34 i386_HDRS
= stack_unwind.h
48 HDRS
= $($(MACH
)_HDRS
) \
261 # rpcsvc headers which are just headers (not derived from a .x file)
275 # rpcsvc headers which are generated from .x files
290 SYMHDRASSERT
= $(ROOT
)/usr
/include/iso
/assert_iso.h
291 SYMHDRERRNO
= $(ROOT
)/usr
/include/iso
/errno_iso.h
292 SYMHDRFLOAT
= $(ROOT
)/usr
/include/iso
/float_iso.h
293 SYMHDRISO646
= $(ROOT
)/usr
/include/iso
/iso646_iso.h
296 rpcsvc
/rwall.h
:= RPCGENFLAGS
+= -M
298 # rpcsvc rpcgen source (.x files)
300 # yp.x is an attempt at codifying what was hand coded in RPCL.
301 # Unfortunately it doesn't quite work. (The handcoded stuff isn't
302 # expressable in RPCL) this is due to the fact that YP was written
303 # before rpcgen existed. Hence, yp_prot.h cannot be derived from yp.x
305 # There is no `.h' for nis_object.x because it is included by nis.x and
306 # the resulting .h is nis.h.
309 $(RPCSVC_GEN_HDRS
:%.h
=%.x
) nis_object.x yp.x
311 RPCSVCHDRS
= $(RPCSVC_SRC_HDRS
) $(RPCSVC_GEN_HDRS
)
313 PROTOHDRS
= dumprestore.h routed.h ripngd.h rwhod.h timed.h
315 ROOTHDRS
= $(HDRS
:%=$(ROOT
)/usr
/include/%) \
316 $(KRB5HDRS
:%=$(ROOT
)/usr
/include/kerberosv5
/%) \
317 $(ISOHDRS
:%=$(ROOT
)/usr
/include/iso
/%) \
318 $(ARPAHDRS
:%=$(ROOT
)/usr
/include/arpa
/%) \
319 $(AUDIOHDRS
:%=$(ROOT
)/usr
/include/audio
/%) \
320 $(UUIDHDRS
:%=$(ROOT
)/usr
/include/uuid
/%) \
321 $(RPCSVCHDRS
:%=$(ROOT
)/usr
/include/rpcsvc
/%) \
322 $(RPCSVCPROTS
:%=$(ROOT
)/usr
/include/rpcsvc
/%) \
323 $(PROTOHDRS
:%=$(ROOT
)/usr
/include/protocols
/%)
325 DIRS
= iso arpa audio rpcsvc protocols security uuid kerberosv5
326 ROOTDIRS
= $(DIRS
:%=$(ROOT
)/usr
/include/%)
328 # check files really don't exist
330 # should do something with the rpcsvc headers
335 arpa
/%.
check: arpa
/%.h
338 audio
/%.
check: audio
/%.h
341 rpcsvc
/%.
check: rpcsvc
/%.h
344 rpcsvc
/%.
check: rpcsvc
/%.x
347 protocols
/%.
check: protocols
/%.h
350 kerberosv5
/%.
check: kerberosv5
/%.h
353 uuid
/%.
check: uuid
/%.h
356 # Note that the derived headers (rpcgen) are not checked at this time. These
357 # need work at the source level and rpcgen itself has a bug which causes a
358 # cstyle violation. Furthermore, there seems to be good reasons for the
359 # generated headers to not pass all of the hdrchk rules.
361 # Add the following to the CHECKHDRS list to activate the .x checks:
362 # $(RPCSVCPROTS:%.x=rpcsvc/%.check) \
364 CHECKHDRS
= $(HDRS
:%.h
=%.
check) \
365 $(KRB5HDRS
:%.h
=kerberosv5
/%.
check) \
366 $(ISOHDRS
:%.h
=iso
/%.
check) \
367 $(ARPAHDRS
:%.h
=arpa
/%.
check) \
368 $(AUDIOHDRS
:%.h
=audio
/%.
check) \
369 $(UUIDHDRS
:%.h
=uuid
/%.
check) \
370 $(RPCSVC_SRC_HDRS
:%.h
=rpcsvc
/%.
check) \
371 $(PROTOHDRS
:%.h
=protocols
/%.
check)
373 # headers which won't quite meet the standards...
375 # assert.h is required by ansi-c to *not* be idempotent (section 4.1.2).
376 # Hence the trailing guard is not the last thing in the file nor can it
377 # be without playing silly games.
379 assert.
check := HDRCHK_TAIL
= | grep
-v
"end guard wrong" | true
383 $(ROOT
)/usr
/include/security
/%: security
/%
386 $(ROOT
)/usr
/include/protocols
/%: protocols
/%
389 $(ROOT
)/usr
/include/rpcsvc
/%: rpcsvc
/%
392 $(ROOT
)/usr
/include/kerberosv5
/%: kerberosv5
/%
395 $(ROOT
)/usr
/include/arpa
/%: arpa
/%
398 $(ROOT
)/usr
/include/audio
/%: audio
/%
401 $(ROOT
)/usr
/include/iso
/%: iso
/%
404 $(ROOT
)/usr
/include/uuid
/%: uuid
/%
407 $(ROOT
)/usr
/include/%: %
412 .PARALLEL
: $(ROOTHDRS
) $(CHECKHDRS
)
414 install_h
: $(ROOTDIRS
) .WAIT
$(ROOTHDRS
) $(SYMHDRASSERT
) $(SYMHDRERRNO
) \
415 $(SYMHDRFLOAT
) $(SYMHDRISO646
)
420 cd rpcsvc
; $(RM
) $(RPCSVC_GEN_HDRS
)
426 -$(RM
) $@
; $(SYMLINK
) ..
/assert.h
$@
429 -$(RM
) $@
; $(SYMLINK
) ..
/errno.h
$@
432 -$(RM
) $@
; $(SYMLINK
) ..
/float.h
$@
435 -$(RM
) $@
; $(SYMLINK
) ..
/iso646.h
$@
437 rpcsvc
/%.h
: rpcsvc
/%.x
438 $(RPCGEN
) $(RPCGENFLAGS
) $< -o
$@
440 rpcsvc
/nis.h
: rpcsvc
/nis.x
441 $(RPCGEN
) $(RPCGENFLAGS
) rpcsvc
/nis.x |\
442 $(SED
) -e
'/EDIT_START/,$$ d' > $@