xref: /freebsd/cddl/lib/libzpool/Makefile (revision eb69d1f144a6fcc765d1b9d44a5ae8082353e70b)
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/sys
51CFLAGS+=	-I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
52CFLAGS+=	-I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua
53CFLAGS+=	-I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs
54CFLAGS+=	-I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common
55CFLAGS+=	-I${SRCTOP}/cddl/contrib/opensolaris/head
56CFLAGS+=	-I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair
57CFLAGS+=	-I${SRCTOP}/cddl/contrib/opensolaris/lib/libcmdutils
58# XXX: pthread doesn't have mutex_owned() equivalent, so we need to look
59#      into libthr private structures. That's sooo evil, but it's only for
60#      ZFS debugging tools needs.
61CFLAGS+=	-DWANTS_MUTEX_OWNED
62CFLAGS+=	-I${SRCTOP}/lib/libpthread/thread
63CFLAGS+=	-I${SRCTOP}/lib/libpthread/sys
64CFLAGS+=	-I${SRCTOP}/lib/libthr/arch/${MACHINE_CPUARCH}/include
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