blob: a796722655ca6c699f8a98ff9ac61002f0f668ba [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 patches zfs-headers-for-user-space.diff and remove-ioctl-details-from-libzfs-public-header.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 -Wno-unknown-pragmas -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)