Makefile revision fc2512cfb727d49529d8ed99164db871f4829b73
286N/A#
286N/A# CDDL HEADER START
286N/A#
286N/A# The contents of this file are subject to the terms of the
286N/A# Common Development and Distribution License (the "License").
286N/A# You may not use this file except in compliance with the License.
286N/A#
286N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
286N/A# or http://www.opensolaris.org/os/licensing.
286N/A# See the License for the specific language governing permissions
286N/A# and limitations under the License.
286N/A#
286N/A# When distributing Covered Code, include this CDDL HEADER in each
286N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
286N/A# If applicable, add the following below this CDDL HEADER, with the
286N/A# fields enclosed by brackets "[]" replaced with your own identifying
286N/A# information: Portions Copyright [yyyy] [name of copyright owner]
286N/A#
286N/A# CDDL HEADER END
286N/A#
286N/A#
286N/A# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
286N/A#
286N/A# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
286N/A# Use is subject to license terms.
286N/A#
286N/A# Copyright 2013 Garrett D'Amore <garrett@damore.org>
286N/A# Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
286N/A#
286N/A# head/Makefile
286N/A#
286N/A# include global definitions
286N/Ainclude ../Makefile.master
286N/A
286N/Asparc_HDRS=
286N/Ai386_HDRS= stack_unwind.h
286N/A
286N/A# Headers are listed one per line so that TeamWare can auto-merge most changes
286N/A
286N/AKRB5HDRS= mit_copyright.h mit-sipb-copyright.h
286N/A
286N/AATTRDB_HDRS= secdb.h auth_attr.h exec_attr.h prof_attr.h user_attr.h \
286N/A auth_list.h
286N/A
286N/AHDRS= $($(MACH)_HDRS) $(ATTRDB_HDRS) \
286N/A aio.h \
286N/A alloca.h \
286N/A apptrace.h \
286N/A apptrace_impl.h \
286N/A ar.h \
286N/A archives.h \
286N/A assert.h \
286N/A atomic.h \
286N/A attr.h \
286N/A complex.h \
286N/A config_admin.h \
286N/A cpio.h \
286N/A crypt.h \
286N/A ctype.h \
286N/A deflt.h \
286N/A devid.h \
286N/A devmgmt.h \
286N/A devpoll.h \
286N/A dial.h \
286N/A dirent.h \
286N/A dlfcn.h \
286N/A door.h \
286N/A elf.h \
286N/A err.h \
286N/A errno.h \
286N/A euc.h \
286N/A exacct.h \
286N/A exacct_impl.h \
286N/A execinfo.h \
286N/A fatal.h \
286N/A fcntl.h \
286N/A fenv.h \
286N/A float.h \
286N/A floatingpoint.h \
286N/A fmtmsg.h \
286N/A fnmatch.h \
286N/A ftw.h \
286N/A gelf.h \
286N/A getopt.h \
286N/A getwidth.h \
286N/A glob.h \
286N/A grp.h \
286N/A iconv.h \
286N/A ieeefp.h \
286N/A ifaddrs.h \
286N/A inttypes.h \
286N/A iso646.h \
286N/A klpd.h \
286N/A langinfo.h \
286N/A lastlog.h \
286N/A lber.h \
286N/A ldap.h \
286N/A libelf.h \
286N/A libgen.h \
286N/A libintl.h \
286N/A libw.h \
286N/A libzonecfg.h \
286N/A limits.h \
286N/A linenum.h \
286N/A link.h \
286N/A listen.h \
286N/A locale.h \
286N/A macros.h \
286N/A malloc.h \
286N/A math.h \
286N/A mdmn_changelog.h \
286N/A memory.h \
286N/A meta.h \
286N/A meta_runtime.h \
286N/A metadyn.h \
286N/A mon.h \
286N/A monetary.h \
286N/A mp.h \
286N/A mqueue.h \
286N/A nan.h \
286N/A ndbm.h \
286N/A ndpd.h \
286N/A netconfig.h \
286N/A netdb.h \
286N/A netdir.h \
286N/A nl_types.h \
286N/A nlist.h \
286N/A note.h \
286N/A nsctl.h \
286N/A nsswitch.h \
286N/A nss_common.h \
286N/A nss_dbdefs.h \
286N/A nss_netdir.h \
286N/A paths.h \
286N/A pcsample.h \
286N/A pfmt.h \
286N/A pkgdev.h \
286N/A pkginfo.h \
286N/A pkglocs.h \
286N/A pkgstrct.h \
286N/A pkgtrans.h \
286N/A poll.h \
286N/A port.h \
286N/A priv.h \
286N/A priv_utils.h \
286N/A proc_service.h \
286N/A procfs.h \
286N/A prof.h \
286N/A project.h \
286N/A pthread.h \
286N/A pw.h \
286N/A pwd.h \
286N/A rctl.h \
286N/A re_comp.h \
286N/A regex.h \
286N/A regexp.h \
286N/A resolv.h \
286N/A rje.h \
286N/A rtld_db.h \
286N/A sac.h \
286N/A sched.h \
286N/A schedctl.h \
286N/A sdssc.h \
286N/A search.h \
286N/A semaphore.h \
286N/A setjmp.h \
286N/A sgtty.h \
286N/A shadow.h \
286N/A siginfo.h \
286N/A signal.h \
286N/A spawn.h \
286N/A stdalign.h \
286N/A stdarg.h \
286N/A stdbool.h \
286N/A stddef.h \
286N/A stdint.h \
286N/A stdio.h \
286N/A stdio_ext.h \
286N/A stdio_tag.h \
286N/A stdio_impl.h \
286N/A stdlib.h \
286N/A stdnoreturn.h \
286N/A storclass.h \
286N/A string.h \
286N/A strings.h \
286N/A stropts.h \
286N/A synch.h \
286N/A sysexits.h \
286N/A syslog.h \
286N/A syms.h \
286N/A tar.h \
286N/A termio.h \
286N/A termios.h \
286N/A tgmath.h \
286N/A thread.h \
286N/A thread_db.h \
286N/A threads.h \
286N/A time.h \
286N/A tiuser.h \
286N/A tzfile.h \
286N/A ucontext.h \
286N/A ucred.h \
286N/A ulimit.h \
286N/A unistd.h \
286N/A userdefs.h \
286N/A ustat.h \
286N/A utime.h \
286N/A utmp.h \
286N/A utmpx.h \
286N/A valtools.h \
286N/A values.h \
286N/A varargs.h \
286N/A wait.h \
286N/A wchar.h \
286N/A wchar_impl.h \
286N/A wctype.h \
286N/A widec.h \
286N/A wordexp.h \
286N/A xlocale.h \
286N/A xti.h \
286N/A xti_inet.h \
286N/A zone.h
286N/A
286N/AISOHDRS = \
286N/A ctype_iso.h \
286N/A limits_iso.h \
286N/A locale_iso.h \
286N/A math_c99.h \
286N/A math_iso.h \
286N/A setjmp_iso.h \
286N/A signal_iso.h \
286N/A stdarg_c99.h \
286N/A stdarg_iso.h \
286N/A stddef_iso.h \
286N/A stdio_c99.h \
286N/A stdio_iso.h \
286N/A stdlib_c99.h \
286N/A stdlib_c11.h \
286N/A stdlib_iso.h \
286N/A string_iso.h \
286N/A time_iso.h \
286N/A wchar_c99.h \
286N/A wchar_iso.h \
286N/A wctype_iso.h
286N/A
286N/AARPAHDRS = \
286N/A ftp.h \
286N/A inet.h \
286N/A nameser.h \
286N/A telnet.h \
286N/A tftp.h \
286N/A nameser_compat.h
286N/A
286N/AAUDIOHDRS = \
286N/A au.h
286N/A
286N/AUUIDHDRS = \
286N/A uuid.h
286N/A
286N/A# rpcsvc headers which are just headers (not derived from a .x file)
286N/ARPCSVC_SRC_HDRS = \
286N/A bootparam.h \
286N/A daemon_utils.h \
286N/A dbm.h \
286N/A nis_db.h \
286N/A nislib.h \
286N/A svc_dg_priv.h \
286N/A yp_prot.h \
286N/A ypclnt.h \
286N/A yppasswd.h \
286N/A ypupd.h \
286N/A rpc_sztypes.h
286N/A
286N/A# rpcsvc headers which are generated from .x files
286N/ARPCSVC_GEN_HDRS = \
286N/A bootparam_prot.h \
286N/A mount.h \
286N/A nfs_prot.h \
286N/A nfs4_prot.h \
286N/A nis.h \
286N/A rex.h \
286N/A rquota.h \
286N/A rstat.h \
286N/A rusers.h \
286N/A rwall.h \
286N/A spray.h \
286N/A ufs_prot.h \
286N/A nfs_acl.h
286N/A
286N/ALVMRPCHDRS = \
286N/Amhdx.h mdiox.h meta_basic.h metad.h metamed.h metamhd.h metacl.h
286N/A
286N/ASYMHDRASSERT = $(ROOT)/usr/include/iso/assert_iso.h
286N/ASYMHDRERRNO = $(ROOT)/usr/include/iso/errno_iso.h
286N/ASYMHDRFLOAT = $(ROOT)/usr/include/iso/float_iso.h
286N/ASYMHDRISO646 = $(ROOT)/usr/include/iso/iso646_iso.h
286N/A
286N/ARPCGENFLAGS = -C -h
286N/Arpcsvc/rwall.h := RPCGENFLAGS += -M
286N/Ameta_basic.h := RPCGENFLAGS += -M
286N/Ametad.h := RPCGENFLAGS += -M
286N/Ametamed.h := RPCGENFLAGS += -M
286N/Amhdx.h := RPCGENFLAGS += -M
286N/Amdiox.h := RPCGENFLAGS += -M
286N/Ametamhd.h := RPCGENFLAGS += -M
286N/Ametacl.h := RPCGENFLAGS += -M
286N/A
286N/A# rpcsvc rpcgen source (.x files)
286N/A#
286N/A# yp.x is an attempt at codifying what was hand coded in RPCL.
286N/A# Unfortunately it doesn't quite work. (The handcoded stuff isn't
286N/A# expressable in RPCL) this is due to the fact that YP was written
286N/A# before rpcgen existed. Hence, yp_prot.h cannot be derived from yp.x
286N/A#
286N/A# There is no `.h' for nis_object.x because it is included by nis.x and
286N/A# the resulting .h is nis.h.
286N/A
286N/ARPCSVCPROTS = \
286N/A$(RPCSVC_GEN_HDRS:%.h=%.x) nis_object.x yp.x
286N/A
286N/ALVMSVCPROTS = \
286N/A$(LVMRPCHDRS:%.h=%.x)
286N/A
286N/ARPCSVCHDRS= $(RPCSVC_SRC_HDRS) $(RPCSVC_GEN_HDRS)
286N/A
286N/APROTOHDRS= dumprestore.h routed.h ripngd.h rwhod.h timed.h
286N/A
286N/AROOTHDRS= $(HDRS:%=$(ROOT)/usr/include/%) \
286N/A $(KRB5HDRS:%=$(ROOT)/usr/include/kerberosv5/%) \
286N/A $(ISOHDRS:%=$(ROOT)/usr/include/iso/%) \
286N/A $(ARPAHDRS:%=$(ROOT)/usr/include/arpa/%) \
286N/A $(AUDIOHDRS:%=$(ROOT)/usr/include/audio/%) \
286N/A $(UUIDHDRS:%=$(ROOT)/usr/include/uuid/%) \
286N/A $(RPCSVCHDRS:%=$(ROOT)/usr/include/rpcsvc/%) \
286N/A $(RPCSVCPROTS:%=$(ROOT)/usr/include/rpcsvc/%) \
286N/A $(LVMRPCHDRS:%=$(ROOT)/usr/include/%) \
286N/A $(PROTOHDRS:%=$(ROOT)/usr/include/protocols/%)
286N/A
286N/ADIRS= iso arpa audio rpcsvc protocols security uuid kerberosv5
286N/AROOTDIRS= $(DIRS:%=$(ROOT)/usr/include/%)
286N/A
286N/A# check files really don't exist
286N/A#
286N/A# should do something with the rpcsvc headers
286N/A
286N/Aiso/%.check: iso/%.h
286N/A $(DOT_H_CHECK)
286N/A
286N/Aarpa/%.check: arpa/%.h
286N/A $(DOT_H_CHECK)
286N/A
286N/Aaudio/%.check: audio/%.h
286N/A $(DOT_H_CHECK)
286N/A
286N/Arpcsvc/%.check: rpcsvc/%.h
286N/A $(DOT_H_CHECK)
286N/A
286N/Arpcsvc/%.check: rpcsvc/%.x
286N/A $(DOT_X_CHECK)
286N/A
286N/Aprotocols/%.check: protocols/%.h
286N/A $(DOT_H_CHECK)
286N/A
286N/Akerberosv5/%.check: kerberosv5/%.h
286N/A $(DOT_H_CHECK)
286N/A
286N/Auuid/%.check: uuid/%.h
286N/A $(DOT_H_CHECK)
286N/A
286N/A# Note that the derived headers (rpcgen) are not checked at this time. These
286N/A# need work at the source level and rpcgen itself has a bug which causes a
286N/A# cstyle violation. Furthermore, there seems to be good reasons for the
286N/A# generated headers to not pass all of the hdrchk rules.
286N/A#
286N/A# Add the following to the CHECKHDRS list to activate the .x checks:
286N/A# $(RPCSVCPROTS:%.x=rpcsvc/%.check) \
286N/A#
286N/ACHECKHDRS= $(HDRS:%.h=%.check) \
286N/A $(KRB5HDRS:%.h=kerberosv5/%.check) \
286N/A $(ISOHDRS:%.h=iso/%.check) \
286N/A $(ARPAHDRS:%.h=arpa/%.check) \
286N/A $(AUDIOHDRS:%.h=audio/%.check) \
286N/A $(UUIDHDRS:%.h=uuid/%.check) \
286N/A $(RPCSVC_SRC_HDRS:%.h=rpcsvc/%.check) \
286N/A $(PROTOHDRS:%.h=protocols/%.check)
286N/A
286N/A# headers which won't quite meet the standards...
286N/A#
286N/A# assert.h is required by ansi-c to *not* be idempotent (section 4.1.2).
286N/A# Hence the trailing guard is not the last thing in the file nor can it
286N/A# be without playing silly games.
286N/A
286N/Aassert.check := HDRCHK_TAIL = | grep -v "end guard wrong" | true
286N/A
286N/A# install rules
286N/A
286N/A$(ROOT)/usr/include/security/%: security/%
286N/A $(INS.file)
286N/A
286N/A$(ROOT)/usr/include/protocols/%: protocols/%
286N/A $(INS.file)
286N/A
286N/A$(ROOT)/usr/include/rpcsvc/%: rpcsvc/%
286N/A $(INS.file)
286N/A
286N/A$(ROOT)/usr/include/kerberosv5/%: kerberosv5/%
286N/A $(INS.file)
286N/A
286N/A$(ROOT)/usr/include/arpa/%: arpa/%
286N/A $(INS.file)
286N/A
286N/A$(ROOT)/usr/include/audio/%: audio/%
286N/A $(INS.file)
286N/A
286N/A$(ROOT)/usr/include/iso/%: iso/%
286N/A $(INS.file)
286N/A
286N/A$(ROOT)/usr/include/uuid/%: uuid/%
286N/A $(INS.file)
286N/A
286N/A$(ROOT)/usr/include/%: %
286N/A $(INS.file)
286N/A
286N/A.KEEP_STATE:
286N/A
286N/A.PARALLEL: $(ROOTHDRS) $(CHECKHDRS)
286N/A
286N/Ainstall_h: $(ROOTDIRS) .WAIT $(ROOTHDRS) $(SYMHDRASSERT) $(SYMHDRERRNO) \
286N/A $(SYMHDRFLOAT) $(SYMHDRISO646)
286N/A
286N/Acheck: $(CHECKHDRS)
286N/A
286N/Aclean clobber:
286N/A $(RM) $(LVMRPCHDRS);
286N/A cd rpcsvc ; $(RM) $(RPCSVC_GEN_HDRS)
286N/A
286N/A$(ROOTDIRS):
286N/A $(INS.dir)
286N/A
286N/A$(SYMHDRASSERT):
286N/A -$(RM) $@; $(SYMLINK) ../assert.h $@
286N/A
286N/A$(SYMHDRERRNO):
286N/A -$(RM) $@; $(SYMLINK) ../errno.h $@
286N/A
286N/A$(SYMHDRFLOAT):
286N/A -$(RM) $@; $(SYMLINK) ../float.h $@
286N/A
286N/A$(SYMHDRISO646):
286N/A -$(RM) $@; $(SYMLINK) ../iso646.h $@
286N/A
286N/Arpcsvc/%.h: rpcsvc/%.x
286N/A $(RPCGEN) $(RPCGENFLAGS) $< -o $@
286N/A
286N/Arpcsvc/nis.h: rpcsvc/nis.x
286N/A $(RPCGEN) $(RPCGENFLAGS) rpcsvc/nis.x |\
286N/A $(SED) -e '/EDIT_START/,$$ d' > $@
286N/A
286N/Ameta_basic.h: ../uts/common/sys/lvm/meta_basic.x
286N/A $(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/meta_basic.x | \
286N/A $(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
286N/A /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
286N/A { print $0 } \
286N/A ' > $@
286N/A
286N/Ametad.h: metad.x
286N/A $(RPCGEN) $(RPCGENFLAGS) metad.x | \
286N/A $(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
286N/A /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
286N/A { print $0 } \
286N/A ' > $@
286N/A
286N/Amhdx.h: ../uts/common/sys/lvm/mhdx.x
286N/A $(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/mhdx.x | \
286N/A $(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
286N/A /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
286N/A { print $0 } \
286N/A ' > $@
286N/A
286N/Amdiox.h: ../uts/common/sys/lvm/mdiox.x
286N/A $(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/mdiox.x | \
286N/A $(AWK) '{sub(/sys\/lvm\/md_mhdx/, "mhdx"); print $$0}' | \
286N/A $(AWK) '{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
286N/A $(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
286N/A /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
286N/A { print $0 } \
286N/A ' > $@
286N/A
286N/Ametamed.h: ../uts/common/sys/lvm/metamed.x
286N/A $(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/metamed.x | \
286N/A $(AWK) '{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
286N/A $(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
286N/A /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
286N/A { print $0 } \
286N/A ' > $@
286N/A
286N/Ametamhd.h: metamhd.x
286N/A $(RPCGEN) $(RPCGENFLAGS) metamhd.x | \
286N/A $(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
286N/A /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
286N/A { print $0 } \
286N/A ' > $@
286N/A
286N/Ametacl.h: metacl.x
286N/A $(RPCGEN) $(RPCGENFLAGS) metacl.x | \
286N/A $(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
286N/A /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
286N/A { print $0 } \
286N/A ' > $@
286N/A