xref: /freebsd/stand/libsa/zfs/Makefile.inc (revision 56e8444a170934a09e200ee8ced1feccb1d32225)
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
9ZFS_SRC=	zfs.c nvlist.c skein.c skein_block.c list.c
10ZFS_SRC+=	zstd_shim.c
11ZSTD_SRC+=	entropy_common.c error_private.c
12ZSTD_SRC+=	fse_compress.c fse_decompress.c hist.c
13ZSTD_SRC+=	huf_compress.c huf_decompress.c pool.c xxhash.c
14ZSTD_SRC+=	zstd_common.c zstd_compress.c zstd_compress_literals.c
15ZSTD_SRC+=	zstd_compress_sequences.c zstd_compress_superblock.c
16ZSTD_SRC+=	zstd_ddict.c zstd_decompress.c zstd_decompress_block.c
17ZSTD_SRC+=	zstd_double_fast.c zstd_fast.c zstd_lazy.c zstd_ldm.c
18ZSTD_SRC+=	zstd_opt.c
19
20CFLAGS+=	-DHAS_ZSTD_ZFS
21SRCS+=		${ZFS_SRC} ${ZSTD_SRC}
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 ${ZFS_SRC} ${ZSTD_SRC}
32CFLAGS.$i+=	-include ${ZFSOSINC}/spl/sys/ccompile.h
33CFLAGS.$i+=	-Wformat -Wall
34.endfor
35
36CFLAGS_EARLY.list.c+= ${ZFS_EARLY}
37CFLAGS_EARLY.zstd_shim.c+= ${ZFS_EARLY}
38
39# Can't use the early flags because there's two conflicting definitions of boolean_t in
40# the zfs code that need to be unified.
41CFLAGS.nvlist.c+= -I${ZFSOSINC}/spl
42CFLAGS.zfs.c+=	-I${ZFSOSINC}/spl 				\
43		-I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 \
44		-I${ZFSOSINC}/zfs				\
45		-I${OZFS}/include
46
47#
48# ZSTD coding style has some issues, so suppress clang's warnings. Also, zstd's
49# use of BMI instrucitons is broken in this environment, so avoid them.
50#
51.for i in ${ZSTD_SRC}
52CFLAGS.$i+=	-U__BMI__ ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
53.endfor
54
55CFLAGS.zstd_shim.c+= -DIN_BASE -DIN_LIBSA -I${OZFS}/include
56
57# Do not unroll skein loops, reduce code size
58CFLAGS.skein_block.c+=	-DSKEIN_LOOP=111
59