xref: /freebsd/sys/modules/zfs/Makefile (revision 62cfcf62f627e5093fb37026a6d8c98e4d2ef04c)
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.PATH:	${SUNW}/common/lz4
22SRCS+=	lz4.c
23
24.PATH:	${SYSDIR}/cddl/compat/opensolaris/kern
25SRCS+=	opensolaris_acl.c
26SRCS+=	opensolaris_dtrace.c
27SRCS+=	opensolaris_kobj.c
28SRCS+=	opensolaris_kstat.c
29SRCS+=	opensolaris_lookup.c
30SRCS+=	opensolaris_policy.c
31SRCS+=	opensolaris_string.c
32SRCS+=	opensolaris_sysevent.c
33SRCS+=	opensolaris_taskq.c
34SRCS+=	opensolaris_uio.c
35SRCS+=	opensolaris_vfs.c
36SRCS+=	opensolaris_vm.c
37SRCS+=	opensolaris_zone.c
38
39_A=${SYSDIR}/cddl/contrib/opensolaris/common/atomic
40.if exists(${_A}/${MACHINE_CPUARCH}/opensolaris_atomic.S)
41.PATH:	${_A}/${MACHINE_CPUARCH}
42SRCS+=		opensolaris_atomic.S
43.elif exists(${_A}/${MACHINE_ARCH}/opensolaris_atomic.S)
44.PATH:	${_A}/${MACHINE_ARCH}
45SRCS+=		opensolaris_atomic.S
46.else
47SRCS+=		opensolaris_atomic.c
48.endif
49
50.PATH:	${SUNW}/uts/common/fs
51SRCS+=	vnode.c
52
53.PATH:	${SUNW}/uts/common/os
54SRCS+=	callb.c
55SRCS+=	fm.c
56SRCS+=	list.c
57SRCS+=	nvpair_alloc_system.c
58
59.PATH:	${SUNW}/uts/common/zmod
60SRCS+=	zmod.c
61
62.PATH:	${SYSDIR}/crypto/sha2
63SRCS+=	sha256c.c sha512c.c
64
65.PATH:	${SYSDIR}/crypto/skein
66SRCS+=	skein.c skein_block.c
67
68.PATH:	${SUNW}/common/zfs
69.include "${SUNW}/uts/common/Makefile.files"
70.PATH:	${SUNW}/uts/common/fs/zfs
71ZFS_SRCS=	${ZFS_OBJS:C/.o$/.c/}
72SRCS+=	${ZFS_SRCS}
73SRCS+=	vdev_geom.c
74SRCS+=	trim_map.c
75.PATH:	${SUNW}/uts/common/fs/zfs/lua
76LUA_SRCS=	${LUA_OBJS:C/.o$/.c/}
77SRCS+=	${LUA_SRCS}
78
79# Use FreeBSD's namecache.
80CFLAGS+=-DFREEBSD_NAMECACHE
81
82CFLAGS+=-I${SYSDIR}/cddl/compat/opensolaris
83CFLAGS+=-I${SUNW}/uts/common/fs/zfs
84CFLAGS+=-I${SUNW}/uts/common/fs/zfs/lua
85CFLAGS+=-I${SUNW}/uts/common/zmod
86CFLAGS+=-I${SUNW}/uts/common
87CFLAGS+=-I${SYSDIR}
88CFLAGS+=-I${SUNW}/common/zfs
89CFLAGS+=-I${SUNW}/common/lz4
90CFLAGS+=-I${SUNW}/common
91CFLAGS+=-DBUILDING_ZFS
92CFLAGS.gcc+=-fms-extensions
93
94.if ${MACHINE_ARCH} == "powerpc64"
95CFLAGS.gcc+=-mminimal-toc
96.endif
97
98.ifdef ZFS_DEBUG
99CFLAGS+=-DDEBUG=1
100DEBUG_FLAGS=-g
101.endif
102
103.include <bsd.kmod.mk>
104
105CFLAGS+=	-include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
106
107CWARNFLAGS+=-Wno-missing-prototypes
108CWARNFLAGS+=-Wno-undef
109CWARNFLAGS+=-Wno-strict-prototypes
110CWARNFLAGS+=-Wno-cast-qual
111CWARNFLAGS+=-Wno-parentheses
112CWARNFLAGS+=-Wno-redundant-decls
113CWARNFLAGS+=-Wno-missing-braces
114CWARNFLAGS+=-Wno-uninitialized
115CWARNFLAGS+=-Wno-unused
116CWARNFLAGS+=-Wno-inline
117CWARNFLAGS+=-Wno-switch
118CWARNFLAGS+=-Wno-pointer-arith
119