xref: /freebsd/cddl/lib/libzpool/Makefile (revision f976241773df2260e6170317080761d1c5814fe5)
1# $FreeBSD$
2
3.include "${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/Makefile.files"
4
5# ZFS_COMMON_SRCS
6.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
7# LUA_SRCS
8.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua
9# ZFS_SHARED_SRCS
10.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs
11# LZ4_COMMON_SRCS
12.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4
13# KERNEL_SRCS
14.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common
15# LIST_SRCS
16.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/os
17# ATOMIC_SRCS
18.if exists(${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}/opensolaris_atomic.S)
19.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}
20ATOMIC_SRCS=	opensolaris_atomic.S
21.if ${MACHINE_ARCH} != "sparc64"
22ACFLAGS+=	-Wa,--noexecstack
23.endif
24.else
25.PATH: ${SRCTOP}/sys/cddl/compat/opensolaris/kern
26ATOMIC_SRCS=	opensolaris_atomic.c
27.endif
28# UNICODE_SRCS
29.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/unicode
30# LIBCMDUTILS_SRCS
31.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libcmdutils/common
32
33LIB=		zpool
34
35ZFS_COMMON_SRCS= ${ZFS_COMMON_OBJS:C/.o$/.c/} trim_map.c
36ZFS_SHARED_SRCS= ${ZFS_SHARED_OBJS:C/.o$/.c/}
37LZ4_COMMON_SRCS= lz4.c
38LUA_SRCS=	${LUA_OBJS:C/.o$/.c/}
39KERNEL_SRCS=	kernel.c taskq.c util.c
40LIST_SRCS=	list.c
41UNICODE_SRCS=	u8_textprep.c
42LIBCMDUTILS_SRCS=nicenum.c
43
44SRCS=		${ZFS_COMMON_SRCS} ${ZFS_SHARED_SRCS} ${LUA_SRCS} \
45		${LZ4_COMMON_SRCS} ${KERNEL_SRCS} ${LIST_SRCS} ${ATOMIC_SRCS} \
46		${UNICODE_SRCS} ${LIBCMDUTILS_SRCS}
47
48WARNS?=		0
49CFLAGS+=	-I${SRCTOP}/sys/cddl/compat/opensolaris
50CFLAGS+=	-I${SRCTOP}/cddl/compat/opensolaris/include
51CFLAGS+=	-I${SRCTOP}/cddl/compat/opensolaris/lib/libumem
52CFLAGS+=	-I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common
53CFLAGS+=	-I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common
54CFLAGS+=	-I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
55CFLAGS+=	-I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua
56CFLAGS+=	-I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs
57CFLAGS+=	-I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4
58CFLAGS+=	-I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common
59CFLAGS+=	-I${SRCTOP}/cddl/contrib/opensolaris/head
60CFLAGS+=	-I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair
61CFLAGS+=	-I${SRCTOP}/cddl/contrib/opensolaris/lib/libcmdutils
62# XXX: pthread doesn't have mutex_owned() equivalent, so we need to look
63#      into libthr private structures. That's sooo evil, but it's only for
64#      ZFS debugging tools needs.
65CFLAGS+=	-DWANTS_MUTEX_OWNED
66CFLAGS+=	-I${SRCTOP}/lib/libpthread/thread
67CFLAGS+=	-I${SRCTOP}/lib/libpthread/sys
68CFLAGS+=	-I${SRCTOP}/lib/libthr/arch/${MACHINE_CPUARCH}/include
69CFLAGS.lz4.c+=	-D_FAKE_KERNEL
70CFLAGS.gcc+=	-fms-extensions
71
72LIBADD=		md pthread z nvpair avl umem
73
74# atomic.S doesn't like profiling.
75MK_PROFILE=	no
76
77CSTD=	c99
78
79# Since there are many asserts in this library, it makes no sense to compile
80# it without debugging.
81
82CFLAGS+=	-g -DDEBUG=1
83
84.include <bsd.lib.mk>
85