| ifeq ($(CC),cc) |
| CC := gcc |
| endif |
| |
| # No CPPFLAGS are required to build for Solaris; however it is required to use GNU ld to link the executable, which isn't usually supported on Solaris. |
| #CC := gcc-4.3.2-gld |
| |
| # 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) |