]>
Commit | Line | Data |
---|---|---|
fed90353 BB |
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 | ||
0e6c493f | 6 | PHONY = |
c8970f52 | 7 | AM_CPPFLAGS = \ |
109d2c93 AS |
8 | -include $(top_builddir)/zfs_config.h \ |
9 | -I$(top_builddir)/include \ | |
d31277ab MM |
10 | -I$(top_srcdir)/include \ |
11 | -I$(top_srcdir)/module/icp/include \ | |
c8970f52 AZ |
12 | -I$(top_srcdir)/lib/libspl/include \ |
13 | -I$(top_srcdir)/lib/libspl/include/os/@ac_system_l@ | |
9f0a21e6 | 14 | |
c9c0d073 | 15 | AM_LIBTOOLFLAGS = --silent |
fed90353 | 16 | |
a926aab9 | 17 | AM_CFLAGS = -std=gnu99 -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wno-sign-compare -Wno-missing-field-initializers |
ae7b167a | 18 | AM_CFLAGS += -fno-strict-aliasing |
d5d2ef2b | 19 | AM_CFLAGS += $(NO_OMIT_FRAME_POINTER) |
6954c22f | 20 | AM_CFLAGS += $(IMPLICIT_FALLTHROUGH) |
fed90353 BB |
21 | AM_CFLAGS += $(DEBUG_CFLAGS) |
22 | AM_CFLAGS += $(ASAN_CFLAGS) | |
63652e15 | 23 | AM_CFLAGS += $(UBSAN_CFLAGS) |
c00c085b RN |
24 | AM_CFLAGS += $(CODE_COVERAGE_CFLAGS) |
25 | AM_CFLAGS += $(NO_FORMAT_ZERO_LENGTH) | |
26 | AM_CFLAGS += $(NO_FORMAT_TRUNCATION) | |
9f0a21e6 MM |
27 | if BUILD_FREEBSD |
28 | AM_CFLAGS += -fPIC -Werror -Wno-unknown-pragmas -Wno-enum-conversion | |
29 | AM_CFLAGS += -include $(top_srcdir)/include/os/freebsd/spl/sys/ccompile.h | |
30 | AM_CFLAGS += -I/usr/include -I/usr/local/include | |
9f0a21e6 | 31 | endif |
fed90353 | 32 | |
c8970f52 | 33 | AM_CPPFLAGS += -D_GNU_SOURCE |
fed90353 BB |
34 | AM_CPPFLAGS += -D_REENTRANT |
35 | AM_CPPFLAGS += -D_FILE_OFFSET_BITS=64 | |
36 | AM_CPPFLAGS += -D_LARGEFILE64_SOURCE | |
07917db9 | 37 | AM_CPPFLAGS += -DLIBEXECDIR=\"$(libexecdir)\" |
b53077a9 | 38 | AM_CPPFLAGS += -DZFSEXECDIR=\"$(zfsexecdir)\" |
07917db9 CD |
39 | AM_CPPFLAGS += -DRUNSTATEDIR=\"$(runstatedir)\" |
40 | AM_CPPFLAGS += -DSBINDIR=\"$(sbindir)\" | |
41 | AM_CPPFLAGS += -DSYSCONFDIR=\"$(sysconfdir)\" | |
658fb802 | 42 | AM_CPPFLAGS += -DPKGDATADIR=\"$(pkgdatadir)\" |
fed90353 | 43 | AM_CPPFLAGS += $(DEBUG_CPPFLAGS) |
acf04442 | 44 | AM_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS) |
c8970f52 AZ |
45 | AM_CPPFLAGS += -DTEXT_DOMAIN=\"zfs-@ac_system_l@-user\" |
46 | ||
63652e15 DS |
47 | if ASAN_ENABLED |
48 | AM_CPPFLAGS += -DZFS_ASAN_ENABLED | |
49 | endif | |
50 | ||
51 | if UBSAN_ENABLED | |
52 | AM_CPPFLAGS += -DZFS_UBSAN_ENABLED | |
53 | endif | |
54 | ||
fed90353 BB |
55 | AM_LDFLAGS = $(DEBUG_LDFLAGS) |
56 | AM_LDFLAGS += $(ASAN_LDFLAGS) | |
63652e15 | 57 | AM_LDFLAGS += $(UBSAN_LDFLAGS) |
9f0a21e6 MM |
58 | |
59 | if BUILD_FREEBSD | |
60 | AM_LDFLAGS += -fstack-protector-strong -shared | |
61 | AM_LDFLAGS += -Wl,-x -Wl,--fatal-warnings -Wl,--warn-shared-textrel | |
62 | AM_LDFLAGS += -lm | |
63 | endif | |
c8970f52 AZ |
64 | |
65 | ||
66 | # If a target includes kernel code, generate warnings for large stack frames | |
67 | KERNEL_CFLAGS = $(FRAME_LARGER_THAN) | |
68 | ||
69 | # See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54020 | |
70 | LIBRARY_CFLAGS = -no-suppress | |
71 | ||
72 | # Forcibly enable asserts/debugging for libzpool &al. | |
73 | FORCEDEBUG_CPPFLAGS = -DDEBUG -UNDEBUG -DZFS_DEBUG |