xref: /freebsd/sys/conf/kmod.mk (revision 8881d206f4e68b564c2c5f50fc717086fc3e827a)
1#	From: @(#)bsd.prog.mk	5.26 (Berkeley) 6/25/91
2# $FreeBSD$
3#
4# The include file <bsd.kmod.mk> handles building and installing loadable
5# kernel modules.
6#
7#
8# +++ variables +++
9#
10# CLEANFILES	Additional files to remove for the clean and cleandir targets.
11#
12# EXPORT_SYMS	A list of symbols that should be exported from the module,
13#		or the name of a file containing a list of symbols, or YES
14#		to export all symbols.  If not defined, no symbols are
15#		exported.
16#
17# KMOD		The name of the kernel module to build.
18#
19# KMODDIR	Base path for kernel modules (see kld(4)). [/boot/kernel]
20#
21# KMODOWN	Module file owner. [${BINOWN}]
22#
23# KMODGRP	Module file group. [${BINGRP}]
24#
25# KMODMODE	Module file mode. [${BINMODE}]
26#
27# KMODLOAD	Command to load a kernel module [/sbin/kldload]
28#
29# KMODUNLOAD	Command to unload a kernel module [/sbin/kldunload]
30#
31# KMODISLOADED	Command to check whether a kernel module is
32#		loaded [/sbin/kldstat -q -n]
33#
34# PROG		The name of the kernel module to build.
35#		If not supplied, ${KMOD}.ko is used.
36#
37# SRCS		List of source files.
38#
39# FIRMWS	List of firmware images in format filename:shortname:version
40#
41# FIRMWARE_LICENSE
42#		Set to the name of the license the user has to agree on in
43#		order to use this firmware. See /usr/share/doc/legal
44#
45# DESTDIR	The tree where the module gets installed. [not set]
46#
47# KERNBUILDDIR	Set to the location of the kernel build directory where
48#		the opt_*.h files, .o's and kernel winds up.
49#
50# BLOB_OBJS	Prebuilt binary blobs .o's from the src tree to be linked into
51#		the module. These are precious and not removed in make clean.
52#
53# +++ targets +++
54#
55# 	install:
56#               install the kernel module; if the Makefile
57#               does not itself define the target install, the targets
58#               beforeinstall and afterinstall may also be used to cause
59#               actions immediately before and after the install target
60#		is executed.
61#
62# 	load:
63#		Load a module.
64#
65# 	unload:
66#		Unload a module.
67#
68#	reload:
69#		Unload if loaded, then load.
70#
71
72AWK?=		awk
73KMODLOAD?=	/sbin/kldload
74KMODUNLOAD?=	/sbin/kldunload
75KMODISLOADED?=	/sbin/kldstat -q -n
76OBJCOPY?=	objcopy
77
78.include "kmod.opts.mk"
79.include <bsd.sysdir.mk>
80
81.SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S .m
82
83# amd64 uses direct linking for kmod, all others use shared binaries
84.if ${MACHINE_CPUARCH} != amd64
85__KLD_SHARED=yes
86.else
87__KLD_SHARED=no
88.endif
89
90.if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing)
91CFLAGS+=	-fno-strict-aliasing
92.endif
93WERROR?=	-Werror
94
95LINUXKPI_GENSRCS+= \
96	backlight_if.h \
97	bus_if.h \
98	device_if.h \
99	iicbus_if.h \
100	iicbb_if.h \
101	lkpi_iic_if.c \
102	lkpi_iic_if.h \
103	pci_if.h \
104	pci_iov_if.h \
105	pcib_if.h \
106	vnode_if.h \
107	usb_if.h \
108	opt_usb.h \
109	opt_stack.h
110
111CFLAGS+=	${WERROR}
112CFLAGS+=	-D_KERNEL
113CFLAGS+=	-DKLD_MODULE
114.if defined(MODULE_TIED)
115CFLAGS+=	-DKLD_TIED
116.endif
117
118# Don't use any standard or source-relative include directories.
119NOSTDINC=	-nostdinc
120CFLAGS:=	${CFLAGS:N-I*} ${NOSTDINC} ${INCLMAGIC} ${CFLAGS:M-I*}
121.if defined(KERNBUILDDIR)
122CFLAGS+=	-DHAVE_KERNEL_OPTION_HEADERS -include ${KERNBUILDDIR}/opt_global.h
123.else
124SRCS+=		opt_global.h
125CFLAGS+=	-include ${.OBJDIR}/opt_global.h
126.endif
127
128# Add -I paths for system headers.  Individual module makefiles don't
129# need any -I paths for this.  Similar defaults for .PATH can't be
130# set because there are no standard paths for non-headers.
131CFLAGS+=	-I. -I${SYSDIR} -I${SYSDIR}/contrib/ck/include
132
133CFLAGS.gcc+=	-finline-limit=${INLINE_LIMIT}
134CFLAGS.gcc+=	-fms-extensions
135CFLAGS.gcc+= --param inline-unit-growth=100
136CFLAGS.gcc+= --param large-function-growth=1000
137
138# Disallow common variables, and if we end up with commons from
139# somewhere unexpected, allocate storage for them in the module itself.
140#
141# -fno-common is the default for src builds, but this should be left in place
142# until at least we catch up to GCC10/LLVM11 or otherwise enable -fno-common
143# in <bsd.sys.mk> instead.  For now, we will have duplicate -fno-common in
144# CFLAGS for in-tree module builds as they will also pick it up from
145# share/mk/src.sys.mk, but the following is important for out-of-tree modules
146# (e.g. ports).
147CFLAGS+=	-fno-common
148LDFLAGS+=	-d -warn-common
149
150.if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mbuild-id}
151LDFLAGS+=	--build-id=sha1
152.endif
153
154CFLAGS+=	${DEBUG_FLAGS}
155.if ${MACHINE_CPUARCH} == aarch64 || ${MACHINE_CPUARCH} == amd64
156CFLAGS+=	-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
157.endif
158
159.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "riscv" || \
160    ${MACHINE_CPUARCH} == "powerpc"
161CFLAGS+=	-fPIC
162.endif
163
164# Temporary workaround for PR 196407, which contains the fascinating details.
165# Don't allow clang to use fpu instructions or registers in kernel modules.
166.if ${MACHINE_CPUARCH} == arm
167CFLAGS.clang+=	-mno-movt
168CFLAGS.clang+=	-mfpu=none
169CFLAGS+=	-funwind-tables
170.endif
171
172.if ${MACHINE_CPUARCH} == powerpc
173CFLAGS+=	-mlongcall -fno-omit-frame-pointer
174.if ${LINKER_TYPE} == "lld"
175# TOC optimization in LLD (9.0) currently breaks kernel modules, so disable it
176LDFLAGS+=	--no-toc-optimize
177.endif
178.endif
179
180.if defined(DEBUG) || defined(DEBUG_FLAGS)
181CTFFLAGS+=	-g
182.endif
183
184.if defined(FIRMWS)
185${KMOD:S/$/.c/}: ${SYSDIR}/tools/fw_stub.awk
186	${AWK} -f ${SYSDIR}/tools/fw_stub.awk ${FIRMWS} -m${KMOD} -c${KMOD:S/$/.c/g} \
187	    ${FIRMWARE_LICENSE:C/.+/-l/}${FIRMWARE_LICENSE}
188
189SRCS+=	${KMOD:S/$/.c/}
190CLEANFILES+=	${KMOD:S/$/.c/}
191
192.for _firmw in ${FIRMWS}
193${_firmw:C/\:.*$/.fwo/:T}:	${_firmw:C/\:.*$//} ${SYSDIR}/kern/firmw.S
194	@${ECHO} ${_firmw:C/\:.*$//} ${.ALLSRC:M*${_firmw:C/\:.*$//}}
195	${CC:N${CCACHE_BIN}} -c -x assembler-with-cpp -DLOCORE 	\
196	    ${CFLAGS} ${WERROR} 				\
197	    -DFIRMW_FILE="${.ALLSRC:M*${_firmw:C/\:.*$//}}" 	\
198	    -DFIRMW_SYMBOL="${_firmw:C/\:.*$//:C/[-.\/]/_/g}"	\
199	    ${SYSDIR}/kern/firmw.S -o ${.TARGET}
200
201OBJS+=	${_firmw:C/\:.*$/.fwo/:T}
202.endfor
203.endif
204
205# Conditionally include SRCS based on kernel config options.
206.for _o in ${KERN_OPTS}
207SRCS+=${SRCS.${_o}}
208.endfor
209
210OBJS+=	${SRCS:N*.h:R:S/$/.o/g}
211
212.if !defined(PROG)
213PROG=	${KMOD}.ko
214.endif
215
216.if !defined(DEBUG_FLAGS) || ${MK_KERNEL_SYMBOLS} == "no"
217FULLPROG=	${PROG}
218.else
219FULLPROG=	${PROG}.full
220${PROG}: ${FULLPROG} ${PROG}.debug
221	${OBJCOPY} --strip-debug --add-gnu-debuglink=${PROG}.debug \
222	    ${FULLPROG} ${.TARGET}
223${PROG}.debug: ${FULLPROG}
224	${OBJCOPY} --only-keep-debug ${FULLPROG} ${.TARGET}
225.endif
226
227.if ${__KLD_SHARED} == yes
228${FULLPROG}: ${KMOD}.kld
229	${LD} -m ${LD_EMULATION} -Bshareable -znotext -znorelro ${_LDFLAGS} \
230	    -o ${.TARGET} ${KMOD}.kld
231.if !defined(DEBUG_FLAGS)
232	${OBJCOPY} --strip-debug ${.TARGET}
233.endif
234.endif
235
236EXPORT_SYMS?=	NO
237.if ${EXPORT_SYMS} != YES
238CLEANFILES+=	export_syms
239.endif
240
241.if exists(${SYSDIR}/conf/ldscript.kmod.${MACHINE})
242LDSCRIPT_FLAGS?= -T ${SYSDIR}/conf/ldscript.kmod.${MACHINE}
243.endif
244
245.if ${__KLD_SHARED} == yes
246${KMOD}.kld: ${OBJS} ${BLOB_OBJS}
247.else
248${FULLPROG}: ${OBJS} ${BLOB_OBJS}
249.endif
250	${LD} -m ${LD_EMULATION} ${_LDFLAGS} ${LDSCRIPT_FLAGS} -r -d \
251	    -o ${.TARGET} ${OBJS} ${BLOB_OBJS}
252.if ${MK_CTF} != "no"
253	${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} ${BLOB_OBJS}
254.endif
255.if defined(EXPORT_SYMS)
256.if ${EXPORT_SYMS} != YES
257.if ${EXPORT_SYMS} == NO
258	:> export_syms
259.elif !exists(${.CURDIR}/${EXPORT_SYMS})
260	echo -n "${EXPORT_SYMS:@s@$s${.newline}@}" > export_syms
261.else
262	grep -v '^#' < ${EXPORT_SYMS} > export_syms
263.endif
264	${AWK} -f ${SYSDIR}/conf/kmod_syms.awk ${.TARGET} \
265	    export_syms | xargs -J% ${OBJCOPY} % ${.TARGET}
266.endif
267.endif # defined(EXPORT_SYMS)
268.if defined(PREFIX_SYMS)
269	${AWK} -v prefix=${PREFIX_SYMS} -f ${SYSDIR}/conf/kmod_syms_prefix.awk \
270	    ${.TARGET} /dev/null | xargs -J% ${OBJCOPY} % ${.TARGET}
271.endif
272.if !defined(DEBUG_FLAGS) && ${__KLD_SHARED} == no
273	${OBJCOPY} --strip-debug ${.TARGET}
274.endif
275
276_MAP_DEBUG_PREFIX= yes
277
278_ILINKS=machine
279.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
280_ILINKS+=x86
281.endif
282CLEANFILES+=${_ILINKS}
283
284all: ${PROG}
285
286beforedepend: ${_ILINKS}
287beforebuild: ${_ILINKS}
288
289# Ensure that the links exist without depending on it when it exists which
290# causes all the modules to be rebuilt when the directory pointed to changes.
291# Ensure that debug info references the path in the source tree.
292.for _link in ${_ILINKS}
293.if !exists(${.OBJDIR}/${_link})
294OBJS_DEPEND_GUESS+=	${_link}
295.endif
296.if defined(_MAP_DEBUG_PREFIX)
297.if ${_link} == "machine"
298CFLAGS+= -fdebug-prefix-map=./machine=${SYSDIR}/${MACHINE}/include
299.else
300CFLAGS+= -fdebug-prefix-map=./${_link}=${SYSDIR}/${_link}/include
301.endif
302.endif
303.endfor
304
305.NOPATH: ${_ILINKS}
306
307${_ILINKS}:
308	@case ${.TARGET} in \
309	machine) \
310		path=${SYSDIR}/${MACHINE}/include ;; \
311	*) \
312		path=${SYSDIR}/${.TARGET:T}/include ;; \
313	esac ; \
314	path=`realpath $$path`; \
315	${ECHO} ${.TARGET:T} "->" $$path ; \
316	ln -fns $$path ${.TARGET:T}
317
318CLEANFILES+= ${PROG} ${KMOD}.kld ${OBJS}
319
320.if defined(DEBUG_FLAGS) && ${MK_KERNEL_SYMBOLS} != "no"
321CLEANFILES+= ${FULLPROG} ${PROG}.debug
322.endif
323
324.if !target(install)
325
326_INSTALLFLAGS:=	${INSTALLFLAGS}
327.for ie in ${INSTALLFLAGS_EDIT}
328_INSTALLFLAGS:=	${_INSTALLFLAGS${ie}}
329.endfor
330
331.if !target(realinstall)
332KERN_DEBUGDIR?=	${DEBUGDIR}
333realinstall: _kmodinstall
334.ORDER: beforeinstall _kmodinstall
335_kmodinstall: .PHONY
336	${INSTALL} -T release -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \
337	    ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR}/
338.if defined(DEBUG_FLAGS) && !defined(INSTALL_NODEBUG) && ${MK_KERNEL_SYMBOLS} != "no"
339	${INSTALL} -T dbg -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \
340	    ${_INSTALLFLAGS} ${PROG}.debug ${DESTDIR}${KERN_DEBUGDIR}${KMODDIR}/
341.endif
342
343.include <bsd.links.mk>
344
345.if !defined(NO_XREF)
346afterinstall: _kldxref
347.ORDER: realinstall _kldxref
348.ORDER: _installlinks _kldxref
349_kldxref: .PHONY
350	@if type kldxref >/dev/null 2>&1; then \
351		${ECHO} ${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \
352		${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \
353	fi
354.endif
355.endif # !target(realinstall)
356
357.endif # !target(install)
358
359.if !target(load)
360load: ${PROG} .PHONY
361	${KMODLOAD} -v ${.OBJDIR}/${PROG}
362.endif
363
364.if !target(unload)
365unload: .PHONY
366	if ${KMODISLOADED} ${PROG} ; then ${KMODUNLOAD} -v ${PROG} ; fi
367.endif
368
369.if !target(reload)
370reload: unload load .PHONY
371.endif
372
373.if defined(KERNBUILDDIR)
374.PATH: ${KERNBUILDDIR}
375CFLAGS+=	-I${KERNBUILDDIR}
376.for _src in ${SRCS:Mopt_*.h}
377CLEANFILES+=	${_src}
378.if !target(${_src})
379${_src}:
380	ln -sf ${KERNBUILDDIR}/${_src} ${.TARGET}
381.endif
382.endfor
383.else
384.for _src in ${SRCS:Mopt_*.h}
385CLEANFILES+=	${_src}
386.if !target(${_src})
387${_src}:
388	:> ${.TARGET}
389.endif
390.endfor
391.endif
392
393# Add the sanitizer C flags
394CFLAGS+=	${SAN_CFLAGS}
395
396# Add the gcov flags
397CFLAGS+=	${GCOV_CFLAGS}
398
399# Respect configuration-specific C flags.
400CFLAGS+=	${ARCH_FLAGS} ${CONF_CFLAGS}
401
402.if !empty(SRCS:Mvnode_if.c)
403CLEANFILES+=	vnode_if.c
404vnode_if.c: ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src
405	${AWK} -f ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src -c
406.endif
407
408.if !empty(SRCS:Mvnode_if.h)
409CLEANFILES+=	vnode_if.h vnode_if_newproto.h vnode_if_typedef.h
410vnode_if.h vnode_if_newproto.h vnode_if_typedef.h: ${SYSDIR}/tools/vnode_if.awk \
411    ${SYSDIR}/kern/vnode_if.src
412vnode_if.h: vnode_if_newproto.h vnode_if_typedef.h
413	${AWK} -f ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src -h
414vnode_if_newproto.h:
415	${AWK} -f ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src -p
416vnode_if_typedef.h:
417	${AWK} -f ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src -q
418.endif
419
420# Build _if.[ch] from _if.m, and clean them when we're done.
421# __MPATH defined in config.mk
422_MFILES=${__MPATH:T:O}
423_MPATH=${__MPATH:H:O:u}
424.PATH.m: ${_MPATH}
425.for _i in ${SRCS:M*_if.[ch]}
426_MATCH=M${_i:R:S/$/.m/}
427_MATCHES=${_MFILES:${_MATCH}}
428.if !empty(_MATCHES)
429CLEANFILES+=	${_i}
430.endif
431.endfor # _i
432.m.c:	${SYSDIR}/tools/makeobjops.awk
433	${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -c
434
435.m.h:	${SYSDIR}/tools/makeobjops.awk
436	${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -h
437
438.for _i in mii pccard
439.if !empty(SRCS:M${_i}devs.h)
440CLEANFILES+=	${_i}devs.h
441${_i}devs.h: ${SYSDIR}/tools/${_i}devs2h.awk ${SYSDIR}/dev/${_i}/${_i}devs
442	${AWK} -f ${SYSDIR}/tools/${_i}devs2h.awk ${SYSDIR}/dev/${_i}/${_i}devs
443.endif
444.endfor # _i
445
446.if !empty(SRCS:Mbhnd_nvram_map.h)
447CLEANFILES+=	bhnd_nvram_map.h
448bhnd_nvram_map.h: ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.awk \
449    ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \
450    ${SYSDIR}/dev/bhnd/nvram/nvram_map
451bhnd_nvram_map.h:
452	sh ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \
453	    ${SYSDIR}/dev/bhnd/nvram/nvram_map -h
454.endif
455
456.if !empty(SRCS:Mbhnd_nvram_map_data.h)
457CLEANFILES+=	bhnd_nvram_map_data.h
458bhnd_nvram_map_data.h: ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.awk \
459    ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \
460    ${SYSDIR}/dev/bhnd/nvram/nvram_map
461bhnd_nvram_map_data.h:
462	sh ${SYSDIR}/dev/bhnd/tools/nvram_map_gen.sh \
463	    ${SYSDIR}/dev/bhnd/nvram/nvram_map -d
464.endif
465
466.if !empty(SRCS:Musbdevs.h)
467CLEANFILES+=	usbdevs.h
468usbdevs.h: ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs
469	${AWK} -f ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs -h
470.endif
471
472.if !empty(SRCS:Musbdevs_data.h)
473CLEANFILES+=	usbdevs_data.h
474usbdevs_data.h: ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs
475	${AWK} -f ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs -d
476.endif
477
478.if !empty(SRCS:Msdiodevs.h)
479CLEANFILES+=	sdiodevs.h
480sdiodevs.h: ${SYSDIR}/tools/sdiodevs2h.awk ${SYSDIR}/dev/sdio/sdiodevs
481	${AWK} -f ${SYSDIR}/tools/sdiodevs2h.awk ${SYSDIR}/dev/sdio/sdiodevs -h
482.endif
483
484.if !empty(SRCS:Msdiodevs_data.h)
485CLEANFILES+=	sdiodevs_data.h
486sdiodevs_data.h: ${SYSDIR}/tools/sdiodevs2h.awk ${SYSDIR}/dev/sdio/sdiodevs
487	${AWK} -f ${SYSDIR}/tools/sdiodevs2h.awk ${SYSDIR}/dev/sdio/sdiodevs -d
488.endif
489
490.if !empty(SRCS:Macpi_quirks.h)
491CLEANFILES+=	acpi_quirks.h
492acpi_quirks.h: ${SYSDIR}/tools/acpi_quirks2h.awk ${SYSDIR}/dev/acpica/acpi_quirks
493	${AWK} -f ${SYSDIR}/tools/acpi_quirks2h.awk ${SYSDIR}/dev/acpica/acpi_quirks
494.endif
495
496.if !empty(SRCS:Massym.inc) || !empty(DPSRCS:Massym.inc)
497CLEANFILES+=	assym.inc genassym.o
498DEPENDOBJS+=	genassym.o
499DPSRCS+=	offset.inc
500.endif
501.if defined(MODULE_TIED)
502DPSRCS+=	offset.inc
503.endif
504.if !empty(SRCS:Moffset.inc) || !empty(DPSRCS:Moffset.inc)
505CLEANFILES+=	offset.inc genoffset.o
506DEPENDOBJS+=	genoffset.o
507.endif
508assym.inc: genassym.o
509offset.inc: genoffset.o
510assym.inc: ${SYSDIR}/kern/genassym.sh
511	sh ${SYSDIR}/kern/genassym.sh genassym.o > ${.TARGET}
512genassym.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c offset.inc
513genassym.o: ${SRCS:Mopt_*.h}
514	${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon \
515	    ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c
516offset.inc: ${SYSDIR}/kern/genoffset.sh genoffset.o
517	sh ${SYSDIR}/kern/genoffset.sh genoffset.o > ${.TARGET}
518genoffset.o: ${SYSDIR}/kern/genoffset.c
519genoffset.o: ${SRCS:Mopt_*.h}
520	${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon \
521	    ${SYSDIR}/kern/genoffset.c
522
523CLEANDEPENDFILES+=	${_ILINKS}
524# .depend needs include links so we remove them only together.
525cleanilinks:
526	rm -f ${_ILINKS}
527
528OBJS_DEPEND_GUESS+= ${SRCS:M*.h}
529.if defined(KERNBUILDDIR)
530OBJS_DEPEND_GUESS+= opt_global.h
531.endif
532
533ZINCDIR=${SYSDIR}/contrib/openzfs/include
534OPENZFS_CFLAGS=     \
535	-D_SYS_VMEM_H_  \
536	-D__KERNEL__ \
537	-nostdinc \
538	-DSMP \
539	-I${ZINCDIR}  \
540	-I${ZINCDIR}/os/freebsd \
541	-I${ZINCDIR}/os/freebsd/spl \
542	-I${ZINCDIR}/os/freebsd/zfs \
543	-I${SYSDIR}/cddl/compat/opensolaris \
544	-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
545	-include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h
546OPENZFS_CWARNFLAGS= \
547	-Wno-nested-externs
548
549.include <bsd.dep.mk>
550.include <bsd.clang-analyze.mk>
551.include <bsd.obj.mk>
552.include "kern.mk"
553