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