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 21ACFLAGS+= -Wa,--noexecstack 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/} 35LZ4_COMMON_SRCS= lz4.c 36LUA_SRCS= ${LUA_OBJS:C/.o$/.c/} 37KERNEL_SRCS= kernel.c taskq.c util.c 38LIST_SRCS= list.c 39UNICODE_SRCS= u8_textprep.c 40LIBCMDUTILS_SRCS=nicenum.c 41 42SRCS= ${ZFS_COMMON_SRCS} ${ZFS_SHARED_SRCS} ${LUA_SRCS} \ 43 ${LZ4_COMMON_SRCS} ${KERNEL_SRCS} ${LIST_SRCS} ${ATOMIC_SRCS} \ 44 ${UNICODE_SRCS} ${LIBCMDUTILS_SRCS} 45 46WARNS?= 0 47CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris 48CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include 49CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem 50CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs/common 51CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common 52CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 53CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua 54CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs 55CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 56CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common 57CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head 58CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair 59CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libcmdutils 60# XXX: pthread doesn't have mutex_owned() equivalent, so we need to look 61# into libthr private structures. That's sooo evil, but it's only for 62# ZFS debugging tools needs. 63CFLAGS+= -DWANTS_MUTEX_OWNED 64CFLAGS+= -I${SRCTOP}/lib/libpthread/thread 65CFLAGS+= -I${SRCTOP}/lib/libpthread/sys 66CFLAGS+= -I${SRCTOP}/lib/libthr/arch/${MACHINE_CPUARCH}/include 67CFLAGS.lz4.c+= -D_FAKE_KERNEL 68CFLAGS.gcc+= -fms-extensions 69 70LIBADD= md pthread z nvpair avl umem 71 72# atomic.S doesn't like profiling. 73MK_PROFILE= no 74 75CSTD= c99 76 77# Since there are many asserts in this library, it makes no sense to compile 78# it without debugging. 79 80CFLAGS+= -g -DDEBUG=1 81 82.include <bsd.lib.mk> 83