blob: 961fcaf109bce64b47171a2499869b293b11ccc2 [file] [log] [blame] [raw]
ifeq ($(CC),cc)
CC := gcc
endif
# OpenZFS on Linux, OpenZFS 2.0 or later (currently supports GNU/Linux and FreeBSD with new ZFS implementation)
CPPFLAGS ?= -I /usr/include/libspl/ -I /usr/include/libzfs/
# FreeBSD (before 13.0-RELEASE, must have patch zfs-headers-for-userspace.diff applied
#FREEBSD_SRC_PATH ?= /usr/src
#CPPFLAGS ?= -I $(FREEBSD_SRC_PATH)/cddl/contrib/opensolaris/lib/libzfs/common/ -I $(FREEBSD_SRC_PATH)/sys/cddl/compat/opensolaris/ -I $(FREEBSD_SRC_PATH)/cddl/compat/opensolaris/include/ -I $(FREEBSD_SRC_PATH)/sys/cddl/contrib/opensolaris/uts/common/ -I $(FREEBSD_SRC_PATH)/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/
CFLAGS += -Wall -Os $(CPPFLAGS)
LIBS += -l zfs -l nvpair
TARGETS := create-zpool
default: all
all: $(TARGETS)
create-zpool: create-zpool.o json_solaris_nvlist.o
$(CC) $(LDFLAGS) $^ -o $@ $(LIBS)
clean:
rm -f *.o $(TARGETS)