xref: /titanic_50/usr/src/head/Makefile (revision e373b6e444a487df89a5dc6a4a4030b5b2aa87f9)
1#
2# CDDL HEADER START
3#
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.
7#
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.
12#
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]
18#
19# CDDL HEADER END
20#
21
22#
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.
28#
29
30#
31# head/Makefile
32#
33# include global definitions
34include ../Makefile.master
35
36sparc_HDRS=
37i386_HDRS=	stack_unwind.h
38
39# Headers are listed one per line so that TeamWare can auto-merge most changes
40
41KRB5HDRS= mit_copyright.h mit-sipb-copyright.h
42
43ATTRDB_HDRS=	secdb.h auth_attr.h exec_attr.h prof_attr.h user_attr.h \
44	auth_list.h
45
46HDRS=   $($(MACH)_HDRS)  $(ATTRDB_HDRS) \
47	aio.h		\
48	alloca.h	\
49	apptrace.h	\
50	apptrace_impl.h	\
51	ar.h		\
52	archives.h	\
53	assert.h	\
54	atomic.h	\
55	attr.h		\
56	complex.h	\
57	config_admin.h	\
58	cpio.h		\
59	crypt.h		\
60	ctype.h		\
61	deflt.h		\
62	devid.h		\
63	devmgmt.h	\
64	devpoll.h	\
65	dial.h		\
66	dirent.h	\
67	dlfcn.h		\
68	door.h		\
69	elf.h		\
70	err.h		\
71	errno.h		\
72	euc.h		\
73	exacct.h	\
74	exacct_impl.h	\
75	execinfo.h	\
76	fatal.h		\
77	fcntl.h		\
78	fenv.h		\
79	float.h		\
80	floatingpoint.h	\
81	fmtmsg.h	\
82	fnmatch.h	\
83	ftw.h		\
84	gelf.h		\
85	getopt.h	\
86	getwidth.h	\
87	glob.h		\
88	grp.h		\
89	iconv.h		\
90	ieeefp.h	\
91	ifaddrs.h	\
92	inttypes.h	\
93	iso646.h	\
94	klpd.h		\
95	langinfo.h	\
96	lastlog.h	\
97	lber.h		\
98	ldap.h		\
99	libelf.h	\
100	libgen.h	\
101	libintl.h	\
102	libw.h		\
103	libzonecfg.h	\
104	limits.h	\
105	linenum.h	\
106	link.h		\
107	listen.h	\
108	locale.h	\
109	macros.h	\
110	malloc.h	\
111	math.h		\
112	memory.h	\
113	mon.h		\
114	monetary.h	\
115	mp.h		\
116	mqueue.h	\
117	nan.h		\
118	ndbm.h		\
119	ndpd.h		\
120	netconfig.h	\
121	netdb.h		\
122	netdir.h	\
123	nl_types.h	\
124	nlist.h		\
125	note.h		\
126	nsctl.h		\
127	nsswitch.h	\
128	nss_common.h	\
129	nss_dbdefs.h	\
130	nss_netdir.h	\
131	paths.h		\
132	pcsample.h	\
133	pfmt.h		\
134	pkgdev.h	\
135	pkginfo.h	\
136	pkglocs.h	\
137	pkgstrct.h	\
138	pkgtrans.h	\
139	poll.h		\
140	port.h		\
141	priv.h		\
142	priv_utils.h	\
143	proc_service.h	\
144	procfs.h	\
145	prof.h		\
146	project.h	\
147	pthread.h	\
148	pw.h		\
149	pwd.h		\
150	rctl.h		\
151	re_comp.h	\
152	regex.h		\
153	regexp.h	\
154	resolv.h	\
155	rje.h		\
156	rtld_db.h	\
157	sac.h		\
158	sched.h		\
159	schedctl.h	\
160	search.h	\
161	semaphore.h	\
162	setjmp.h	\
163	sgtty.h		\
164	shadow.h	\
165	siginfo.h	\
166	signal.h	\
167	spawn.h		\
168	stdarg.h	\
169	stdbool.h	\
170	stddef.h	\
171	stdint.h	\
172	stdio.h		\
173	stdio_ext.h	\
174	stdio_tag.h	\
175	stdio_impl.h	\
176	stdlib.h	\
177	storclass.h	\
178	string.h	\
179	strings.h	\
180	stropts.h	\
181	synch.h		\
182	sysexits.h	\
183	syslog.h	\
184	syms.h		\
185	tar.h		\
186	termio.h	\
187	termios.h	\
188	tgmath.h	\
189	thread.h	\
190	thread_db.h	\
191	time.h		\
192	tiuser.h	\
193	tzfile.h	\
194	ucontext.h	\
195	ucred.h		\
196	ulimit.h	\
197	unistd.h	\
198	userdefs.h	\
199	ustat.h		\
200	utime.h		\
201	utmp.h		\
202	utmpx.h		\
203	valtools.h	\
204	values.h	\
205	varargs.h	\
206	wait.h		\
207	wchar.h		\
208	wchar_impl.h	\
209	wctype.h	\
210	widec.h		\
211	wordexp.h	\
212	xlocale.h	\
213	xti.h		\
214	xti_inet.h	\
215	zone.h
216
217ISOHDRS = \
218	ctype_iso.h	\
219	limits_iso.h	\
220	locale_iso.h	\
221	math_c99.h	\
222	math_iso.h	\
223	setjmp_iso.h  	\
224	signal_iso.h	\
225	stdarg_c99.h	\
226	stdarg_iso.h	\
227	stddef_iso.h	\
228	stdio_c99.h	\
229	stdio_iso.h	\
230	stdlib_c99.h	\
231	stdlib_iso.h	\
232	string_iso.h	\
233	time_iso.h	\
234	wchar_c99.h	\
235	wchar_iso.h	\
236	wctype_iso.h
237
238ARPAHDRS = 		\
239	ftp.h		\
240	inet.h		\
241	nameser.h	\
242	telnet.h	\
243	tftp.h		\
244	nameser_compat.h
245
246AUDIOHDRS =		\
247	au.h
248
249UUIDHDRS =		\
250	uuid.h
251
252# rpcsvc headers which are just headers (not derived from a .x file)
253RPCSVC_SRC_HDRS =	\
254	bootparam.h	\
255	daemon_utils.h	\
256	dbm.h		\
257	nis_db.h	\
258	nislib.h	\
259	svc_dg_priv.h	\
260	yp_prot.h	\
261	ypclnt.h	\
262	yppasswd.h	\
263	ypupd.h		\
264	rpc_sztypes.h
265
266# rpcsvc headers which are generated from .x files
267RPCSVC_GEN_HDRS = \
268	bootparam_prot.h \
269	mount.h		\
270	nfs_prot.h	\
271	nfs4_prot.h	\
272	nis.h		\
273	rex.h		\
274	rquota.h	\
275	rstat.h		\
276	rusers.h	\
277	rwall.h		\
278	spray.h		\
279	ufs_prot.h	\
280	nfs_acl.h
281
282SYMHDRASSERT = $(ROOT)/usr/include/iso/assert_iso.h
283SYMHDRERRNO = $(ROOT)/usr/include/iso/errno_iso.h
284SYMHDRFLOAT = $(ROOT)/usr/include/iso/float_iso.h
285SYMHDRISO646 = $(ROOT)/usr/include/iso/iso646_iso.h
286
287RPCGENFLAGS = -C -h
288rpcsvc/rwall.h :=	RPCGENFLAGS += -M
289
290# rpcsvc rpcgen source (.x files)
291#
292# yp.x is an attempt at codifying what was hand coded in RPCL.
293# Unfortunately it doesn't quite work. (The handcoded stuff isn't
294# expressable in RPCL) this is due to the fact that YP was written
295# before rpcgen existed.  Hence, yp_prot.h cannot be derived from yp.x
296#
297# There is no `.h' for nis_object.x because it is included by nis.x and
298# the resulting .h is nis.h.
299
300RPCSVCPROTS = \
301$(RPCSVC_GEN_HDRS:%.h=%.x)        nis_object.x       yp.x
302
303RPCSVCHDRS= $(RPCSVC_SRC_HDRS) $(RPCSVC_GEN_HDRS)
304
305PROTOHDRS=   dumprestore.h routed.h ripngd.h rwhod.h timed.h
306
307ROOTHDRS= $(HDRS:%=$(ROOT)/usr/include/%)  \
308	$(KRB5HDRS:%=$(ROOT)/usr/include/kerberosv5/%)  \
309	$(ISOHDRS:%=$(ROOT)/usr/include/iso/%)  \
310	$(ARPAHDRS:%=$(ROOT)/usr/include/arpa/%)  \
311	$(AUDIOHDRS:%=$(ROOT)/usr/include/audio/%)  \
312	$(UUIDHDRS:%=$(ROOT)/usr/include/uuid/%)  \
313	$(RPCSVCHDRS:%=$(ROOT)/usr/include/rpcsvc/%)  \
314	$(RPCSVCPROTS:%=$(ROOT)/usr/include/rpcsvc/%)  \
315	$(PROTOHDRS:%=$(ROOT)/usr/include/protocols/%)
316
317DIRS= iso arpa audio rpcsvc protocols security uuid kerberosv5
318ROOTDIRS= $(DIRS:%=$(ROOT)/usr/include/%)
319
320# check files really don't exist
321#
322# should do something with the rpcsvc headers
323
324iso/%.check:		iso/%.h
325	$(DOT_H_CHECK)
326
327arpa/%.check:		arpa/%.h
328	$(DOT_H_CHECK)
329
330audio/%.check:		audio/%.h
331	$(DOT_H_CHECK)
332
333rpcsvc/%.check:		rpcsvc/%.h
334	$(DOT_H_CHECK)
335
336rpcsvc/%.check:		rpcsvc/%.x
337	$(DOT_X_CHECK)
338
339protocols/%.check:	protocols/%.h
340	$(DOT_H_CHECK)
341
342kerberosv5/%.check:             kerberosv5/%.h
343	$(DOT_H_CHECK)
344
345uuid/%.check:		uuid/%.h
346	$(DOT_H_CHECK)
347
348# Note that the derived headers (rpcgen) are not checked at this time.  These
349# need work at the source level and rpcgen itself has a bug which causes a
350# cstyle violation.  Furthermore, there seems to be good reasons for the
351# generated headers to not pass all of the hdrchk rules.
352#
353# Add the following to the CHECKHDRS list to activate the .x checks:
354#	$(RPCSVCPROTS:%.x=rpcsvc/%.check) \
355#
356CHECKHDRS= $(HDRS:%.h=%.check)  \
357	$(KRB5HDRS:%.h=kerberosv5/%.check)  \
358	$(ISOHDRS:%.h=iso/%.check)  \
359	$(ARPAHDRS:%.h=arpa/%.check)  \
360	$(AUDIOHDRS:%.h=audio/%.check)  \
361	$(UUIDHDRS:%.h=uuid/%.check)  \
362	$(RPCSVC_SRC_HDRS:%.h=rpcsvc/%.check) \
363	$(PROTOHDRS:%.h=protocols/%.check)
364
365# headers which won't quite meet the standards...
366#
367# assert.h is required by ansi-c to *not* be idempotent (section 4.1.2).
368# Hence the trailing guard is not the last thing in the file nor can it
369# be without playing silly games.
370
371assert.check	:= HDRCHK_TAIL = | grep -v "end guard wrong" | true
372
373# install rules
374
375$(ROOT)/usr/include/security/%: security/%
376	$(INS.file)
377
378$(ROOT)/usr/include/protocols/%: protocols/%
379	$(INS.file)
380
381$(ROOT)/usr/include/rpcsvc/%: rpcsvc/%
382	$(INS.file)
383
384$(ROOT)/usr/include/kerberosv5/%: kerberosv5/%
385	$(INS.file)
386
387$(ROOT)/usr/include/arpa/%: arpa/%
388	$(INS.file)
389
390$(ROOT)/usr/include/audio/%: audio/%
391	$(INS.file)
392
393$(ROOT)/usr/include/iso/%: iso/%
394	$(INS.file)
395
396$(ROOT)/usr/include/uuid/%: uuid/%
397	$(INS.file)
398
399$(ROOT)/usr/include/%: %
400	$(INS.file)
401
402.KEEP_STATE:
403
404.PARALLEL:	$(ROOTHDRS) $(CHECKHDRS)
405
406install_h: 	$(ROOTDIRS) .WAIT $(ROOTHDRS) $(SYMHDRASSERT) $(SYMHDRERRNO) \
407		$(SYMHDRFLOAT) $(SYMHDRISO646)
408
409check:	$(CHECKHDRS)
410
411clean clobber:
412	cd rpcsvc ; $(RM) $(RPCSVC_GEN_HDRS)
413
414$(ROOTDIRS):
415	$(INS.dir)
416
417$(SYMHDRASSERT):
418	-$(RM) $@; $(SYMLINK) ../assert.h $@
419
420$(SYMHDRERRNO):
421	-$(RM) $@; $(SYMLINK) ../errno.h $@
422
423$(SYMHDRFLOAT):
424	-$(RM) $@; $(SYMLINK) ../float.h $@
425
426$(SYMHDRISO646):
427	-$(RM) $@; $(SYMLINK) ../iso646.h $@
428
429rpcsvc/%.h:	rpcsvc/%.x
430	$(RPCGEN) $(RPCGENFLAGS) $< -o $@
431
432rpcsvc/nis.h:	rpcsvc/nis.x
433	$(RPCGEN) $(RPCGENFLAGS) rpcsvc/nis.x |\
434	$(SED) -e '/EDIT_START/,$$ d' > $@
435