1# 2# Default build rules for all user space components, every Makefile.am 3# should include these rules and override or extend them as needed. 4# 5 6PHONY = 7DEFAULT_INCLUDES = \ 8 -include $(top_builddir)/zfs_config.h \ 9 -I$(top_builddir)/include \ 10 -I$(top_srcdir)/include \ 11 -I$(top_srcdir)/module/icp/include \ 12 -I$(top_srcdir)/lib/libspl/include 13 14if BUILD_LINUX 15DEFAULT_INCLUDES += \ 16 -I$(top_srcdir)/lib/libspl/include/os/linux 17endif 18 19if BUILD_FREEBSD 20DEFAULT_INCLUDES += \ 21 -I$(top_srcdir)/lib/libspl/include/os/freebsd 22endif 23 24AM_LIBTOOLFLAGS = --silent 25 26AM_CFLAGS = -std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes 27AM_CFLAGS += -fno-strict-aliasing 28AM_CFLAGS += $(NO_OMIT_FRAME_POINTER) 29AM_CFLAGS += $(DEBUG_CFLAGS) 30AM_CFLAGS += $(ASAN_CFLAGS) 31AM_CFLAGS += $(CODE_COVERAGE_CFLAGS) $(NO_FORMAT_ZERO_LENGTH) 32if BUILD_FREEBSD 33AM_CFLAGS += -fPIC -Werror -Wno-unknown-pragmas -Wno-enum-conversion 34AM_CFLAGS += -include $(top_srcdir)/include/os/freebsd/spl/sys/ccompile.h 35AM_CFLAGS += -I/usr/include -I/usr/local/include 36endif 37 38AM_CPPFLAGS = -D_GNU_SOURCE 39AM_CPPFLAGS += -D_REENTRANT 40AM_CPPFLAGS += -D_FILE_OFFSET_BITS=64 41AM_CPPFLAGS += -D_LARGEFILE64_SOURCE 42AM_CPPFLAGS += -DHAVE_LARGE_STACKS=1 43AM_CPPFLAGS += -DLIBEXECDIR=\"$(libexecdir)\" 44AM_CPPFLAGS += -DRUNSTATEDIR=\"$(runstatedir)\" 45AM_CPPFLAGS += -DSBINDIR=\"$(sbindir)\" 46AM_CPPFLAGS += -DSYSCONFDIR=\"$(sysconfdir)\" 47AM_CPPFLAGS += -DPKGDATADIR=\"$(pkgdatadir)\" 48AM_CPPFLAGS += $(DEBUG_CPPFLAGS) 49AM_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS) 50if BUILD_LINUX 51AM_CPPFLAGS += -DTEXT_DOMAIN=\"zfs-linux-user\" 52endif 53if BUILD_FREEBSD 54AM_CPPFLAGS += -DTEXT_DOMAIN=\"zfs-freebsd-user\" 55endif 56 57AM_LDFLAGS = $(DEBUG_LDFLAGS) 58AM_LDFLAGS += $(ASAN_LDFLAGS) 59 60if BUILD_FREEBSD 61AM_LDFLAGS += -fstack-protector-strong -shared 62AM_LDFLAGS += -Wl,-x -Wl,--fatal-warnings -Wl,--warn-shared-textrel 63AM_LDFLAGS += -lm 64endif 65