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