8 INCDIR=${.CURDIR:H}/include
12 .PATH: ${SRCDIR}/avl \
13 ${SRCDIR}/icp/algs/blake3 \
14 ${SRCDIR}/icp/asm-aarch64/blake3 \
15 ${SRCDIR}/icp/asm-ppc64/blake3 \
16 ${SRCDIR}/icp/asm-x86_64/blake3 \
19 ${SRCDIR}/icp/algs/edonr \
20 ${SRCDIR}/os/freebsd/spl \
21 ${SRCDIR}/os/freebsd/zfs \
26 ${SRCDIR}/zstd/lib/common \
27 ${SRCDIR}/zstd/lib/compress \
28 ${SRCDIR}/zstd/lib/decompress
32 CFLAGS+= -I${.OBJDIR:H}/include
34 CFLAGS+= -I${INCDIR}/os/freebsd
35 CFLAGS+= -I${INCDIR}/os/freebsd/spl
36 CFLAGS+= -I${INCDIR}/os/freebsd/zfs
37 CFLAGS+= -I${SRCDIR}/zstd/include
38 CFLAGS+= -I${SRCDIR}/icp/include
39 CFLAGS+= -include ${INCDIR}/os/freebsd/spl/sys/ccompile.h
41 CFLAGS+= -D__KERNEL__ -DFREEBSD_NAMECACHE -DBUILDING_ZFS -D__BSD_VISIBLE=1 \
42 -DHAVE_UIO_ZEROCOPY -DWITHOUT_NETDUMP -D__KERNEL -D_SYS_CONDVAR_H_ \
43 -D_SYS_VMEM_H_ -DKDTRACE_HOOKS -DSMP -DCOMPAT_FREEBSD11
45 .if ${MACHINE_ARCH} == "amd64"
46 CFLAGS+= -D__x86_64 -DHAVE_SSE2 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 \
47 -DHAVE_AVX -DHAVE_AVX2 -DHAVE_AVX512F -DHAVE_AVX512VL
50 .if defined(WITH_DEBUG) && ${WITH_DEBUG} == "true"
51 CFLAGS+= -DZFS_DEBUG -g
52 .if defined(WITH_INVARIANTS) && ${WITH_INVARIANTS} == "true"
53 CFLAGS+= -DINVARIANTS -DWITNESS -DOPENSOLARIS_WITNESS
55 .if defined(WITH_O0) && ${WITH_O0} == "true"
62 .if defined(WITH_VFS_DEBUG) && ${WITH_VFS_DEBUG} == "true"
63 # kernel must also be built with this option for this to work
64 CFLAGS+= -DDEBUG_VFS_LOCKS
67 .if defined(WITH_GCOV) && ${WITH_GCOV} == "true"
68 CFLAGS+= -fprofile-arcs -ftest-coverage
73 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
74 ${MACHINE_ARCH} == "arm"
75 CFLAGS+= -DBITS_PER_LONG=32
77 CFLAGS+= -DBITS_PER_LONG=64
80 SRCS= vnode_if.h device_if.h bus_if.h
94 #icp/asm-aarch64/blake3
95 SRCS+= b3_aarch64_sse2.S \
99 SRCS+= b3_ppc64le_sse2.S \
102 #icp/asm-x86_64/blake3
103 SRCS+= blake3_avx2.S \
141 SRCS+= acl_common.c \
165 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
166 ${MACHINE_ARCH} == "arm"
201 SRCS+= zfeature_common.c \
205 zfs_fletcher_avx512.c \
206 zfs_fletcher_intel.c \
208 zfs_fletcher_superscalar.c \
209 zfs_fletcher_superscalar4.c \
291 vdev_indirect_births.c \
292 vdev_indirect_mapping.c \
300 vdev_raidz_math_scalar.c \
301 vdev_raidz_math_avx2.c \
302 vdev_raidz_math_avx512bw.c \
303 vdev_raidz_math_avx512f.c \
304 vdev_raidz_math_sse2.c \
305 vdev_raidz_math_ssse3.c \
355 zstd_compress_literals.c \
356 zstd_compress_sequences.c \
357 zstd_compress_superblock.c \
366 zstd_decompress_block.c
369 .if ${MK_DEBUG_FILES} != "no"
371 -f /etc/mtree/BSD.debug.dist \
372 -p ${DESTDIR}/usr/lib
375 .include <bsd.kmod.mk>
378 CFLAGS.gcc+= -Wno-pointer-to-int-cast
380 CFLAGS.lapi.c= -Wno-cast-qual
381 CFLAGS.lcompat.c= -Wno-cast-qual
382 CFLAGS.lobject.c= -Wno-cast-qual
383 CFLAGS.ltable.c= -Wno-cast-qual
384 CFLAGS.lvm.c= -Wno-cast-qual
385 CFLAGS.nvpair.c= -DHAVE_RPC_TYPES -Wno-cast-qual
386 CFLAGS.spl_string.c= -Wno-cast-qual
387 CFLAGS.spl_vm.c= -Wno-cast-qual
388 CFLAGS.spl_zlib.c= -Wno-cast-qual
389 CFLAGS.abd.c= -Wno-cast-qual
390 CFLAGS.zfs_log.c= -Wno-cast-qual
391 CFLAGS.zfs_vnops_os.c= -Wno-pointer-arith
392 CFLAGS.u8_textprep.c= -Wno-cast-qual
393 CFLAGS.zfs_fletcher.c= -Wno-cast-qual -Wno-pointer-arith
394 CFLAGS.zfs_fletcher_intel.c= -Wno-cast-qual -Wno-pointer-arith
395 CFLAGS.zfs_fletcher_sse.c= -Wno-cast-qual -Wno-pointer-arith
396 CFLAGS.zfs_fletcher_avx512.c= -Wno-cast-qual -Wno-pointer-arith
397 CFLAGS.zprop_common.c= -Wno-cast-qual
398 CFLAGS.ddt.c= -Wno-cast-qual
399 CFLAGS.dmu.c= -Wno-cast-qual
400 CFLAGS.dmu_traverse.c= -Wno-cast-qual
401 CFLAGS.dsl_dir.c= -Wno-cast-qual
402 CFLAGS.dsl_deadlist.c= -Wno-cast-qual
403 CFLAGS.dsl_prop.c= -Wno-cast-qual
404 CFLAGS.edonr.c=-Wno-cast-qual
405 CFLAGS.fm.c= -Wno-cast-qual
406 CFLAGS.lz4_zfs.c= -Wno-cast-qual
407 CFLAGS.spa.c= -Wno-cast-qual
408 CFLAGS.spa_misc.c= -Wno-cast-qual
409 CFLAGS.sysctl_os.c= -include ../zfs_config.h
410 CFLAGS.vdev_draid.c= -Wno-cast-qual
411 CFLAGS.vdev_raidz.c= -Wno-cast-qual
412 CFLAGS.vdev_raidz_math.c= -Wno-cast-qual
413 CFLAGS.vdev_raidz_math_scalar.c= -Wno-cast-qual
414 CFLAGS.vdev_raidz_math_avx2.c= -Wno-cast-qual -Wno-duplicate-decl-specifier
415 CFLAGS.vdev_raidz_math_avx512f.c= -Wno-cast-qual -Wno-duplicate-decl-specifier
416 CFLAGS.vdev_raidz_math_sse2.c= -Wno-cast-qual -Wno-duplicate-decl-specifier
417 CFLAGS.zap_leaf.c= -Wno-cast-qual
418 CFLAGS.zap_micro.c= -Wno-cast-qual
419 CFLAGS.zcp.c= -Wno-cast-qual
420 CFLAGS.zfs_fm.c= -Wno-cast-qual
421 CFLAGS.zfs_ioctl.c= -Wno-cast-qual
422 CFLAGS.zil.c= -Wno-cast-qual
423 CFLAGS.zio.c= -Wno-cast-qual
424 CFLAGS.zrlock.c= -Wno-cast-qual
425 CFLAGS.zfs_zstd.c= -Wno-cast-qual -Wno-pointer-arith
426 CFLAGS.entropy_common.c= -fno-tree-vectorize -U__BMI__
427 CFLAGS.error_private.c= -fno-tree-vectorize -U__BMI__
428 CFLAGS.fse_decompress.c= -fno-tree-vectorize -U__BMI__
429 CFLAGS.pool.c= -fno-tree-vectorize -U__BMI__
430 CFLAGS.xxhash.c= -fno-tree-vectorize -U__BMI__
431 CFLAGS.zstd_common.c= -fno-tree-vectorize -U__BMI__
432 CFLAGS.fse_compress.c= -fno-tree-vectorize -U__BMI__
433 CFLAGS.hist.c= -fno-tree-vectorize -U__BMI__
434 CFLAGS.huf_compress.c= -fno-tree-vectorize -U__BMI__
435 CFLAGS.zstd_compress.c= -fno-tree-vectorize -U__BMI__
436 CFLAGS.zstd_compress_literals.c= -fno-tree-vectorize -U__BMI__
437 CFLAGS.zstd_compress_sequences.c= -fno-tree-vectorize -U__BMI__
438 CFLAGS.zstd_compress_superblock.c= -fno-tree-vectorize -U__BMI__
439 CFLAGS.zstd_double_fast.c= -fno-tree-vectorize -U__BMI__
440 CFLAGS.zstd_fast.c= -fno-tree-vectorize -U__BMI__
441 CFLAGS.zstd_lazy.c= -fno-tree-vectorize -U__BMI__
442 CFLAGS.zstd_ldm.c= -fno-tree-vectorize -U__BMI__
443 CFLAGS.zstd_opt.c= -fno-tree-vectorize -U__BMI__
444 CFLAGS.huf_decompress.c= -fno-tree-vectorize -U__BMI__
445 CFLAGS.zstd_ddict.c= -fno-tree-vectorize -U__BMI__
446 CFLAGS.zstd_decompress.c= -fno-tree-vectorize -U__BMI__
447 CFLAGS.zstd_decompress_block.c= -fno-tree-vectorize -U__BMI__