7580 ztest failure in dbuf_read_impl
[unleashed.git] / usr / src / head / Makefile
blob030a9d51f839b2bbe54d6a669dbfb149d3c4843f
2 # CDDL HEADER START
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]
19 # CDDL HEADER END
22 # Copyright 2011 Nexenta Systems, Inc. All rights reserved.
24 # Copyright 2010 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
27 # Copyright 2013 Garrett D'Amore <garrett@damore.org>
28 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
30 # head/Makefile
32 # include global definitions
33 include ../Makefile.master
35 sparc_HDRS=
36 i386_HDRS= stack_unwind.h
38 # Headers are listed one per line so that TeamWare can auto-merge most changes
40 KRB5HDRS= mit_copyright.h mit-sipb-copyright.h
42 ATTRDB_HDRS= secdb.h auth_attr.h exec_attr.h prof_attr.h user_attr.h \
43 auth_list.h
45 HDRS= $($(MACH)_HDRS) $(ATTRDB_HDRS) \
46 aio.h \
47 alloca.h \
48 apptrace.h \
49 apptrace_impl.h \
50 ar.h \
51 archives.h \
52 assert.h \
53 atomic.h \
54 attr.h \
55 complex.h \
56 config_admin.h \
57 cpio.h \
58 crypt.h \
59 ctype.h \
60 deflt.h \
61 devid.h \
62 devmgmt.h \
63 devpoll.h \
64 dial.h \
65 dirent.h \
66 dlfcn.h \
67 door.h \
68 elf.h \
69 endian.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 mdmn_changelog.h \
113 memory.h \
114 meta.h \
115 meta_runtime.h \
116 metadyn.h \
117 mon.h \
118 monetary.h \
119 mp.h \
120 mqueue.h \
121 nan.h \
122 ndbm.h \
123 ndpd.h \
124 netconfig.h \
125 netdb.h \
126 netdir.h \
127 nl_types.h \
128 nlist.h \
129 note.h \
130 nsctl.h \
131 nsswitch.h \
132 nss_common.h \
133 nss_dbdefs.h \
134 nss_netdir.h \
135 paths.h \
136 pcsample.h \
137 pfmt.h \
138 pkgdev.h \
139 pkginfo.h \
140 pkglocs.h \
141 pkgstrct.h \
142 pkgtrans.h \
143 poll.h \
144 port.h \
145 priv.h \
146 priv_utils.h \
147 proc_service.h \
148 procfs.h \
149 prof.h \
150 project.h \
151 pthread.h \
152 pw.h \
153 pwd.h \
154 rctl.h \
155 re_comp.h \
156 regex.h \
157 regexp.h \
158 resolv.h \
159 rje.h \
160 rtld_db.h \
161 sac.h \
162 sched.h \
163 schedctl.h \
164 sdssc.h \
165 search.h \
166 semaphore.h \
167 setjmp.h \
168 sgtty.h \
169 shadow.h \
170 siginfo.h \
171 signal.h \
172 spawn.h \
173 stdalign.h \
174 stdarg.h \
175 stdbool.h \
176 stddef.h \
177 stdint.h \
178 stdio.h \
179 stdio_ext.h \
180 stdio_tag.h \
181 stdio_impl.h \
182 stdlib.h \
183 stdnoreturn.h \
184 storclass.h \
185 string.h \
186 strings.h \
187 stropts.h \
188 synch.h \
189 sysexits.h \
190 syslog.h \
191 syms.h \
192 tar.h \
193 termio.h \
194 termios.h \
195 tgmath.h \
196 thread.h \
197 thread_db.h \
198 threads.h \
199 time.h \
200 tiuser.h \
201 tzfile.h \
202 ucontext.h \
203 ucred.h \
204 ulimit.h \
205 unistd.h \
206 userdefs.h \
207 ustat.h \
208 utime.h \
209 utmp.h \
210 utmpx.h \
211 valtools.h \
212 values.h \
213 varargs.h \
214 wait.h \
215 wchar.h \
216 wchar_impl.h \
217 wctype.h \
218 widec.h \
219 wordexp.h \
220 xlocale.h \
221 xti.h \
222 xti_inet.h \
223 zone.h
225 ISOHDRS = \
226 ctype_iso.h \
227 limits_iso.h \
228 locale_iso.h \
229 math_c99.h \
230 math_iso.h \
231 setjmp_iso.h \
232 signal_iso.h \
233 stdarg_c99.h \
234 stdarg_iso.h \
235 stddef_iso.h \
236 stdio_c99.h \
237 stdio_iso.h \
238 stdlib_c99.h \
239 stdlib_c11.h \
240 stdlib_iso.h \
241 string_iso.h \
242 time_iso.h \
243 wchar_c99.h \
244 wchar_iso.h \
245 wctype_iso.h
247 ARPAHDRS = \
248 ftp.h \
249 inet.h \
250 nameser.h \
251 telnet.h \
252 tftp.h \
253 nameser_compat.h
255 AUDIOHDRS = \
256 au.h
258 UUIDHDRS = \
259 uuid.h
261 # rpcsvc headers which are just headers (not derived from a .x file)
262 RPCSVC_SRC_HDRS = \
263 bootparam.h \
264 daemon_utils.h \
265 dbm.h \
266 nis_db.h \
267 nislib.h \
268 svc_dg_priv.h \
269 yp_prot.h \
270 ypclnt.h \
271 yppasswd.h \
272 ypupd.h \
273 rpc_sztypes.h
275 # rpcsvc headers which are generated from .x files
276 RPCSVC_GEN_HDRS = \
277 bootparam_prot.h \
278 mount.h \
279 nfs_prot.h \
280 nfs4_prot.h \
281 nis.h \
282 rex.h \
283 rquota.h \
284 rstat.h \
285 rusers.h \
286 rwall.h \
287 spray.h \
288 ufs_prot.h \
289 nfs_acl.h
291 LVMRPCHDRS = \
292 mhdx.h mdiox.h meta_basic.h metad.h metamed.h metamhd.h metacl.h
294 SYMHDRASSERT = $(ROOT)/usr/include/iso/assert_iso.h
295 SYMHDRERRNO = $(ROOT)/usr/include/iso/errno_iso.h
296 SYMHDRFLOAT = $(ROOT)/usr/include/iso/float_iso.h
297 SYMHDRISO646 = $(ROOT)/usr/include/iso/iso646_iso.h
299 RPCGENFLAGS = -C -h
300 rpcsvc/rwall.h := RPCGENFLAGS += -M
301 meta_basic.h := RPCGENFLAGS += -M
302 metad.h := RPCGENFLAGS += -M
303 metamed.h := RPCGENFLAGS += -M
304 mhdx.h := RPCGENFLAGS += -M
305 mdiox.h := RPCGENFLAGS += -M
306 metamhd.h := RPCGENFLAGS += -M
307 metacl.h := RPCGENFLAGS += -M
309 # rpcsvc rpcgen source (.x files)
311 # yp.x is an attempt at codifying what was hand coded in RPCL.
312 # Unfortunately it doesn't quite work. (The handcoded stuff isn't
313 # expressable in RPCL) this is due to the fact that YP was written
314 # before rpcgen existed. Hence, yp_prot.h cannot be derived from yp.x
316 # There is no `.h' for nis_object.x because it is included by nis.x and
317 # the resulting .h is nis.h.
319 RPCSVCPROTS = \
320 $(RPCSVC_GEN_HDRS:%.h=%.x) nis_object.x yp.x
322 LVMSVCPROTS = \
323 $(LVMRPCHDRS:%.h=%.x)
325 RPCSVCHDRS= $(RPCSVC_SRC_HDRS) $(RPCSVC_GEN_HDRS)
327 PROTOHDRS= dumprestore.h routed.h ripngd.h rwhod.h timed.h
329 ROOTHDRS= $(HDRS:%=$(ROOT)/usr/include/%) \
330 $(KRB5HDRS:%=$(ROOT)/usr/include/kerberosv5/%) \
331 $(ISOHDRS:%=$(ROOT)/usr/include/iso/%) \
332 $(ARPAHDRS:%=$(ROOT)/usr/include/arpa/%) \
333 $(AUDIOHDRS:%=$(ROOT)/usr/include/audio/%) \
334 $(UUIDHDRS:%=$(ROOT)/usr/include/uuid/%) \
335 $(RPCSVCHDRS:%=$(ROOT)/usr/include/rpcsvc/%) \
336 $(RPCSVCPROTS:%=$(ROOT)/usr/include/rpcsvc/%) \
337 $(LVMRPCHDRS:%=$(ROOT)/usr/include/%) \
338 $(PROTOHDRS:%=$(ROOT)/usr/include/protocols/%)
340 DIRS= iso arpa audio rpcsvc protocols security uuid kerberosv5
341 ROOTDIRS= $(DIRS:%=$(ROOT)/usr/include/%)
343 # check files really don't exist
345 # should do something with the rpcsvc headers
347 iso/%.check: iso/%.h
348 $(DOT_H_CHECK)
350 arpa/%.check: arpa/%.h
351 $(DOT_H_CHECK)
353 audio/%.check: audio/%.h
354 $(DOT_H_CHECK)
356 rpcsvc/%.check: rpcsvc/%.h
357 $(DOT_H_CHECK)
359 rpcsvc/%.check: rpcsvc/%.x
360 $(DOT_X_CHECK)
362 protocols/%.check: protocols/%.h
363 $(DOT_H_CHECK)
365 kerberosv5/%.check: kerberosv5/%.h
366 $(DOT_H_CHECK)
368 uuid/%.check: uuid/%.h
369 $(DOT_H_CHECK)
371 # Note that the derived headers (rpcgen) are not checked at this time. These
372 # need work at the source level and rpcgen itself has a bug which causes a
373 # cstyle violation. Furthermore, there seems to be good reasons for the
374 # generated headers to not pass all of the hdrchk rules.
376 # Add the following to the CHECKHDRS list to activate the .x checks:
377 # $(RPCSVCPROTS:%.x=rpcsvc/%.check) \
379 CHECKHDRS= $(HDRS:%.h=%.check) \
380 $(KRB5HDRS:%.h=kerberosv5/%.check) \
381 $(ISOHDRS:%.h=iso/%.check) \
382 $(ARPAHDRS:%.h=arpa/%.check) \
383 $(AUDIOHDRS:%.h=audio/%.check) \
384 $(UUIDHDRS:%.h=uuid/%.check) \
385 $(RPCSVC_SRC_HDRS:%.h=rpcsvc/%.check) \
386 $(PROTOHDRS:%.h=protocols/%.check)
388 # headers which won't quite meet the standards...
390 # assert.h is required by ansi-c to *not* be idempotent (section 4.1.2).
391 # Hence the trailing guard is not the last thing in the file nor can it
392 # be without playing silly games.
394 assert.check := HDRCHK_TAIL = | grep -v "end guard wrong" | true
396 # install rules
398 $(ROOT)/usr/include/security/%: security/%
399 $(INS.file)
401 $(ROOT)/usr/include/protocols/%: protocols/%
402 $(INS.file)
404 $(ROOT)/usr/include/rpcsvc/%: rpcsvc/%
405 $(INS.file)
407 $(ROOT)/usr/include/kerberosv5/%: kerberosv5/%
408 $(INS.file)
410 $(ROOT)/usr/include/arpa/%: arpa/%
411 $(INS.file)
413 $(ROOT)/usr/include/audio/%: audio/%
414 $(INS.file)
416 $(ROOT)/usr/include/iso/%: iso/%
417 $(INS.file)
419 $(ROOT)/usr/include/uuid/%: uuid/%
420 $(INS.file)
422 $(ROOT)/usr/include/%: %
423 $(INS.file)
425 .KEEP_STATE:
427 .PARALLEL: $(ROOTHDRS) $(CHECKHDRS)
429 install_h: $(ROOTDIRS) .WAIT $(ROOTHDRS) $(SYMHDRASSERT) $(SYMHDRERRNO) \
430 $(SYMHDRFLOAT) $(SYMHDRISO646)
432 check: $(CHECKHDRS)
434 clean clobber:
435 $(RM) $(LVMRPCHDRS);
436 cd rpcsvc ; $(RM) $(RPCSVC_GEN_HDRS)
438 $(ROOTDIRS):
439 $(INS.dir)
441 $(SYMHDRASSERT):
442 -$(RM) $@; $(SYMLINK) ../assert.h $@
444 $(SYMHDRERRNO):
445 -$(RM) $@; $(SYMLINK) ../errno.h $@
447 $(SYMHDRFLOAT):
448 -$(RM) $@; $(SYMLINK) ../float.h $@
450 $(SYMHDRISO646):
451 -$(RM) $@; $(SYMLINK) ../iso646.h $@
453 rpcsvc/%.h: rpcsvc/%.x
454 $(RPCGEN) $(RPCGENFLAGS) $< -o $@
456 rpcsvc/nis.h: rpcsvc/nis.x
457 $(RPCGEN) $(RPCGENFLAGS) rpcsvc/nis.x |\
458 $(SED) -e '/EDIT_START/,$$ d' > $@
460 meta_basic.h: ../uts/common/sys/lvm/meta_basic.x
461 $(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/meta_basic.x | \
462 $(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
463 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
464 { print $0 } \
465 ' > $@
467 metad.h: metad.x
468 $(RPCGEN) $(RPCGENFLAGS) metad.x | \
469 $(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
470 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
471 { print $0 } \
472 ' > $@
474 mhdx.h: ../uts/common/sys/lvm/mhdx.x
475 $(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/mhdx.x | \
476 $(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
477 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
478 { print $0 } \
479 ' > $@
481 mdiox.h: ../uts/common/sys/lvm/mdiox.x
482 $(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/mdiox.x | \
483 $(AWK) '{sub(/sys\/lvm\/md_mhdx/, "mhdx"); print $$0}' | \
484 $(AWK) '{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
485 $(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
486 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
487 { print $0 } \
488 ' > $@
490 metamed.h: ../uts/common/sys/lvm/metamed.x
491 $(RPCGEN) $(RPCGENFLAGS) ../uts/common/sys/lvm/metamed.x | \
492 $(AWK) '{sub(/sys\/lvm\/md_basic/, "meta_basic"); print $$0}' | \
493 $(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
494 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
495 { print $0 } \
496 ' > $@
498 metamhd.h: metamhd.x
499 $(RPCGEN) $(RPCGENFLAGS) metamhd.x | \
500 $(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
501 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
502 { print $0 } \
503 ' > $@
505 metacl.h: metacl.x
506 $(RPCGEN) $(RPCGENFLAGS) metacl.x | \
507 $(AWK) '/<synch.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
508 /<thread.h>/ { print "#ifdef _REENTRANT"; print $$0; print "#endif\t/* _REENTRANT */"; next } \
509 { print $0 } \
510 ' > $@