xref: /titanic_52/usr/src/head/Makefile (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate#
2*7c478bd9Sstevel@tonic-gate# CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate#
4*7c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate# (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate# with the License.
8*7c478bd9Sstevel@tonic-gate#
9*7c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate# and limitations under the License.
13*7c478bd9Sstevel@tonic-gate#
14*7c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate#
20*7c478bd9Sstevel@tonic-gate# CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate#
22*7c478bd9Sstevel@tonic-gate#
23*7c478bd9Sstevel@tonic-gate# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate# Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate#
26*7c478bd9Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
27*7c478bd9Sstevel@tonic-gate#
28*7c478bd9Sstevel@tonic-gate# head/Makefile
29*7c478bd9Sstevel@tonic-gate#
30*7c478bd9Sstevel@tonic-gate# include global definitions
31*7c478bd9Sstevel@tonic-gateinclude ../Makefile.master
32*7c478bd9Sstevel@tonic-gate
33*7c478bd9Sstevel@tonic-gatesparc_HDRS=
34*7c478bd9Sstevel@tonic-gatei386_HDRS=	stack_unwind.h
35*7c478bd9Sstevel@tonic-gate
36*7c478bd9Sstevel@tonic-gate# Headers are listed one per line so that TeamWare can auto-merge most changes
37*7c478bd9Sstevel@tonic-gate
38*7c478bd9Sstevel@tonic-gateKRB5HDRS= mit_copyright.h mit-sipb-copyright.h
39*7c478bd9Sstevel@tonic-gate
40*7c478bd9Sstevel@tonic-gateATTRDB_HDRS=	secdb.h auth_attr.h exec_attr.h prof_attr.h user_attr.h \
41*7c478bd9Sstevel@tonic-gate	auth_list.h
42*7c478bd9Sstevel@tonic-gate
43*7c478bd9Sstevel@tonic-gateHDRS=   $($(MACH)_HDRS)  $(ATTRDB_HDRS) \
44*7c478bd9Sstevel@tonic-gate	aio.h		\
45*7c478bd9Sstevel@tonic-gate	alloca.h	\
46*7c478bd9Sstevel@tonic-gate	apptrace.h	\
47*7c478bd9Sstevel@tonic-gate	apptrace_impl.h	\
48*7c478bd9Sstevel@tonic-gate	ar.h		\
49*7c478bd9Sstevel@tonic-gate	archives.h	\
50*7c478bd9Sstevel@tonic-gate	assert.h	\
51*7c478bd9Sstevel@tonic-gate	atomic.h	\
52*7c478bd9Sstevel@tonic-gate	config_admin.h	\
53*7c478bd9Sstevel@tonic-gate	cpio.h		\
54*7c478bd9Sstevel@tonic-gate	crypt.h		\
55*7c478bd9Sstevel@tonic-gate	ctype.h		\
56*7c478bd9Sstevel@tonic-gate	deflt.h		\
57*7c478bd9Sstevel@tonic-gate	devid.h		\
58*7c478bd9Sstevel@tonic-gate	devmgmt.h	\
59*7c478bd9Sstevel@tonic-gate	devpoll.h	\
60*7c478bd9Sstevel@tonic-gate	dial.h		\
61*7c478bd9Sstevel@tonic-gate	dirent.h	\
62*7c478bd9Sstevel@tonic-gate	dlfcn.h		\
63*7c478bd9Sstevel@tonic-gate	door.h		\
64*7c478bd9Sstevel@tonic-gate	elf.h		\
65*7c478bd9Sstevel@tonic-gate	errno.h		\
66*7c478bd9Sstevel@tonic-gate	euc.h		\
67*7c478bd9Sstevel@tonic-gate	exacct.h	\
68*7c478bd9Sstevel@tonic-gate	exacct_impl.h	\
69*7c478bd9Sstevel@tonic-gate	fatal.h		\
70*7c478bd9Sstevel@tonic-gate	fcntl.h		\
71*7c478bd9Sstevel@tonic-gate	float.h		\
72*7c478bd9Sstevel@tonic-gate	fmtmsg.h	\
73*7c478bd9Sstevel@tonic-gate	fnmatch.h	\
74*7c478bd9Sstevel@tonic-gate	ftw.h		\
75*7c478bd9Sstevel@tonic-gate	gelf.h		\
76*7c478bd9Sstevel@tonic-gate	getopt.h	\
77*7c478bd9Sstevel@tonic-gate	getwidth.h	\
78*7c478bd9Sstevel@tonic-gate	glob.h		\
79*7c478bd9Sstevel@tonic-gate	grp.h		\
80*7c478bd9Sstevel@tonic-gate	iconv.h		\
81*7c478bd9Sstevel@tonic-gate	ieeefp.h	\
82*7c478bd9Sstevel@tonic-gate	inttypes.h	\
83*7c478bd9Sstevel@tonic-gate	iso646.h	\
84*7c478bd9Sstevel@tonic-gate	langinfo.h	\
85*7c478bd9Sstevel@tonic-gate	lastlog.h	\
86*7c478bd9Sstevel@tonic-gate	lber.h		\
87*7c478bd9Sstevel@tonic-gate	ldap.h		\
88*7c478bd9Sstevel@tonic-gate	libelf.h	\
89*7c478bd9Sstevel@tonic-gate	libgen.h	\
90*7c478bd9Sstevel@tonic-gate	libintl.h	\
91*7c478bd9Sstevel@tonic-gate	libw.h		\
92*7c478bd9Sstevel@tonic-gate	libzonecfg.h	\
93*7c478bd9Sstevel@tonic-gate	limits.h	\
94*7c478bd9Sstevel@tonic-gate	linenum.h	\
95*7c478bd9Sstevel@tonic-gate	link.h		\
96*7c478bd9Sstevel@tonic-gate	listen.h	\
97*7c478bd9Sstevel@tonic-gate	locale.h	\
98*7c478bd9Sstevel@tonic-gate	macros.h	\
99*7c478bd9Sstevel@tonic-gate	malloc.h	\
100*7c478bd9Sstevel@tonic-gate	md5.h		\
101*7c478bd9Sstevel@tonic-gate	mdmn_changelog.h	\
102*7c478bd9Sstevel@tonic-gate	memory.h	\
103*7c478bd9Sstevel@tonic-gate	meta.h		\
104*7c478bd9Sstevel@tonic-gate	meta_runtime.h	\
105*7c478bd9Sstevel@tonic-gate	metadyn.h	\
106*7c478bd9Sstevel@tonic-gate	mon.h		\
107*7c478bd9Sstevel@tonic-gate	monetary.h	\
108*7c478bd9Sstevel@tonic-gate	mp.h		\
109*7c478bd9Sstevel@tonic-gate	mqueue.h	\
110*7c478bd9Sstevel@tonic-gate	nan.h		\
111*7c478bd9Sstevel@tonic-gate	ndbm.h		\
112*7c478bd9Sstevel@tonic-gate	netconfig.h	\
113*7c478bd9Sstevel@tonic-gate	netdb.h		\
114*7c478bd9Sstevel@tonic-gate	netdir.h	\
115*7c478bd9Sstevel@tonic-gate	nl_types.h	\
116*7c478bd9Sstevel@tonic-gate	nlist.h		\
117*7c478bd9Sstevel@tonic-gate	note.h		\
118*7c478bd9Sstevel@tonic-gate	nsswitch.h	\
119*7c478bd9Sstevel@tonic-gate	nss_common.h	\
120*7c478bd9Sstevel@tonic-gate	nss_dbdefs.h	\
121*7c478bd9Sstevel@tonic-gate	nss_netdir.h	\
122*7c478bd9Sstevel@tonic-gate	pcsample.h	\
123*7c478bd9Sstevel@tonic-gate	pfmt.h		\
124*7c478bd9Sstevel@tonic-gate	pkgdev.h	\
125*7c478bd9Sstevel@tonic-gate	pkginfo.h	\
126*7c478bd9Sstevel@tonic-gate	pkglocs.h	\
127*7c478bd9Sstevel@tonic-gate	pkgstrct.h	\
128*7c478bd9Sstevel@tonic-gate	pkgtrans.h	\
129*7c478bd9Sstevel@tonic-gate	poll.h		\
130*7c478bd9Sstevel@tonic-gate	port.h		\
131*7c478bd9Sstevel@tonic-gate	priv.h		\
132*7c478bd9Sstevel@tonic-gate	priv_utils.h	\
133*7c478bd9Sstevel@tonic-gate	proc_service.h	\
134*7c478bd9Sstevel@tonic-gate	procfs.h	\
135*7c478bd9Sstevel@tonic-gate	prof.h		\
136*7c478bd9Sstevel@tonic-gate	project.h	\
137*7c478bd9Sstevel@tonic-gate	pthread.h	\
138*7c478bd9Sstevel@tonic-gate	pw.h		\
139*7c478bd9Sstevel@tonic-gate	pwd.h		\
140*7c478bd9Sstevel@tonic-gate	rctl.h		\
141*7c478bd9Sstevel@tonic-gate	re_comp.h	\
142*7c478bd9Sstevel@tonic-gate	regex.h		\
143*7c478bd9Sstevel@tonic-gate	regexp.h	\
144*7c478bd9Sstevel@tonic-gate	resolv.h	\
145*7c478bd9Sstevel@tonic-gate	rje.h		\
146*7c478bd9Sstevel@tonic-gate	rtld_db.h	\
147*7c478bd9Sstevel@tonic-gate	rmmount.h	\
148*7c478bd9Sstevel@tonic-gate	sac.h		\
149*7c478bd9Sstevel@tonic-gate	sched.h		\
150*7c478bd9Sstevel@tonic-gate	schedctl.h	\
151*7c478bd9Sstevel@tonic-gate	sdssc.h		\
152*7c478bd9Sstevel@tonic-gate	search.h	\
153*7c478bd9Sstevel@tonic-gate	semaphore.h	\
154*7c478bd9Sstevel@tonic-gate	setjmp.h	\
155*7c478bd9Sstevel@tonic-gate	sgtty.h		\
156*7c478bd9Sstevel@tonic-gate	shadow.h	\
157*7c478bd9Sstevel@tonic-gate	siginfo.h	\
158*7c478bd9Sstevel@tonic-gate	signal.h	\
159*7c478bd9Sstevel@tonic-gate	spawn.h		\
160*7c478bd9Sstevel@tonic-gate	stdarg.h	\
161*7c478bd9Sstevel@tonic-gate	stdbool.h	\
162*7c478bd9Sstevel@tonic-gate	stddef.h	\
163*7c478bd9Sstevel@tonic-gate	stdint.h	\
164*7c478bd9Sstevel@tonic-gate	stdio.h		\
165*7c478bd9Sstevel@tonic-gate	stdio_ext.h	\
166*7c478bd9Sstevel@tonic-gate	stdio_tag.h	\
167*7c478bd9Sstevel@tonic-gate	stdio_impl.h	\
168*7c478bd9Sstevel@tonic-gate	stdlib.h	\
169*7c478bd9Sstevel@tonic-gate	storclass.h	\
170*7c478bd9Sstevel@tonic-gate	string.h	\
171*7c478bd9Sstevel@tonic-gate	strings.h	\
172*7c478bd9Sstevel@tonic-gate	stropts.h	\
173*7c478bd9Sstevel@tonic-gate	synch.h		\
174*7c478bd9Sstevel@tonic-gate	sysexits.h	\
175*7c478bd9Sstevel@tonic-gate	syslog.h	\
176*7c478bd9Sstevel@tonic-gate	syms.h		\
177*7c478bd9Sstevel@tonic-gate	tar.h		\
178*7c478bd9Sstevel@tonic-gate	termio.h	\
179*7c478bd9Sstevel@tonic-gate	termios.h	\
180*7c478bd9Sstevel@tonic-gate	thread.h	\
181*7c478bd9Sstevel@tonic-gate	thread_db.h	\
182*7c478bd9Sstevel@tonic-gate	time.h		\
183*7c478bd9Sstevel@tonic-gate	tiuser.h	\
184*7c478bd9Sstevel@tonic-gate	tzfile.h	\
185*7c478bd9Sstevel@tonic-gate	ucontext.h	\
186*7c478bd9Sstevel@tonic-gate	ucred.h		\
187*7c478bd9Sstevel@tonic-gate	ulimit.h	\
188*7c478bd9Sstevel@tonic-gate	unistd.h	\
189*7c478bd9Sstevel@tonic-gate	userdefs.h	\
190*7c478bd9Sstevel@tonic-gate	ustat.h		\
191*7c478bd9Sstevel@tonic-gate	utime.h		\
192*7c478bd9Sstevel@tonic-gate	utmp.h		\
193*7c478bd9Sstevel@tonic-gate	utmpx.h		\
194*7c478bd9Sstevel@tonic-gate	valtools.h	\
195*7c478bd9Sstevel@tonic-gate	values.h	\
196*7c478bd9Sstevel@tonic-gate	varargs.h	\
197*7c478bd9Sstevel@tonic-gate	wait.h		\
198*7c478bd9Sstevel@tonic-gate	wchar.h		\
199*7c478bd9Sstevel@tonic-gate	wchar_impl.h	\
200*7c478bd9Sstevel@tonic-gate	wctype.h	\
201*7c478bd9Sstevel@tonic-gate	widec.h		\
202*7c478bd9Sstevel@tonic-gate	wordexp.h	\
203*7c478bd9Sstevel@tonic-gate	xti.h		\
204*7c478bd9Sstevel@tonic-gate	xti_inet.h	\
205*7c478bd9Sstevel@tonic-gate	zone.h
206*7c478bd9Sstevel@tonic-gate
207*7c478bd9Sstevel@tonic-gateISOHDRS = \
208*7c478bd9Sstevel@tonic-gate	ctype_c99.h	\
209*7c478bd9Sstevel@tonic-gate	ctype_iso.h	\
210*7c478bd9Sstevel@tonic-gate	limits_iso.h	\
211*7c478bd9Sstevel@tonic-gate	locale_iso.h	\
212*7c478bd9Sstevel@tonic-gate	setjmp_iso.h  	\
213*7c478bd9Sstevel@tonic-gate	signal_iso.h	\
214*7c478bd9Sstevel@tonic-gate	stdarg_c99.h	\
215*7c478bd9Sstevel@tonic-gate	stdarg_iso.h	\
216*7c478bd9Sstevel@tonic-gate	stddef_iso.h	\
217*7c478bd9Sstevel@tonic-gate	stdio_c99.h	\
218*7c478bd9Sstevel@tonic-gate	stdio_iso.h	\
219*7c478bd9Sstevel@tonic-gate	stdlib_c99.h	\
220*7c478bd9Sstevel@tonic-gate	stdlib_iso.h	\
221*7c478bd9Sstevel@tonic-gate	string_iso.h	\
222*7c478bd9Sstevel@tonic-gate	time_iso.h	\
223*7c478bd9Sstevel@tonic-gate	wchar_c99.h	\
224*7c478bd9Sstevel@tonic-gate	wchar_iso.h	\
225*7c478bd9Sstevel@tonic-gate	wctype_c99.h	\
226*7c478bd9Sstevel@tonic-gate	wctype_iso.h
227*7c478bd9Sstevel@tonic-gate
228*7c478bd9Sstevel@tonic-gateARPAHDRS = 		\
229*7c478bd9Sstevel@tonic-gate	ftp.h		\
230*7c478bd9Sstevel@tonic-gate	inet.h		\
231*7c478bd9Sstevel@tonic-gate	nameser.h	\
232*7c478bd9Sstevel@tonic-gate	telnet.h	\
233*7c478bd9Sstevel@tonic-gate	tftp.h		\
234*7c478bd9Sstevel@tonic-gate	nameser_compat.h
235*7c478bd9Sstevel@tonic-gate
236*7c478bd9Sstevel@tonic-gateAUDIOHDRS =		\
237*7c478bd9Sstevel@tonic-gate	au.h
238*7c478bd9Sstevel@tonic-gate
239*7c478bd9Sstevel@tonic-gateUUIDHDRS =		\
240*7c478bd9Sstevel@tonic-gate	uuid.h
241*7c478bd9Sstevel@tonic-gate
242*7c478bd9Sstevel@tonic-gate# rpcsvc headers which are just headers (not derived from a .x file)
243*7c478bd9Sstevel@tonic-gateRPCSVC_SRC_HDRS =	\
244*7c478bd9Sstevel@tonic-gate	bootparam.h	\
245*7c478bd9Sstevel@tonic-gate	daemon_utils.h	\
246*7c478bd9Sstevel@tonic-gate	dbm.h		\
247*7c478bd9Sstevel@tonic-gate	nis_db.h	\
248*7c478bd9Sstevel@tonic-gate	nis_tags.h	\
249*7c478bd9Sstevel@tonic-gate	nislib.h	\
250*7c478bd9Sstevel@tonic-gate	yp_prot.h	\
251*7c478bd9Sstevel@tonic-gate	ypclnt.h	\
252*7c478bd9Sstevel@tonic-gate	yppasswd.h	\
253*7c478bd9Sstevel@tonic-gate	ypupd.h		\
254*7c478bd9Sstevel@tonic-gate	rpc_sztypes.h
255*7c478bd9Sstevel@tonic-gate
256*7c478bd9Sstevel@tonic-gate# rpcsvc headers which are generated from .x files
257*7c478bd9Sstevel@tonic-gateRPCSVC_GEN_HDRS = \
258*7c478bd9Sstevel@tonic-gate	bootparam_prot.h \
259*7c478bd9Sstevel@tonic-gate	mount.h		\
260*7c478bd9Sstevel@tonic-gate	nfs_prot.h	\
261*7c478bd9Sstevel@tonic-gate	nfs4_prot.h	\
262*7c478bd9Sstevel@tonic-gate	nis.h		\
263*7c478bd9Sstevel@tonic-gate	nis_cache.h	\
264*7c478bd9Sstevel@tonic-gate	nis_callback.h	\
265*7c478bd9Sstevel@tonic-gate	nlm_prot.h	\
266*7c478bd9Sstevel@tonic-gate	rex.h		\
267*7c478bd9Sstevel@tonic-gate	rquota.h	\
268*7c478bd9Sstevel@tonic-gate	rstat.h		\
269*7c478bd9Sstevel@tonic-gate	rusers.h	\
270*7c478bd9Sstevel@tonic-gate	rwall.h		\
271*7c478bd9Sstevel@tonic-gate	spray.h		\
272*7c478bd9Sstevel@tonic-gate	nispasswd.h	\
273*7c478bd9Sstevel@tonic-gate	ufs_prot.h	\
274*7c478bd9Sstevel@tonic-gate	nfs_acl.h
275*7c478bd9Sstevel@tonic-gate
276*7c478bd9Sstevel@tonic-gateLVMRPCHDRS = \
277*7c478bd9Sstevel@tonic-gatemhdx.h mdiox.h meta_basic.h metad.h metamed.h metamhd.h metacl.h
278*7c478bd9Sstevel@tonic-gate
279*7c478bd9Sstevel@tonic-gateSYMHDRASSERT = $(ROOT)/usr/include/iso/assert_iso.h
280*7c478bd9Sstevel@tonic-gateSYMHDRERRNO = $(ROOT)/usr/include/iso/errno_iso.h
281*7c478bd9Sstevel@tonic-gateSYMHDRFLOAT = $(ROOT)/usr/include/iso/float_iso.h
282*7c478bd9Sstevel@tonic-gateSYMHDRISO646 = $(ROOT)/usr/include/iso/iso646_iso.h
283*7c478bd9Sstevel@tonic-gate
284*7c478bd9Sstevel@tonic-gateRPCGENFLAGS = -C -h
285*7c478bd9Sstevel@tonic-gaterpcsvc/nispasswd.h :=	RPCGENFLAGS += -M
286*7c478bd9Sstevel@tonic-gaterpcsvc/rwall.h :=	RPCGENFLAGS += -M
287*7c478bd9Sstevel@tonic-gatemeta_basic.h :=	RPCGENFLAGS += -M
288*7c478bd9Sstevel@tonic-gatemetad.h := RPCGENFLAGS += -M
289*7c478bd9Sstevel@tonic-gatemetamed.h := RPCGENFLAGS += -M
290*7c478bd9Sstevel@tonic-gatemhdx.h := RPCGENFLAGS += -M
291*7c478bd9Sstevel@tonic-gatemdiox.h := RPCGENFLAGS += -M
292*7c478bd9Sstevel@tonic-gatemetamhd.h := RPCGENFLAGS += -M
293*7c478bd9Sstevel@tonic-gatemetacl.h := RPCGENFLAGS += -M
294*7c478bd9Sstevel@tonic-gate
295*7c478bd9Sstevel@tonic-gate# rpcsvc rpcgen source (.x files)
296*7c478bd9Sstevel@tonic-gate#
297*7c478bd9Sstevel@tonic-gate# yp.x is an attempt at codifying what was hand coded in RPCL.
298*7c478bd9Sstevel@tonic-gate# Unfortunately it doesn't quite work. (The handcoded stuff isn't
299*7c478bd9Sstevel@tonic-gate# expressable in RPCL) this is due to the fact that YP was written
300*7c478bd9Sstevel@tonic-gate# before rpcgen existed.  Hence, yp_prot.h cannot be derived from yp.x
301*7c478bd9Sstevel@tonic-gate#
302*7c478bd9Sstevel@tonic-gate# There is no `.h' for nis_object.x because it is included by nis.x and
303*7c478bd9Sstevel@tonic-gate# the resulting .h is nis.h.
304*7c478bd9Sstevel@tonic-gate
305*7c478bd9Sstevel@tonic-gateRPCSVCPROTS = \
306*7c478bd9Sstevel@tonic-gate$(RPCSVC_GEN_HDRS:%.h=%.x)        nis_object.x       yp.x
307*7c478bd9Sstevel@tonic-gate
308*7c478bd9Sstevel@tonic-gateLVMSVCPROTS = \
309*7c478bd9Sstevel@tonic-gate$(LVMRPCHDRS:%.h=%.x)
310*7c478bd9Sstevel@tonic-gate
311*7c478bd9Sstevel@tonic-gateRPCSVCHDRS= $(RPCSVC_SRC_HDRS) $(RPCSVC_GEN_HDRS)
312*7c478bd9Sstevel@tonic-gate
313*7c478bd9Sstevel@tonic-gatePROTOHDRS=   dumprestore.h routed.h ripngd.h rwhod.h timed.h
314*7c478bd9Sstevel@tonic-gate
315*7c478bd9Sstevel@tonic-gateROOTHDRS= $(HDRS:%=$(ROOT)/usr/include/%)  \
316*7c478bd9Sstevel@tonic-gate	$(KRB5HDRS:%=$(ROOT)/usr/include/kerberosv5/%)  \
317*7c478bd9Sstevel@tonic-gate	$(ISOHDRS:%=$(ROOT)/usr/include/iso/%)  \
318*7c478bd9Sstevel@tonic-gate	$(ARPAHDRS:%=$(ROOT)/usr/include/arpa/%)  \
319*7c478bd9Sstevel@tonic-gate	$(AUDIOHDRS:%=$(ROOT)/usr/include/audio/%)  \
320*7c478bd9Sstevel@tonic-gate	$(UUIDHDRS:%=$(ROOT)/usr/include/uuid/%)  \
321*7c478bd9Sstevel@tonic-gate	$(RPCSVCHDRS:%=$(ROOT)/usr/include/rpcsvc/%)  \
322*7c478bd9Sstevel@tonic-gate	$(RPCSVCPROTS:%=$(ROOT)/usr/include/rpcsvc/%)  \
323*7c478bd9Sstevel@tonic-gate	$(LVMRPCHDRS:%=$(ROOT)/usr/include/%) \
324*7c478bd9Sstevel@tonic-gate	$(PROTOHDRS:%=$(ROOT)/usr/include/protocols/%)
325*7c478bd9Sstevel@tonic-gate
326*7c478bd9Sstevel@tonic-gateDIRS= iso arpa audio rpcsvc protocols security uuid kerberosv5
327*7c478bd9Sstevel@tonic-gateROOTDIRS= $(DIRS:%=$(ROOT)/usr/include/%)
328*7c478bd9Sstevel@tonic-gate
329*7c478bd9Sstevel@tonic-gateSED=	sed
330*7c478bd9Sstevel@tonic-gate
331*7c478bd9Sstevel@tonic-gate# check files really don't exist
332*7c478bd9Sstevel@tonic-gate#
333*7c478bd9Sstevel@tonic-gate# should do something with the rpcsvc headers
334*7c478bd9Sstevel@tonic-gate
335*7c478bd9Sstevel@tonic-gateiso/%.check:		iso/%.h
336*7c478bd9Sstevel@tonic-gate	$(DOT_H_CHECK)
337*7c478bd9Sstevel@tonic-gate
338*7c478bd9Sstevel@tonic-gatearpa/%.check:		arpa/%.h
339*7c478bd9Sstevel@tonic-gate	$(DOT_H_CHECK)
340*7c478bd9Sstevel@tonic-gate
341*7c478bd9Sstevel@tonic-gateaudio/%.check:		audio/%.h
342*7c478bd9Sstevel@tonic-gate	$(DOT_H_CHECK)
343*7c478bd9Sstevel@tonic-gate
344*7c478bd9Sstevel@tonic-gaterpcsvc/%.check:		rpcsvc/%.h
345*7c478bd9Sstevel@tonic-gate	$(DOT_H_CHECK)
346*7c478bd9Sstevel@tonic-gate
347*7c478bd9Sstevel@tonic-gaterpcsvc/%.check:		rpcsvc/%.x
348*7c478bd9Sstevel@tonic-gate	$(DOT_X_CHECK)
349*7c478bd9Sstevel@tonic-gate
350*7c478bd9Sstevel@tonic-gateprotocols/%.check:	protocols/%.h
351*7c478bd9Sstevel@tonic-gate	$(DOT_H_CHECK)
352*7c478bd9Sstevel@tonic-gate
353*7c478bd9Sstevel@tonic-gatekerberosv5/%.check:             kerberosv5/%.h
354*7c478bd9Sstevel@tonic-gate	$(DOT_H_CHECK)
355*7c478bd9Sstevel@tonic-gate
356*7c478bd9Sstevel@tonic-gateuuid/%.check:		uuid/%.h
357*7c478bd9Sstevel@tonic-gate	$(DOT_H_CHECK)
358*7c478bd9Sstevel@tonic-gate
359*7c478bd9Sstevel@tonic-gate# Note that the derived headers (rpcgen) are not checked at this time.  These
360*7c478bd9Sstevel@tonic-gate# need work at the source level and rpcgen itself has a bug which causes a
361*7c478bd9Sstevel@tonic-gate# cstyle violation.  Furthermore, there seems to be good reasons for the
362*7c478bd9Sstevel@tonic-gate# generated headers to not pass all of the hdrchk rules.
363*7c478bd9Sstevel@tonic-gate#
364*7c478bd9Sstevel@tonic-gate# Add the following to the CHECKHDRS list to activate the .x checks:
365*7c478bd9Sstevel@tonic-gate#	$(RPCSVCPROTS:%.x=rpcsvc/%.check) \
366*7c478bd9Sstevel@tonic-gate#
367*7c478bd9Sstevel@tonic-gateCHECKHDRS= $(HDRS:%.h=%.check)  \
368*7c478bd9Sstevel@tonic-gate	$(KRB5HDRS:%.h=kerberosv5/%.check)  \
369*7c478bd9Sstevel@tonic-gate	$(ISOHDRS:%.h=iso/%.check)  \
370*7c478bd9Sstevel@tonic-gate	$(ARPAHDRS:%.h=arpa/%.check)  \
371*7c478bd9Sstevel@tonic-gate	$(AUDIOHDRS:%.h=audio/%.check)  \
372*7c478bd9Sstevel@tonic-gate	$(UUIDHDRS:%.h=uuid/%.check)  \
373*7c478bd9Sstevel@tonic-gate	$(RPCSVC_SRC_HDRS:%.h=rpcsvc/%.check) \
374*7c478bd9Sstevel@tonic-gate	$(PROTOHDRS:%.h=protocols/%.check)
375*7c478bd9Sstevel@tonic-gate
376*7c478bd9Sstevel@tonic-gate# headers which won't quite meet the standards...
377*7c478bd9Sstevel@tonic-gate#
378*7c478bd9Sstevel@tonic-gate# assert.h is required by ansi-c to *not* be idempotent (section 4.1.2).
379*7c478bd9Sstevel@tonic-gate# Hence the trailing guard is not the last thing in the file nor can it
380*7c478bd9Sstevel@tonic-gate# be without playing silly games.
381*7c478bd9Sstevel@tonic-gate
382*7c478bd9Sstevel@tonic-gateassert.check	:= HDRCHK_TAIL = | grep -v "end guard wrong" | true
383*7c478bd9Sstevel@tonic-gate
384*7c478bd9Sstevel@tonic-gate# install rules
385*7c478bd9Sstevel@tonic-gate
386*7c478bd9Sstevel@tonic-gate$(ROOT)/usr/include/security/%: security/%
387*7c478bd9Sstevel@tonic-gate	$(INS.file)
388*7c478bd9Sstevel@tonic-gate
389*7c478bd9Sstevel@tonic-gate$(ROOT)/usr/include/protocols/%: protocols/%
390*7c478bd9Sstevel@tonic-gate	$(INS.file)
391*7c478bd9Sstevel@tonic-gate
392*7c478bd9Sstevel@tonic-gate$(ROOT)/usr/include/rpcsvc/%: rpcsvc/%
393*7c478bd9Sstevel@tonic-gate	$(INS.file)
394*7c478bd9Sstevel@tonic-gate
395*7c478bd9Sstevel@tonic-gate$(ROOT)/usr/include/kerberosv5/%: kerberosv5/%
396*7c478bd9Sstevel@tonic-gate	$(INS.file)
397*7c478bd9Sstevel@tonic-gate
398*7c478bd9Sstevel@tonic-gate$(ROOT)/usr/include/arpa/%: arpa/%
399*7c478bd9Sstevel@tonic-gate	$(INS.file)
400*7c478bd9Sstevel@tonic-gate
401*7c478bd9Sstevel@tonic-gate$(ROOT)/usr/include/audio/%: audio/%
402*7c478bd9Sstevel@tonic-gate	$(INS.file)
403*7c478bd9Sstevel@tonic-gate
404*7c478bd9Sstevel@tonic-gate$(ROOT)/usr/include/iso/%: iso/%
405*7c478bd9Sstevel@tonic-gate	$(INS.file)
406*7c478bd9Sstevel@tonic-gate
407*7c478bd9Sstevel@tonic-gate$(ROOT)/usr/include/uuid/%: uuid/%
408*7c478bd9Sstevel@tonic-gate	$(INS.file)
409*7c478bd9Sstevel@tonic-gate
410*7c478bd9Sstevel@tonic-gate$(ROOT)/usr/include/%: %
411*7c478bd9Sstevel@tonic-gate	$(INS.file)
412*7c478bd9Sstevel@tonic-gate
413*7c478bd9Sstevel@tonic-gate.KEEP_STATE:
414*7c478bd9Sstevel@tonic-gate
415*7c478bd9Sstevel@tonic-gate.PARALLEL:	$(ROOTHDRS) $(CHECKHDRS)
416*7c478bd9Sstevel@tonic-gate
417*7c478bd9Sstevel@tonic-gateinstall_h: 	$(ROOTDIRS) .WAIT $(ROOTHDRS) $(SYMHDRASSERT) $(SYMHDRERRNO) \
418*7c478bd9Sstevel@tonic-gate		$(SYMHDRFLOAT) $(SYMHDRISO646)
419*7c478bd9Sstevel@tonic-gate
420*7c478bd9Sstevel@tonic-gatecheck:	$(CHECKHDRS)
421*7c478bd9Sstevel@tonic-gate
422*7c478bd9Sstevel@tonic-gateclean clobber:
423*7c478bd9Sstevel@tonic-gate	$(RM) $(LVMRPCHDRS);
424*7c478bd9Sstevel@tonic-gate	cd rpcsvc ; $(RM) $(RPCSVC_GEN_HDRS)
425*7c478bd9Sstevel@tonic-gate
426*7c478bd9Sstevel@tonic-gate$(ROOTDIRS):
427*7c478bd9Sstevel@tonic-gate	$(INS.dir)
428*7c478bd9Sstevel@tonic-gate
429*7c478bd9Sstevel@tonic-gate$(SYMHDRASSERT):
430*7c478bd9Sstevel@tonic-gate	-$(RM) $@; $(SYMLINK) ../assert.h $@
431*7c478bd9Sstevel@tonic-gate
432*7c478bd9Sstevel@tonic-gate$(SYMHDRERRNO):
433*7c478bd9Sstevel@tonic-gate	-$(RM) $@; $(SYMLINK) ../errno.h $@
434*7c478bd9Sstevel@tonic-gate
435*7c478bd9Sstevel@tonic-gate$(SYMHDRFLOAT):
436*7c478bd9Sstevel@tonic-gate	-$(RM) $@; $(SYMLINK) ../float.h $@
437*7c478bd9Sstevel@tonic-gate
438*7c478bd9Sstevel@tonic-gate$(SYMHDRISO646):
439*7c478bd9Sstevel@tonic-gate	-$(RM) $@; $(SYMLINK) ../iso646.h $@
440*7c478bd9Sstevel@tonic-gate
441*7c478bd9Sstevel@tonic-gaterpcsvc/%.h:	rpcsvc/%.x
442*7c478bd9Sstevel@tonic-gate	$(RPCGEN) $(RPCGENFLAGS) $< -o $@
443*7c478bd9Sstevel@tonic-gate
444*7c478bd9Sstevel@tonic-gaterpcsvc/nis.h:	rpcsvc/nis.x
445*7c478bd9Sstevel@tonic-gate	$(RPCGEN) $(RPCGENFLAGS) rpcsvc/nis.x |\
446*7c478bd9Sstevel@tonic-gate	$(SED) -e '/EDIT_START/,$$ d' > $@
447*7c478bd9Sstevel@tonic-gate
448*7c478bd9Sstevel@tonic-gatemeta_basic.h:	../uts/common/sys/lvm/meta_basic.x
449*7c478bd9Sstevel@tonic-gate	$(RPCGEN) $(RPCGENFLAGS)  ../uts/common/sys/lvm/meta_basic.x | \
450*7c478bd9Sstevel@tonic-gate	awk '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
451*7c478bd9Sstevel@tonic-gate	/<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
452*7c478bd9Sstevel@tonic-gate	{ print $0 } \
453*7c478bd9Sstevel@tonic-gate	' > $@
454*7c478bd9Sstevel@tonic-gate
455*7c478bd9Sstevel@tonic-gatemetad.h:	metad.x
456*7c478bd9Sstevel@tonic-gate	$(RPCGEN) $(RPCGENFLAGS)  metad.x | \
457*7c478bd9Sstevel@tonic-gate	awk '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
458*7c478bd9Sstevel@tonic-gate	/<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
459*7c478bd9Sstevel@tonic-gate	{ print $0 } \
460*7c478bd9Sstevel@tonic-gate	' > $@
461*7c478bd9Sstevel@tonic-gate
462*7c478bd9Sstevel@tonic-gatemhdx.h:	../uts/common/sys/lvm/mhdx.x
463*7c478bd9Sstevel@tonic-gate	$(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/mhdx.x | \
464*7c478bd9Sstevel@tonic-gate	awk '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
465*7c478bd9Sstevel@tonic-gate	/<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
466*7c478bd9Sstevel@tonic-gate	{ print $0 } \
467*7c478bd9Sstevel@tonic-gate	' > $@
468*7c478bd9Sstevel@tonic-gate
469*7c478bd9Sstevel@tonic-gatemdiox.h:	../uts/common/sys/lvm/mdiox.x
470*7c478bd9Sstevel@tonic-gate	$(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/mdiox.x | \
471*7c478bd9Sstevel@tonic-gate	nawk '{sub(/sys\/lvm\/md_mhdx/, "mhdx"); print $$0}' | \
472*7c478bd9Sstevel@tonic-gate	nawk '{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
473*7c478bd9Sstevel@tonic-gate	awk '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
474*7c478bd9Sstevel@tonic-gate	/<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
475*7c478bd9Sstevel@tonic-gate	{ print $0 } \
476*7c478bd9Sstevel@tonic-gate	' > $@
477*7c478bd9Sstevel@tonic-gate
478*7c478bd9Sstevel@tonic-gatemetamed.h:	../uts/common/sys/lvm/metamed.x
479*7c478bd9Sstevel@tonic-gate	$(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/metamed.x | \
480*7c478bd9Sstevel@tonic-gate	nawk '{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
481*7c478bd9Sstevel@tonic-gate	awk '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
482*7c478bd9Sstevel@tonic-gate	/<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
483*7c478bd9Sstevel@tonic-gate	{ print $0 } \
484*7c478bd9Sstevel@tonic-gate	' > $@
485*7c478bd9Sstevel@tonic-gate
486*7c478bd9Sstevel@tonic-gatemetamhd.h:	metamhd.x
487*7c478bd9Sstevel@tonic-gate	$(RPCGEN) $(RPCGENFLAGS) metamhd.x | \
488*7c478bd9Sstevel@tonic-gate	awk '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
489*7c478bd9Sstevel@tonic-gate	/<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
490*7c478bd9Sstevel@tonic-gate	{ print $0 } \
491*7c478bd9Sstevel@tonic-gate	' > $@
492*7c478bd9Sstevel@tonic-gate
493*7c478bd9Sstevel@tonic-gatemetacl.h:	metacl.x
494*7c478bd9Sstevel@tonic-gate	$(RPCGEN) $(RPCGENFLAGS) metacl.x | \
495*7c478bd9Sstevel@tonic-gate	awk '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
496*7c478bd9Sstevel@tonic-gate	/<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
497*7c478bd9Sstevel@tonic-gate	{ print $0 } \
498*7c478bd9Sstevel@tonic-gate	' > $@
499