8 INCDIR=${.CURDIR:H}/include
12 .PATH: ${SRCDIR}/avl \
15 ${SRCDIR}/os/freebsd/spl \
16 ${SRCDIR}/os/freebsd/zfs \
25 CFLAGS+= -I${.OBJDIR:H}/include
27 CFLAGS+= -I${INCDIR}/os/freebsd
28 CFLAGS+= -I${INCDIR}/os/freebsd/spl
29 CFLAGS+= -I${INCDIR}/os/freebsd/zfs
30 CFLAGS+= -I${SRCDIR}/zstd/include
31 CFLAGS+= -include ${INCDIR}/os/freebsd/spl/sys/ccompile.h
33 CFLAGS+= -D__KERNEL__ -DFREEBSD_NAMECACHE -DBUILDING_ZFS -D__BSD_VISIBLE=1 \
34 -DHAVE_UIO_ZEROCOPY -DWITHOUT_NETDUMP -D__KERNEL -D_SYS_CONDVAR_H_ \
35 -D_SYS_VMEM_H_ -DKDTRACE_HOOKS -DSMP -DHAVE_KSID -DCOMPAT_FREEBSD11
37 .if ${MACHINE_ARCH} == "amd64"
38 CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_SSE2 -DHAVE_AVX512F -DHAVE_SSSE3
41 .if defined(WITH_DEBUG) && ${WITH_DEBUG} == "true"
42 CFLAGS+= -DINVARIANTS -DWITNESS -g -O0 -DZFS_DEBUG -DOPENSOLARIS_WITNESS
47 .if defined(WITH_VFS_DEBUG) && ${WITH_VFS_DEBUG} == "true"
48 # kernel must also be built with this option for this to work
49 CFLAGS+= -DDEBUG_VFS_LOCKS
52 .if defined(WITH_GCOV) && ${WITH_GCOV} == "true"
53 CFLAGS+= -fprofile-arcs -ftest-coverage
58 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
59 ${MACHINE_ARCH} == "arm"
60 CFLAGS+= -DBITS_PER_LONG=32
62 CFLAGS+= -DBITS_PER_LONG=64
65 SRCS= vnode_if.h device_if.h bus_if.h
103 SRCS+= acl_common.c \
128 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
129 ${MACHINE_ARCH} == "arm"
162 SRCS+= zfeature_common.c \
166 zfs_fletcher_avx512.c \
167 zfs_fletcher_intel.c \
169 zfs_fletcher_superscalar.c \
170 zfs_fletcher_superscalar4.c \
248 vdev_indirect_births.c \
249 vdev_indirect_mapping.c \
257 vdev_raidz_math_scalar.c \
259 vdev_raidz_math_avx2.c \
260 vdev_raidz_math_avx512bw.c \
261 vdev_raidz_math_avx512f.c \
262 vdev_raidz_math_sse2.c \
263 vdev_raidz_math_ssse3.c \
303 .if ${MK_DEBUG_FILES} != "no"
305 -f /etc/mtree/BSD.debug.dist \
306 -p ${DESTDIR}/usr/lib
309 .include <bsd.kmod.mk>
312 CFLAGS.gcc+= -Wno-pointer-to-int-cast
314 CFLAGS.lapi.c= -Wno-cast-qual
315 CFLAGS.lcompat.c= -Wno-cast-qual
316 CFLAGS.lobject.c= -Wno-cast-qual
317 CFLAGS.ltable.c= -Wno-cast-qual
318 CFLAGS.lvm.c= -Wno-cast-qual
319 CFLAGS.nvpair.c= -DHAVE_RPC_TYPES -Wno-cast-qual
320 CFLAGS.spl_string.c= -Wno-cast-qual
321 CFLAGS.spl_vm.c= -Wno-cast-qual
322 CFLAGS.spl_zlib.c= -Wno-cast-qual
323 CFLAGS.abd.c= -Wno-cast-qual
324 CFLAGS.zfs_log.c= -Wno-cast-qual
325 CFLAGS.zfs_vnops.c= -Wno-pointer-arith
326 CFLAGS.u8_textprep.c= -Wno-cast-qual
327 CFLAGS.zfs_fletcher.c= -Wno-cast-qual -Wno-pointer-arith
328 CFLAGS.zfs_fletcher_intel.c= -Wno-cast-qual -Wno-pointer-arith
329 CFLAGS.zfs_fletcher_sse.c= -Wno-cast-qual -Wno-pointer-arith
330 CFLAGS.zfs_fletcher_avx512.c= -Wno-cast-qual -Wno-pointer-arith
331 CFLAGS.zprop_common.c= -Wno-cast-qual
332 CFLAGS.ddt.c= -Wno-cast-qual
333 CFLAGS.dmu.c= -Wno-cast-qual
334 CFLAGS.dmu_traverse.c= -Wno-cast-qual
335 CFLAGS.dsl_dir.c= -Wno-cast-qual
336 CFLAGS.dsl_deadlist.c= -Wno-cast-qual
337 CFLAGS.dsl_prop.c= -Wno-cast-qual
338 CFLAGS.fm.c= -Wno-cast-qual
339 CFLAGS.lz4.c= -Wno-cast-qual
340 CFLAGS.spa.c= -Wno-cast-qual
341 CFLAGS.spa_misc.c= -Wno-cast-qual
342 CFLAGS.sysctl_os.c= -include ../zfs_config.h
343 CFLAGS.vdev_raidz.c= -Wno-cast-qual
344 CFLAGS.vdev_raidz_math.c= -Wno-cast-qual
345 CFLAGS.vdev_raidz_math_scalar.c= -Wno-cast-qual
346 CFLAGS.vdev_raidz_math_avx2.c= -Wno-cast-qual -Wno-duplicate-decl-specifier
347 CFLAGS.vdev_raidz_math_avx512f.c= -Wno-cast-qual -Wno-duplicate-decl-specifier
348 CFLAGS.vdev_raidz_math_sse2.c= -Wno-cast-qual -Wno-duplicate-decl-specifier
349 CFLAGS.zap_leaf.c= -Wno-cast-qual
350 CFLAGS.zap_micro.c= -Wno-cast-qual
351 CFLAGS.zcp.c= -Wno-cast-qual
352 CFLAGS.zfs_fm.c= -Wno-cast-qual
353 CFLAGS.zfs_ioctl.c= -Wno-cast-qual
354 CFLAGS.zil.c= -Wno-cast-qual
355 CFLAGS.zio.c= -Wno-cast-qual
356 CFLAGS.zrlock.c= -Wno-cast-qual
357 CFLAGS.zfs_zstd.c= -Wno-cast-qual -Wno-pointer-arith
358 CFLAGS.zstd.c= -fno-tree-vectorize -U__BMI__