xref: /freebsd/sys/modules/zfs/Makefile (revision 8657387683946d0c03e09fe77029edfe309eeb20)
1# $FreeBSD$
2
3SYSDIR?=${SRCTOP}/sys
4
5KMOD=	zfs
6
7SRCS=	bus_if.h device_if.h vnode_if.h opt_kstack_pages.h
8
9SUNW=	${SYSDIR}/cddl/contrib/opensolaris
10
11.PATH:	${SUNW}/common/acl
12SRCS+=	acl_common.c
13.PATH:	${SUNW}/common/avl
14SRCS+=	avl.c
15.PATH:	${SUNW}/common/nvpair
16SRCS+=	opensolaris_nvpair.c
17SRCS+=	opensolaris_nvpair_alloc_fixed.c
18SRCS+=	opensolaris_fnvpair.c
19.PATH:	${SYSDIR}/cddl/contrib/opensolaris/common/unicode
20SRCS+=	u8_textprep.c
21
22.PATH:	${SYSDIR}/cddl/compat/opensolaris/kern
23SRCS+=	opensolaris_acl.c
24SRCS+=	opensolaris_dtrace.c
25SRCS+=	opensolaris_kobj.c
26SRCS+=	opensolaris_kstat.c
27SRCS+=	opensolaris_lookup.c
28SRCS+=	opensolaris_policy.c
29SRCS+=	opensolaris_string.c
30SRCS+=	opensolaris_sysevent.c
31SRCS+=	opensolaris_taskq.c
32SRCS+=	opensolaris_uio.c
33SRCS+=	opensolaris_vfs.c
34SRCS+=	opensolaris_vm.c
35SRCS+=	opensolaris_zone.c
36
37_A=${SYSDIR}/cddl/contrib/opensolaris/common/atomic
38.if exists(${_A}/${MACHINE_CPUARCH}/opensolaris_atomic.S)
39.PATH:	${_A}/${MACHINE_CPUARCH}
40SRCS+=		opensolaris_atomic.S
41.elif exists(${_A}/${MACHINE_ARCH}/opensolaris_atomic.S)
42.PATH:	${_A}/${MACHINE_ARCH}
43SRCS+=		opensolaris_atomic.S
44.else
45SRCS+=		opensolaris_atomic.c
46.endif
47
48.PATH:	${SUNW}/uts/common/fs
49SRCS+=	vnode.c
50
51.PATH:	${SUNW}/uts/common/os
52SRCS+=	callb.c
53SRCS+=	fm.c
54SRCS+=	list.c
55SRCS+=	nvpair_alloc_system.c
56
57.PATH:	${SUNW}/uts/common/zmod
58SRCS+=	adler32.c
59SRCS+=	opensolaris_crc32.c
60SRCS+=	deflate.c
61SRCS+=	inffast.c
62SRCS+=	inflate.c
63SRCS+=	inftrees.c
64SRCS+=	trees.c
65SRCS+=	zmod.c
66SRCS+=	zmod_subr.c
67SRCS+=	zutil.c
68
69.PATH:	${SYSDIR}/crypto/sha2
70SRCS+=	sha256c.c sha512c.c
71
72.PATH:	${SYSDIR}/crypto/skein
73SRCS+=	skein.c skein_block.c
74
75.PATH:	${SUNW}/common/zfs
76.include "${SUNW}/uts/common/Makefile.files"
77.PATH:	${SUNW}/uts/common/fs/zfs
78ZFS_SRCS=	${ZFS_OBJS:C/.o$/.c/}
79SRCS+=	${ZFS_SRCS}
80SRCS+=	vdev_geom.c
81SRCS+=	trim_map.c
82
83# Use FreeBSD's namecache.
84CFLAGS+=-DFREEBSD_NAMECACHE
85
86CFLAGS+=-I${SYSDIR}/cddl/compat/opensolaris
87CFLAGS+=-I${SUNW}/uts/common/fs/zfs
88CFLAGS+=-I${SUNW}/uts/common/zmod
89CFLAGS+=-I${SUNW}/uts/common
90CFLAGS+=-I${SYSDIR}
91CFLAGS+=-I${SUNW}/common/zfs
92CFLAGS+=-I${SUNW}/common
93CFLAGS+=-DBUILDING_ZFS
94
95.if ${MACHINE_ARCH} == "powerpc64"
96CFLAGS.gcc+=-mminimal-toc
97.endif
98
99.ifdef ZFS_DEBUG
100CFLAGS+=-DDEBUG=1
101DEBUG_FLAGS=-g
102.endif
103
104.include <bsd.kmod.mk>
105
106CFLAGS+=	-include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
107
108CWARNFLAGS+=-Wno-missing-prototypes
109CWARNFLAGS+=-Wno-undef
110CWARNFLAGS+=-Wno-strict-prototypes
111CWARNFLAGS+=-Wno-cast-qual
112CWARNFLAGS+=-Wno-parentheses
113CWARNFLAGS+=-Wno-redundant-decls
114CWARNFLAGS+=-Wno-missing-braces
115CWARNFLAGS+=-Wno-uninitialized
116CWARNFLAGS+=-Wno-unused
117CWARNFLAGS+=-Wno-inline
118CWARNFLAGS+=-Wno-switch
119CWARNFLAGS+=-Wno-pointer-arith
120