xref: /freebsd/stand/libsa/zfs/Makefile.inc (revision e3aa18ad71782a73d3dd9dd3d526bbd2b607ca16)
1# $FreeBSD$
2
3.PATH:		${ZFSSRC}
4.PATH:		${SYSDIR}/crypto/skein
5.PATH:		${ZFSOSSRC}/spl
6.PATH:		${OZFS}/module/zstd/lib/common
7.PATH:		${OZFS}/module/zstd/lib/compress
8.PATH:		${OZFS}/module/zstd/lib/decompress
9ZFSSRC=		zfs.c nvlist.c skein.c skein_block.c list.c
10ZFSSRC+=	zstd_shim.c
11ZFSSRC+=	entropy_common.c error_private.c
12ZFSSRC+=	fse_compress.c fse_decompress.c hist.c
13ZFSSRC+=	huf_compress.c huf_decompress.c pool.c xxhash.c
14ZFSSRC+=	zstd_common.c zstd_compress.c zstd_compress_literals.c
15ZFSSRC+=	zstd_compress_sequences.c zstd_compress_superblock.c
16ZFSSRC+=	zstd_ddict.c zstd_decompress.c zstd_decompress_block.c
17ZFSSRC+=	zstd_double_fast.c zstd_fast.c zstd_lazy.c zstd_ldm.c
18ZFSSRC+=	zstd_opt.c
19
20CFLAGS+=	-DHAS_ZSTD_ZFS
21SRCS+=		${ZFSSRC}
22
23CFLAGS+=	-I${LDRSRC}
24CFLAGS+=	-I${SYSDIR}/cddl/boot/zfs
25CFLAGS+=	-I${SYSDIR}/crypto/skein
26
27ZFS_EARLY=	-I${ZFSOSINC}					\
28		-I${ZFSOSINC}/spl				\
29		-I${ZFSOSINC}/zfs
30
31.for i in ${ZFSSRC}
32CFLAGS.$i+=	-include ${ZFSOSINC}/spl/sys/ccompile.h
33.endfor
34
35CFLAGS_EARLY.list.c+= ${ZFS_EARLY}
36CFLAGS_EARLY.zstd_shim.c+= ${ZFS_EARLY}
37
38# Can't use the early flags because there's two conflicting definitions of boolean_t in
39# the zfs code that need to be unified.
40CFLAGS.nvlist.c+= -I${ZFSOSINC}/spl
41CFLAGS.zfs.c+=	-I${ZFSOSINC}/spl 				\
42		-I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4
43CFLAGS.entropy_common.c=	-U__BMI__
44CFLAGS.entropy_common.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
45CFLAGS.error_private.c=		-U__BMI__
46CFLAGS.error_private.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
47CFLAGS.fse_compress.c=		-U__BMI__
48CFLAGS.fse_compress.c+=		${NO_WBITWISE_INSTEAD_OF_LOGICAL}
49CFLAGS.fse_decompress.c=	-U__BMI__
50CFLAGS.fse_decompress.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
51CFLAGS.hist.c=			-U__BMI__
52CFLAGS.hist.c+=			${NO_WBITWISE_INSTEAD_OF_LOGICAL}
53CFLAGS.huf_compress.c=		-U__BMI__
54CFLAGS.huf_compress.c+=		${NO_WBITWISE_INSTEAD_OF_LOGICAL}
55CFLAGS.huf_decompress.c=	-U__BMI__
56CFLAGS.huf_decompress.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
57CFLAGS.pool.c=			-U__BMI__
58CFLAGS.pool.c+=			${NO_WBITWISE_INSTEAD_OF_LOGICAL}
59CFLAGS.xxhash.c=		-U__BMI__
60CFLAGS.xxhash.c+=		${NO_WBITWISE_INSTEAD_OF_LOGICAL}
61CFLAGS.zstd_common.c=		-U__BMI__
62CFLAGS.zstd_common.c+=		${NO_WBITWISE_INSTEAD_OF_LOGICAL}
63CFLAGS.zstd_compress.c=		 -U__BMI__
64CFLAGS.zstd_compress.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
65CFLAGS.zstd_compress_literals.c=	-U__BMI__
66CFLAGS.zstd_compress_literals.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
67CFLAGS.zstd_compress_sequences.c=	-U__BMI__
68CFLAGS.zstd_compress_sequences.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
69CFLAGS.zstd_compress_superblock.c=	-U__BMI__
70CFLAGS.zstd_compress_superblock.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
71CFLAGS.zstd_double_fast.c=	-U__BMI__
72CFLAGS.zstd_double_fast.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
73CFLAGS.zstd_fast.c=		-U__BMI__
74CFLAGS.zstd_fast.c+=		${NO_WBITWISE_INSTEAD_OF_LOGICAL}
75CFLAGS.zstd_lazy.c=		-U__BMI__
76CFLAGS.zstd_lazy.c+=		${NO_WBITWISE_INSTEAD_OF_LOGICAL}
77CFLAGS.zstd_ldm.c=		-U__BMI__
78CFLAGS.zstd_ldm.c+=		${NO_WBITWISE_INSTEAD_OF_LOGICAL}
79CFLAGS.zstd_opt.c=		-U__BMI__
80CFLAGS.zstd_opt.c+=		${NO_WBITWISE_INSTEAD_OF_LOGICAL}
81CFLAGS.zstd_ddict.c=		-U__BMI__
82CFLAGS.zstd_ddict.c+=		${NO_WBITWISE_INSTEAD_OF_LOGICAL}
83CFLAGS.zstd_decompress.c=	-U__BMI__
84CFLAGS.zstd_decompress.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
85CFLAGS.zstd_decompress_block.c=	-U__BMI__
86CFLAGS.zstd_decompress_block.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
87CFLAGS.zstd_shim.c+= -DIN_BASE -DIN_LIBSA -I${OZFS}/include
88
89# Do not unroll skein loops, reduce code size
90CFLAGS.skein_block.c+=	-DSKEIN_LOOP=111
91
92CFLAGS+=	-I${SYSDIR}/contrib/openzfs/include
93CFLAGS+=	-I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs
94CFLAGS.zfs.c+=	-I${SYSDIR}/cddl/contrib/opensolaris/common/lz4
95
96CFLAGS+=	-Wformat -Wall
97