xref: /titanic_52/usr/src/head/Makefile (revision 4cb69ecc9330774c8f56042ac933503123f50a85)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5734b6a94Sdarrenm# Common Development and Distribution License (the "License").
6734b6a94Sdarrenm# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
2225c28e83SPiotr Jasiukajtis# Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
2325c28e83SPiotr Jasiukajtis#
246e91bba0SGirish Moodalbail# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
257c478bd9Sstevel@tonic-gate# Use is subject to license terms.
267c478bd9Sstevel@tonic-gate#
272d08521bSGarrett D'Amore# Copyright 2013 Garrett D'Amore <garrett@damore.org>
28*4cb69eccSIgor Kozhukhov# Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
292d08521bSGarrett D'Amore#
307c478bd9Sstevel@tonic-gate# head/Makefile
317c478bd9Sstevel@tonic-gate#
327c478bd9Sstevel@tonic-gate# include global definitions
337c478bd9Sstevel@tonic-gateinclude ../Makefile.master
347c478bd9Sstevel@tonic-gate
357c478bd9Sstevel@tonic-gatesparc_HDRS=
367c478bd9Sstevel@tonic-gatei386_HDRS=	stack_unwind.h
377c478bd9Sstevel@tonic-gate
387c478bd9Sstevel@tonic-gate# Headers are listed one per line so that TeamWare can auto-merge most changes
397c478bd9Sstevel@tonic-gate
407c478bd9Sstevel@tonic-gateKRB5HDRS= mit_copyright.h mit-sipb-copyright.h
417c478bd9Sstevel@tonic-gate
427c478bd9Sstevel@tonic-gateATTRDB_HDRS=	secdb.h auth_attr.h exec_attr.h prof_attr.h user_attr.h \
437c478bd9Sstevel@tonic-gate	auth_list.h
447c478bd9Sstevel@tonic-gate
457c478bd9Sstevel@tonic-gateHDRS=   $($(MACH)_HDRS)  $(ATTRDB_HDRS) \
467c478bd9Sstevel@tonic-gate	aio.h		\
477c478bd9Sstevel@tonic-gate	alloca.h	\
487c478bd9Sstevel@tonic-gate	apptrace.h	\
497c478bd9Sstevel@tonic-gate	apptrace_impl.h	\
507c478bd9Sstevel@tonic-gate	ar.h		\
517c478bd9Sstevel@tonic-gate	archives.h	\
527c478bd9Sstevel@tonic-gate	assert.h	\
537c478bd9Sstevel@tonic-gate	atomic.h	\
54da6c28aaSamw	attr.h		\
5525c28e83SPiotr Jasiukajtis	complex.h	\
567c478bd9Sstevel@tonic-gate	config_admin.h	\
577c478bd9Sstevel@tonic-gate	cpio.h		\
587c478bd9Sstevel@tonic-gate	crypt.h		\
597c478bd9Sstevel@tonic-gate	ctype.h		\
607c478bd9Sstevel@tonic-gate	deflt.h		\
617c478bd9Sstevel@tonic-gate	devid.h		\
627c478bd9Sstevel@tonic-gate	devmgmt.h	\
637c478bd9Sstevel@tonic-gate	devpoll.h	\
647c478bd9Sstevel@tonic-gate	dial.h		\
657c478bd9Sstevel@tonic-gate	dirent.h	\
667c478bd9Sstevel@tonic-gate	dlfcn.h		\
677c478bd9Sstevel@tonic-gate	door.h		\
687c478bd9Sstevel@tonic-gate	elf.h		\
69d362b749Svk199839	err.h		\
707c478bd9Sstevel@tonic-gate	errno.h		\
717c478bd9Sstevel@tonic-gate	euc.h		\
727c478bd9Sstevel@tonic-gate	exacct.h	\
737c478bd9Sstevel@tonic-gate	exacct_impl.h	\
74f151e4bfSbarts	execinfo.h	\
757c478bd9Sstevel@tonic-gate	fatal.h		\
767c478bd9Sstevel@tonic-gate	fcntl.h		\
7725c28e83SPiotr Jasiukajtis	fenv.h		\
787c478bd9Sstevel@tonic-gate	float.h		\
7925c28e83SPiotr Jasiukajtis	floatingpoint.h	\
807c478bd9Sstevel@tonic-gate	fmtmsg.h	\
817c478bd9Sstevel@tonic-gate	fnmatch.h	\
827c478bd9Sstevel@tonic-gate	ftw.h		\
837c478bd9Sstevel@tonic-gate	gelf.h		\
847c478bd9Sstevel@tonic-gate	getopt.h	\
857c478bd9Sstevel@tonic-gate	getwidth.h	\
867c478bd9Sstevel@tonic-gate	glob.h		\
877c478bd9Sstevel@tonic-gate	grp.h		\
887c478bd9Sstevel@tonic-gate	iconv.h		\
897c478bd9Sstevel@tonic-gate	ieeefp.h	\
906e91bba0SGirish Moodalbail	ifaddrs.h	\
917c478bd9Sstevel@tonic-gate	inttypes.h	\
927c478bd9Sstevel@tonic-gate	iso646.h	\
93ddf7fe95Scasper	klpd.h		\
947c478bd9Sstevel@tonic-gate	langinfo.h	\
957c478bd9Sstevel@tonic-gate	lastlog.h	\
967c478bd9Sstevel@tonic-gate	lber.h		\
977c478bd9Sstevel@tonic-gate	ldap.h		\
987c478bd9Sstevel@tonic-gate	libelf.h	\
997c478bd9Sstevel@tonic-gate	libgen.h	\
1007c478bd9Sstevel@tonic-gate	libintl.h	\
1017c478bd9Sstevel@tonic-gate	libw.h		\
1027c478bd9Sstevel@tonic-gate	libzonecfg.h	\
1037c478bd9Sstevel@tonic-gate	limits.h	\
1047c478bd9Sstevel@tonic-gate	linenum.h	\
1057c478bd9Sstevel@tonic-gate	link.h		\
1067c478bd9Sstevel@tonic-gate	listen.h	\
1077c478bd9Sstevel@tonic-gate	locale.h	\
1087c478bd9Sstevel@tonic-gate	macros.h	\
1097c478bd9Sstevel@tonic-gate	malloc.h	\
11025c28e83SPiotr Jasiukajtis	math.h		\
1117c478bd9Sstevel@tonic-gate	mdmn_changelog.h	\
1127c478bd9Sstevel@tonic-gate	memory.h	\
1137c478bd9Sstevel@tonic-gate	meta.h		\
1147c478bd9Sstevel@tonic-gate	meta_runtime.h	\
1157c478bd9Sstevel@tonic-gate	metadyn.h	\
1167c478bd9Sstevel@tonic-gate	mon.h		\
1177c478bd9Sstevel@tonic-gate	monetary.h	\
1187c478bd9Sstevel@tonic-gate	mp.h		\
1197c478bd9Sstevel@tonic-gate	mqueue.h	\
1207c478bd9Sstevel@tonic-gate	nan.h		\
1217c478bd9Sstevel@tonic-gate	ndbm.h		\
122cc52cd5bSapersson	ndpd.h		\
1237c478bd9Sstevel@tonic-gate	netconfig.h	\
1247c478bd9Sstevel@tonic-gate	netdb.h		\
1257c478bd9Sstevel@tonic-gate	netdir.h	\
1267c478bd9Sstevel@tonic-gate	nl_types.h	\
1277c478bd9Sstevel@tonic-gate	nlist.h		\
1287c478bd9Sstevel@tonic-gate	note.h		\
129fcf3ce44SJohn Forte	nsctl.h		\
1307c478bd9Sstevel@tonic-gate	nsswitch.h	\
1317c478bd9Sstevel@tonic-gate	nss_common.h	\
1327c478bd9Sstevel@tonic-gate	nss_dbdefs.h	\
1337c478bd9Sstevel@tonic-gate	nss_netdir.h	\
134686c0471SRichard Lowe	paths.h		\
1357c478bd9Sstevel@tonic-gate	pcsample.h	\
1367c478bd9Sstevel@tonic-gate	pfmt.h		\
1377c478bd9Sstevel@tonic-gate	pkgdev.h	\
1387c478bd9Sstevel@tonic-gate	pkginfo.h	\
1397c478bd9Sstevel@tonic-gate	pkglocs.h	\
1407c478bd9Sstevel@tonic-gate	pkgstrct.h	\
1417c478bd9Sstevel@tonic-gate	pkgtrans.h	\
1427c478bd9Sstevel@tonic-gate	poll.h		\
1437c478bd9Sstevel@tonic-gate	port.h		\
1447c478bd9Sstevel@tonic-gate	priv.h		\
1457c478bd9Sstevel@tonic-gate	priv_utils.h	\
1467c478bd9Sstevel@tonic-gate	proc_service.h	\
1477c478bd9Sstevel@tonic-gate	procfs.h	\
1487c478bd9Sstevel@tonic-gate	prof.h		\
1497c478bd9Sstevel@tonic-gate	project.h	\
1507c478bd9Sstevel@tonic-gate	pthread.h	\
1517c478bd9Sstevel@tonic-gate	pw.h		\
1527c478bd9Sstevel@tonic-gate	pwd.h		\
1537c478bd9Sstevel@tonic-gate	rctl.h		\
1547c478bd9Sstevel@tonic-gate	re_comp.h	\
1557c478bd9Sstevel@tonic-gate	regex.h		\
1567c478bd9Sstevel@tonic-gate	regexp.h	\
1577c478bd9Sstevel@tonic-gate	resolv.h	\
1587c478bd9Sstevel@tonic-gate	rje.h		\
1597c478bd9Sstevel@tonic-gate	rtld_db.h	\
1607c478bd9Sstevel@tonic-gate	sac.h		\
1617c478bd9Sstevel@tonic-gate	sched.h		\
1627c478bd9Sstevel@tonic-gate	schedctl.h	\
1637c478bd9Sstevel@tonic-gate	sdssc.h		\
1647c478bd9Sstevel@tonic-gate	search.h	\
1657c478bd9Sstevel@tonic-gate	semaphore.h	\
1667c478bd9Sstevel@tonic-gate	setjmp.h	\
1677c478bd9Sstevel@tonic-gate	sgtty.h		\
1687c478bd9Sstevel@tonic-gate	shadow.h	\
1697c478bd9Sstevel@tonic-gate	siginfo.h	\
1707c478bd9Sstevel@tonic-gate	signal.h	\
1717c478bd9Sstevel@tonic-gate	spawn.h		\
1727c478bd9Sstevel@tonic-gate	stdarg.h	\
1737c478bd9Sstevel@tonic-gate	stdbool.h	\
1747c478bd9Sstevel@tonic-gate	stddef.h	\
1757c478bd9Sstevel@tonic-gate	stdint.h	\
1767c478bd9Sstevel@tonic-gate	stdio.h		\
1777c478bd9Sstevel@tonic-gate	stdio_ext.h	\
1787c478bd9Sstevel@tonic-gate	stdio_tag.h	\
1797c478bd9Sstevel@tonic-gate	stdio_impl.h	\
1807c478bd9Sstevel@tonic-gate	stdlib.h	\
1817c478bd9Sstevel@tonic-gate	storclass.h	\
1827c478bd9Sstevel@tonic-gate	string.h	\
1837c478bd9Sstevel@tonic-gate	strings.h	\
1847c478bd9Sstevel@tonic-gate	stropts.h	\
1857c478bd9Sstevel@tonic-gate	synch.h		\
1867c478bd9Sstevel@tonic-gate	sysexits.h	\
1877c478bd9Sstevel@tonic-gate	syslog.h	\
1887c478bd9Sstevel@tonic-gate	syms.h		\
1897c478bd9Sstevel@tonic-gate	tar.h		\
1907c478bd9Sstevel@tonic-gate	termio.h	\
1917c478bd9Sstevel@tonic-gate	termios.h	\
19225c28e83SPiotr Jasiukajtis	tgmath.h	\
1937c478bd9Sstevel@tonic-gate	thread.h	\
1947c478bd9Sstevel@tonic-gate	thread_db.h	\
1957c478bd9Sstevel@tonic-gate	time.h		\
1967c478bd9Sstevel@tonic-gate	tiuser.h	\
1977c478bd9Sstevel@tonic-gate	tzfile.h	\
1987c478bd9Sstevel@tonic-gate	ucontext.h	\
1997c478bd9Sstevel@tonic-gate	ucred.h		\
2007c478bd9Sstevel@tonic-gate	ulimit.h	\
2017c478bd9Sstevel@tonic-gate	unistd.h	\
2027c478bd9Sstevel@tonic-gate	userdefs.h	\
2037c478bd9Sstevel@tonic-gate	ustat.h		\
2047c478bd9Sstevel@tonic-gate	utime.h		\
2057c478bd9Sstevel@tonic-gate	utmp.h		\
2067c478bd9Sstevel@tonic-gate	utmpx.h		\
2077c478bd9Sstevel@tonic-gate	valtools.h	\
2087c478bd9Sstevel@tonic-gate	values.h	\
2097c478bd9Sstevel@tonic-gate	varargs.h	\
2107c478bd9Sstevel@tonic-gate	wait.h		\
2117c478bd9Sstevel@tonic-gate	wchar.h		\
2127c478bd9Sstevel@tonic-gate	wchar_impl.h	\
2137c478bd9Sstevel@tonic-gate	wctype.h	\
2147c478bd9Sstevel@tonic-gate	widec.h		\
2157c478bd9Sstevel@tonic-gate	wordexp.h	\
2162d08521bSGarrett D'Amore	xlocale.h	\
2177c478bd9Sstevel@tonic-gate	xti.h		\
2187c478bd9Sstevel@tonic-gate	xti_inet.h	\
2197c478bd9Sstevel@tonic-gate	zone.h
2207c478bd9Sstevel@tonic-gate
2217c478bd9Sstevel@tonic-gateISOHDRS = \
2227c478bd9Sstevel@tonic-gate	ctype_iso.h	\
2237c478bd9Sstevel@tonic-gate	limits_iso.h	\
2247c478bd9Sstevel@tonic-gate	locale_iso.h	\
22525c28e83SPiotr Jasiukajtis	math_c99.h	\
22625c28e83SPiotr Jasiukajtis	math_iso.h	\
2277c478bd9Sstevel@tonic-gate	setjmp_iso.h  	\
2287c478bd9Sstevel@tonic-gate	signal_iso.h	\
2297c478bd9Sstevel@tonic-gate	stdarg_c99.h	\
2307c478bd9Sstevel@tonic-gate	stdarg_iso.h	\
2317c478bd9Sstevel@tonic-gate	stddef_iso.h	\
2327c478bd9Sstevel@tonic-gate	stdio_c99.h	\
2337c478bd9Sstevel@tonic-gate	stdio_iso.h	\
2347c478bd9Sstevel@tonic-gate	stdlib_c99.h	\
2357c478bd9Sstevel@tonic-gate	stdlib_iso.h	\
2367c478bd9Sstevel@tonic-gate	string_iso.h	\
2377c478bd9Sstevel@tonic-gate	time_iso.h	\
2387c478bd9Sstevel@tonic-gate	wchar_c99.h	\
2397c478bd9Sstevel@tonic-gate	wchar_iso.h	\
2407c478bd9Sstevel@tonic-gate	wctype_iso.h
2417c478bd9Sstevel@tonic-gate
2427c478bd9Sstevel@tonic-gateARPAHDRS = 		\
2437c478bd9Sstevel@tonic-gate	ftp.h		\
2447c478bd9Sstevel@tonic-gate	inet.h		\
2457c478bd9Sstevel@tonic-gate	nameser.h	\
2467c478bd9Sstevel@tonic-gate	telnet.h	\
2477c478bd9Sstevel@tonic-gate	tftp.h		\
2487c478bd9Sstevel@tonic-gate	nameser_compat.h
2497c478bd9Sstevel@tonic-gate
2507c478bd9Sstevel@tonic-gateAUDIOHDRS =		\
2517c478bd9Sstevel@tonic-gate	au.h
2527c478bd9Sstevel@tonic-gate
2537c478bd9Sstevel@tonic-gateUUIDHDRS =		\
2547c478bd9Sstevel@tonic-gate	uuid.h
2557c478bd9Sstevel@tonic-gate
2567c478bd9Sstevel@tonic-gate# rpcsvc headers which are just headers (not derived from a .x file)
2577c478bd9Sstevel@tonic-gateRPCSVC_SRC_HDRS =	\
2587c478bd9Sstevel@tonic-gate	bootparam.h	\
2597c478bd9Sstevel@tonic-gate	daemon_utils.h	\
2607c478bd9Sstevel@tonic-gate	dbm.h		\
2617c478bd9Sstevel@tonic-gate	nis_db.h	\
2627c478bd9Sstevel@tonic-gate	nislib.h	\
263f48205beScasper	svc_dg_priv.h	\
2647c478bd9Sstevel@tonic-gate	yp_prot.h	\
2657c478bd9Sstevel@tonic-gate	ypclnt.h	\
2667c478bd9Sstevel@tonic-gate	yppasswd.h	\
2677c478bd9Sstevel@tonic-gate	ypupd.h		\
2687c478bd9Sstevel@tonic-gate	rpc_sztypes.h
2697c478bd9Sstevel@tonic-gate
2707c478bd9Sstevel@tonic-gate# rpcsvc headers which are generated from .x files
2717c478bd9Sstevel@tonic-gateRPCSVC_GEN_HDRS = \
2727c478bd9Sstevel@tonic-gate	bootparam_prot.h \
2737c478bd9Sstevel@tonic-gate	mount.h		\
2747c478bd9Sstevel@tonic-gate	nfs_prot.h	\
2757c478bd9Sstevel@tonic-gate	nfs4_prot.h	\
2767c478bd9Sstevel@tonic-gate	nis.h		\
2777c478bd9Sstevel@tonic-gate	rex.h		\
2787c478bd9Sstevel@tonic-gate	rquota.h	\
2797c478bd9Sstevel@tonic-gate	rstat.h		\
2807c478bd9Sstevel@tonic-gate	rusers.h	\
2817c478bd9Sstevel@tonic-gate	rwall.h		\
2827c478bd9Sstevel@tonic-gate	spray.h		\
2837c478bd9Sstevel@tonic-gate	ufs_prot.h	\
2847c478bd9Sstevel@tonic-gate	nfs_acl.h
2857c478bd9Sstevel@tonic-gate
2867c478bd9Sstevel@tonic-gateLVMRPCHDRS = \
2877c478bd9Sstevel@tonic-gatemhdx.h mdiox.h meta_basic.h metad.h metamed.h metamhd.h metacl.h
2887c478bd9Sstevel@tonic-gate
2897c478bd9Sstevel@tonic-gateSYMHDRASSERT = $(ROOT)/usr/include/iso/assert_iso.h
2907c478bd9Sstevel@tonic-gateSYMHDRERRNO = $(ROOT)/usr/include/iso/errno_iso.h
2917c478bd9Sstevel@tonic-gateSYMHDRFLOAT = $(ROOT)/usr/include/iso/float_iso.h
2927c478bd9Sstevel@tonic-gateSYMHDRISO646 = $(ROOT)/usr/include/iso/iso646_iso.h
2937c478bd9Sstevel@tonic-gate
2947c478bd9Sstevel@tonic-gateRPCGENFLAGS = -C -h
2957c478bd9Sstevel@tonic-gaterpcsvc/rwall.h :=	RPCGENFLAGS += -M
2967c478bd9Sstevel@tonic-gatemeta_basic.h :=	RPCGENFLAGS += -M
2977c478bd9Sstevel@tonic-gatemetad.h := RPCGENFLAGS += -M
2987c478bd9Sstevel@tonic-gatemetamed.h := RPCGENFLAGS += -M
2997c478bd9Sstevel@tonic-gatemhdx.h := RPCGENFLAGS += -M
3007c478bd9Sstevel@tonic-gatemdiox.h := RPCGENFLAGS += -M
3017c478bd9Sstevel@tonic-gatemetamhd.h := RPCGENFLAGS += -M
3027c478bd9Sstevel@tonic-gatemetacl.h := RPCGENFLAGS += -M
3037c478bd9Sstevel@tonic-gate
3047c478bd9Sstevel@tonic-gate# rpcsvc rpcgen source (.x files)
3057c478bd9Sstevel@tonic-gate#
3067c478bd9Sstevel@tonic-gate# yp.x is an attempt at codifying what was hand coded in RPCL.
3077c478bd9Sstevel@tonic-gate# Unfortunately it doesn't quite work. (The handcoded stuff isn't
3087c478bd9Sstevel@tonic-gate# expressable in RPCL) this is due to the fact that YP was written
3097c478bd9Sstevel@tonic-gate# before rpcgen existed.  Hence, yp_prot.h cannot be derived from yp.x
3107c478bd9Sstevel@tonic-gate#
3117c478bd9Sstevel@tonic-gate# There is no `.h' for nis_object.x because it is included by nis.x and
3127c478bd9Sstevel@tonic-gate# the resulting .h is nis.h.
3137c478bd9Sstevel@tonic-gate
3147c478bd9Sstevel@tonic-gateRPCSVCPROTS = \
3157c478bd9Sstevel@tonic-gate$(RPCSVC_GEN_HDRS:%.h=%.x)        nis_object.x       yp.x
3167c478bd9Sstevel@tonic-gate
3177c478bd9Sstevel@tonic-gateLVMSVCPROTS = \
3187c478bd9Sstevel@tonic-gate$(LVMRPCHDRS:%.h=%.x)
3197c478bd9Sstevel@tonic-gate
3207c478bd9Sstevel@tonic-gateRPCSVCHDRS= $(RPCSVC_SRC_HDRS) $(RPCSVC_GEN_HDRS)
3217c478bd9Sstevel@tonic-gate
322cc52cd5bSaperssonPROTOHDRS=   dumprestore.h routed.h ripngd.h rwhod.h timed.h
3237c478bd9Sstevel@tonic-gate
3247c478bd9Sstevel@tonic-gateROOTHDRS= $(HDRS:%=$(ROOT)/usr/include/%)  \
3257c478bd9Sstevel@tonic-gate	$(KRB5HDRS:%=$(ROOT)/usr/include/kerberosv5/%)  \
3267c478bd9Sstevel@tonic-gate	$(ISOHDRS:%=$(ROOT)/usr/include/iso/%)  \
3277c478bd9Sstevel@tonic-gate	$(ARPAHDRS:%=$(ROOT)/usr/include/arpa/%)  \
3287c478bd9Sstevel@tonic-gate	$(AUDIOHDRS:%=$(ROOT)/usr/include/audio/%)  \
3297c478bd9Sstevel@tonic-gate	$(UUIDHDRS:%=$(ROOT)/usr/include/uuid/%)  \
3307c478bd9Sstevel@tonic-gate	$(RPCSVCHDRS:%=$(ROOT)/usr/include/rpcsvc/%)  \
3317c478bd9Sstevel@tonic-gate	$(RPCSVCPROTS:%=$(ROOT)/usr/include/rpcsvc/%)  \
3327c478bd9Sstevel@tonic-gate	$(LVMRPCHDRS:%=$(ROOT)/usr/include/%) \
3337c478bd9Sstevel@tonic-gate	$(PROTOHDRS:%=$(ROOT)/usr/include/protocols/%)
3347c478bd9Sstevel@tonic-gate
3357c478bd9Sstevel@tonic-gateDIRS= iso arpa audio rpcsvc protocols security uuid kerberosv5
3367c478bd9Sstevel@tonic-gateROOTDIRS= $(DIRS:%=$(ROOT)/usr/include/%)
3377c478bd9Sstevel@tonic-gate
3387c478bd9Sstevel@tonic-gate# check files really don't exist
3397c478bd9Sstevel@tonic-gate#
3407c478bd9Sstevel@tonic-gate# should do something with the rpcsvc headers
3417c478bd9Sstevel@tonic-gate
3427c478bd9Sstevel@tonic-gateiso/%.check:		iso/%.h
3437c478bd9Sstevel@tonic-gate	$(DOT_H_CHECK)
3447c478bd9Sstevel@tonic-gate
3457c478bd9Sstevel@tonic-gatearpa/%.check:		arpa/%.h
3467c478bd9Sstevel@tonic-gate	$(DOT_H_CHECK)
3477c478bd9Sstevel@tonic-gate
3487c478bd9Sstevel@tonic-gateaudio/%.check:		audio/%.h
3497c478bd9Sstevel@tonic-gate	$(DOT_H_CHECK)
3507c478bd9Sstevel@tonic-gate
3517c478bd9Sstevel@tonic-gaterpcsvc/%.check:		rpcsvc/%.h
3527c478bd9Sstevel@tonic-gate	$(DOT_H_CHECK)
3537c478bd9Sstevel@tonic-gate
3547c478bd9Sstevel@tonic-gaterpcsvc/%.check:		rpcsvc/%.x
3557c478bd9Sstevel@tonic-gate	$(DOT_X_CHECK)
3567c478bd9Sstevel@tonic-gate
3577c478bd9Sstevel@tonic-gateprotocols/%.check:	protocols/%.h
3587c478bd9Sstevel@tonic-gate	$(DOT_H_CHECK)
3597c478bd9Sstevel@tonic-gate
3607c478bd9Sstevel@tonic-gatekerberosv5/%.check:             kerberosv5/%.h
3617c478bd9Sstevel@tonic-gate	$(DOT_H_CHECK)
3627c478bd9Sstevel@tonic-gate
3637c478bd9Sstevel@tonic-gateuuid/%.check:		uuid/%.h
3647c478bd9Sstevel@tonic-gate	$(DOT_H_CHECK)
3657c478bd9Sstevel@tonic-gate
3667c478bd9Sstevel@tonic-gate# Note that the derived headers (rpcgen) are not checked at this time.  These
3677c478bd9Sstevel@tonic-gate# need work at the source level and rpcgen itself has a bug which causes a
3687c478bd9Sstevel@tonic-gate# cstyle violation.  Furthermore, there seems to be good reasons for the
3697c478bd9Sstevel@tonic-gate# generated headers to not pass all of the hdrchk rules.
3707c478bd9Sstevel@tonic-gate#
3717c478bd9Sstevel@tonic-gate# Add the following to the CHECKHDRS list to activate the .x checks:
3727c478bd9Sstevel@tonic-gate#	$(RPCSVCPROTS:%.x=rpcsvc/%.check) \
3737c478bd9Sstevel@tonic-gate#
3747c478bd9Sstevel@tonic-gateCHECKHDRS= $(HDRS:%.h=%.check)  \
3757c478bd9Sstevel@tonic-gate	$(KRB5HDRS:%.h=kerberosv5/%.check)  \
3767c478bd9Sstevel@tonic-gate	$(ISOHDRS:%.h=iso/%.check)  \
3777c478bd9Sstevel@tonic-gate	$(ARPAHDRS:%.h=arpa/%.check)  \
3787c478bd9Sstevel@tonic-gate	$(AUDIOHDRS:%.h=audio/%.check)  \
3797c478bd9Sstevel@tonic-gate	$(UUIDHDRS:%.h=uuid/%.check)  \
3807c478bd9Sstevel@tonic-gate	$(RPCSVC_SRC_HDRS:%.h=rpcsvc/%.check) \
3817c478bd9Sstevel@tonic-gate	$(PROTOHDRS:%.h=protocols/%.check)
3827c478bd9Sstevel@tonic-gate
3837c478bd9Sstevel@tonic-gate# headers which won't quite meet the standards...
3847c478bd9Sstevel@tonic-gate#
3857c478bd9Sstevel@tonic-gate# assert.h is required by ansi-c to *not* be idempotent (section 4.1.2).
3867c478bd9Sstevel@tonic-gate# Hence the trailing guard is not the last thing in the file nor can it
3877c478bd9Sstevel@tonic-gate# be without playing silly games.
3887c478bd9Sstevel@tonic-gate
3897c478bd9Sstevel@tonic-gateassert.check	:= HDRCHK_TAIL = | grep -v "end guard wrong" | true
3907c478bd9Sstevel@tonic-gate
3917c478bd9Sstevel@tonic-gate# install rules
3927c478bd9Sstevel@tonic-gate
3937c478bd9Sstevel@tonic-gate$(ROOT)/usr/include/security/%: security/%
3947c478bd9Sstevel@tonic-gate	$(INS.file)
3957c478bd9Sstevel@tonic-gate
3967c478bd9Sstevel@tonic-gate$(ROOT)/usr/include/protocols/%: protocols/%
3977c478bd9Sstevel@tonic-gate	$(INS.file)
3987c478bd9Sstevel@tonic-gate
3997c478bd9Sstevel@tonic-gate$(ROOT)/usr/include/rpcsvc/%: rpcsvc/%
4007c478bd9Sstevel@tonic-gate	$(INS.file)
4017c478bd9Sstevel@tonic-gate
4027c478bd9Sstevel@tonic-gate$(ROOT)/usr/include/kerberosv5/%: kerberosv5/%
4037c478bd9Sstevel@tonic-gate	$(INS.file)
4047c478bd9Sstevel@tonic-gate
4057c478bd9Sstevel@tonic-gate$(ROOT)/usr/include/arpa/%: arpa/%
4067c478bd9Sstevel@tonic-gate	$(INS.file)
4077c478bd9Sstevel@tonic-gate
4087c478bd9Sstevel@tonic-gate$(ROOT)/usr/include/audio/%: audio/%
4097c478bd9Sstevel@tonic-gate	$(INS.file)
4107c478bd9Sstevel@tonic-gate
4117c478bd9Sstevel@tonic-gate$(ROOT)/usr/include/iso/%: iso/%
4127c478bd9Sstevel@tonic-gate	$(INS.file)
4137c478bd9Sstevel@tonic-gate
4147c478bd9Sstevel@tonic-gate$(ROOT)/usr/include/uuid/%: uuid/%
4157c478bd9Sstevel@tonic-gate	$(INS.file)
4167c478bd9Sstevel@tonic-gate
4177c478bd9Sstevel@tonic-gate$(ROOT)/usr/include/%: %
4187c478bd9Sstevel@tonic-gate	$(INS.file)
4197c478bd9Sstevel@tonic-gate
4207c478bd9Sstevel@tonic-gate.KEEP_STATE:
4217c478bd9Sstevel@tonic-gate
4227c478bd9Sstevel@tonic-gate.PARALLEL:	$(ROOTHDRS) $(CHECKHDRS)
4237c478bd9Sstevel@tonic-gate
4247c478bd9Sstevel@tonic-gateinstall_h: 	$(ROOTDIRS) .WAIT $(ROOTHDRS) $(SYMHDRASSERT) $(SYMHDRERRNO) \
4257c478bd9Sstevel@tonic-gate		$(SYMHDRFLOAT) $(SYMHDRISO646)
4267c478bd9Sstevel@tonic-gate
4277c478bd9Sstevel@tonic-gatecheck:	$(CHECKHDRS)
4287c478bd9Sstevel@tonic-gate
4297c478bd9Sstevel@tonic-gateclean clobber:
4307c478bd9Sstevel@tonic-gate	$(RM) $(LVMRPCHDRS);
4317c478bd9Sstevel@tonic-gate	cd rpcsvc ; $(RM) $(RPCSVC_GEN_HDRS)
4327c478bd9Sstevel@tonic-gate
4337c478bd9Sstevel@tonic-gate$(ROOTDIRS):
4347c478bd9Sstevel@tonic-gate	$(INS.dir)
4357c478bd9Sstevel@tonic-gate
4367c478bd9Sstevel@tonic-gate$(SYMHDRASSERT):
4377c478bd9Sstevel@tonic-gate	-$(RM) $@; $(SYMLINK) ../assert.h $@
4387c478bd9Sstevel@tonic-gate
4397c478bd9Sstevel@tonic-gate$(SYMHDRERRNO):
4407c478bd9Sstevel@tonic-gate	-$(RM) $@; $(SYMLINK) ../errno.h $@
4417c478bd9Sstevel@tonic-gate
4427c478bd9Sstevel@tonic-gate$(SYMHDRFLOAT):
4437c478bd9Sstevel@tonic-gate	-$(RM) $@; $(SYMLINK) ../float.h $@
4447c478bd9Sstevel@tonic-gate
4457c478bd9Sstevel@tonic-gate$(SYMHDRISO646):
4467c478bd9Sstevel@tonic-gate	-$(RM) $@; $(SYMLINK) ../iso646.h $@
4477c478bd9Sstevel@tonic-gate
4487c478bd9Sstevel@tonic-gaterpcsvc/%.h:	rpcsvc/%.x
4497c478bd9Sstevel@tonic-gate	$(RPCGEN) $(RPCGENFLAGS) $< -o $@
4507c478bd9Sstevel@tonic-gate
4517c478bd9Sstevel@tonic-gaterpcsvc/nis.h:	rpcsvc/nis.x
4527c478bd9Sstevel@tonic-gate	$(RPCGEN) $(RPCGENFLAGS) rpcsvc/nis.x |\
4537c478bd9Sstevel@tonic-gate	$(SED) -e '/EDIT_START/,$$ d' > $@
4547c478bd9Sstevel@tonic-gate
4557c478bd9Sstevel@tonic-gatemeta_basic.h:	../uts/common/sys/lvm/meta_basic.x
4567c478bd9Sstevel@tonic-gate	$(RPCGEN) $(RPCGENFLAGS)  ../uts/common/sys/lvm/meta_basic.x | \
457*4cb69eccSIgor Kozhukhov	$(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
4587c478bd9Sstevel@tonic-gate	/<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
4597c478bd9Sstevel@tonic-gate	{ print $0 } \
4607c478bd9Sstevel@tonic-gate	' > $@
4617c478bd9Sstevel@tonic-gate
4627c478bd9Sstevel@tonic-gatemetad.h:	metad.x
4637c478bd9Sstevel@tonic-gate	$(RPCGEN) $(RPCGENFLAGS)  metad.x | \
464*4cb69eccSIgor Kozhukhov	$(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
4657c478bd9Sstevel@tonic-gate	/<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
4667c478bd9Sstevel@tonic-gate	{ print $0 } \
4677c478bd9Sstevel@tonic-gate	' > $@
4687c478bd9Sstevel@tonic-gate
4697c478bd9Sstevel@tonic-gatemhdx.h:	../uts/common/sys/lvm/mhdx.x
4707c478bd9Sstevel@tonic-gate	$(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/mhdx.x | \
471*4cb69eccSIgor Kozhukhov	$(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
4727c478bd9Sstevel@tonic-gate	/<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
4737c478bd9Sstevel@tonic-gate	{ print $0 } \
4747c478bd9Sstevel@tonic-gate	' > $@
4757c478bd9Sstevel@tonic-gate
4767c478bd9Sstevel@tonic-gatemdiox.h:	../uts/common/sys/lvm/mdiox.x
4777c478bd9Sstevel@tonic-gate	$(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/mdiox.x | \
478*4cb69eccSIgor Kozhukhov	$(NAWK) '{sub(/sys\/lvm\/md_mhdx/, "mhdx"); print $$0}' | \
479*4cb69eccSIgor Kozhukhov	$(NAWK) '{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
480*4cb69eccSIgor Kozhukhov	$(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
4817c478bd9Sstevel@tonic-gate	/<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
4827c478bd9Sstevel@tonic-gate	{ print $0 } \
4837c478bd9Sstevel@tonic-gate	' > $@
4847c478bd9Sstevel@tonic-gate
4857c478bd9Sstevel@tonic-gatemetamed.h:	../uts/common/sys/lvm/metamed.x
4867c478bd9Sstevel@tonic-gate	$(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/metamed.x | \
487*4cb69eccSIgor Kozhukhov	$(NAWK) '{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
488*4cb69eccSIgor Kozhukhov	$(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
4897c478bd9Sstevel@tonic-gate	/<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
4907c478bd9Sstevel@tonic-gate	{ print $0 } \
4917c478bd9Sstevel@tonic-gate	' > $@
4927c478bd9Sstevel@tonic-gate
4937c478bd9Sstevel@tonic-gatemetamhd.h:	metamhd.x
4947c478bd9Sstevel@tonic-gate	$(RPCGEN) $(RPCGENFLAGS) metamhd.x | \
495*4cb69eccSIgor Kozhukhov	$(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
4967c478bd9Sstevel@tonic-gate	/<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
4977c478bd9Sstevel@tonic-gate	{ print $0 } \
4987c478bd9Sstevel@tonic-gate	' > $@
4997c478bd9Sstevel@tonic-gate
5007c478bd9Sstevel@tonic-gatemetacl.h:	metacl.x
5017c478bd9Sstevel@tonic-gate	$(RPCGEN) $(RPCGENFLAGS) metacl.x | \
502*4cb69eccSIgor Kozhukhov	$(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
5037c478bd9Sstevel@tonic-gate	/<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
5047c478bd9Sstevel@tonic-gate	{ print $0 } \
5057c478bd9Sstevel@tonic-gate	' > $@
506