]>
Commit | Line | Data |
---|---|---|
8c392629 JE |
1 | ACLOCAL_AMFLAGS = -I config |
2 | ||
47a4a6fd TF |
3 | include config/rpm.am |
4 | include config/deb.am | |
5 | include config/tgz.am | |
c9c0d073 | 6 | |
f3757573 | 7 | SUBDIRS = include rpm |
c9c0d073 | 8 | if CONFIG_USER |
3c67d83a | 9 | SUBDIRS += udev etc man scripts lib tests cmd contrib |
c9c0d073 BB |
10 | endif |
11 | if CONFIG_KERNEL | |
fd7fd5eb | 12 | SUBDIRS += module |
775f2d34 | 13 | |
93ce2b4c | 14 | extradir = $(prefix)/src/zfs-$(VERSION) |
775f2d34 BB |
15 | extra_HEADERS = zfs.release.in zfs_config.h.in |
16 | ||
93ce2b4c | 17 | kerneldir = $(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION) |
775f2d34 | 18 | nodist_kernel_HEADERS = zfs.release zfs_config.h module/$(LINUX_SYMBOLS) |
c9c0d073 | 19 | endif |
c9c0d073 | 20 | |
8160dd9a | 21 | AUTOMAKE_OPTIONS = foreign |
f3757573 | 22 | EXTRA_DIST = autogen.sh copy-builtin |
c9c0d073 | 23 | EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am |
145c88fb | 24 | EXTRA_DIST += META AUTHORS COPYRIGHT LICENSE NEWS NOTICE README.md |
294fcb54 | 25 | EXTRA_DIST += CODE_OF_CONDUCT.md |
c9c0d073 | 26 | |
53b5fcd3 | 27 | # Include all the extra licensing information for modules |
f66a1f88 RM |
28 | EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE |
29 | EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE.descrip | |
30 | EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman | |
31 | EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman.descrip | |
32 | EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl | |
33 | EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl.descrip | |
34 | EXTRA_DIST += module/spl/THIRDPARTYLICENSE.gplv2 | |
35 | EXTRA_DIST += module/spl/THIRDPARTYLICENSE.gplv2.descrip | |
36 | EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash | |
37 | EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash.descrip | |
53b5fcd3 | 38 | |
acf04442 PS |
39 | @CODE_COVERAGE_RULES@ |
40 | ||
4cbde2ec MA |
41 | .PHONY: gitrev |
42 | gitrev: | |
43 | -${top_srcdir}/scripts/make_gitrev.sh | |
44 | ||
45 | BUILT_SOURCES = gitrev | |
46 | ||
142f84dd RM |
47 | # Double-colon rules are allowed; there are multiple independent definitions. |
48 | distclean-local:: | |
c9c0d073 BB |
49 | -$(RM) -R autom4te*.cache |
50 | -find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \ | |
51 | -o -name .pc -o -name .hg -o -name .git \) -prune -o \ | |
52 | \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ | |
53 | -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ | |
c8f9061f BB |
54 | -o -name '.*.rej' -o -size 0 -o -name '*%' -o -name '.*.cmd' \ |
55 | -o -name 'core' -o -name 'Makefile' -o -name 'Module.symvers' \ | |
d9ec8b9b BB |
56 | -o -name '*.order' -o -name '*.markers' -o -name '*.gcda' \ |
57 | -o -name '*.gcno' \) \ | |
c9c0d073 BB |
58 | -type f -print | xargs $(RM) |
59 | ||
a430cef9 | 60 | all-local: |
8f12a4f8 BB |
61 | -[ -x ${top_builddir}/scripts/zfs-tests.sh ] && \ |
62 | ${top_builddir}/scripts/zfs-tests.sh -c | |
a430cef9 | 63 | |
4cbde2ec MA |
64 | dist-hook: gitrev |
65 | cp ${top_srcdir}/include/zfs_gitrev.h $(distdir)/include; \ | |
f6fb7651 BB |
66 | sed -i 's/Release:[[:print:]]*/Release: $(RELEASE)/' \ |
67 | $(distdir)/META | |
68 | ||
93ce2b4c BB |
69 | # For compatibility, create a matching spl-x.y.z directly which contains |
70 | # symlinks to the updated header and object file locations. These | |
71 | # compatibility links will be removed in the next major release. | |
72 | if CONFIG_KERNEL | |
73 | install-data-hook: | |
d1f06ec5 | 74 | rm -rf $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \ |
93ce2b4c BB |
75 | mkdir $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \ |
76 | cd $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \ | |
77 | ln -s ../zfs-$(VERSION)/include/spl include && \ | |
78 | ln -s ../zfs-$(VERSION)/$(LINUX_VERSION) $(LINUX_VERSION) && \ | |
79 | ln -s ../zfs-$(VERSION)/zfs_config.h.in spl_config.h.in && \ | |
80 | ln -s ../zfs-$(VERSION)/zfs.release.in spl.release.in && \ | |
81 | cd $(DESTDIR)$(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION) && \ | |
d1f06ec5 MA |
82 | ln -fs zfs_config.h spl_config.h && \ |
83 | ln -fs zfs.release spl.release | |
93ce2b4c BB |
84 | endif |
85 | ||
7b02fae7 | 86 | codecheck: cstyle shellcheck flake8 mancheck testscheck vcscheck |
c23f8d48 MA |
87 | |
88 | checkstyle: codecheck commitcheck | |
cb524aa2 GDN |
89 | |
90 | commitcheck: | |
91 | @if git rev-parse --git-dir > /dev/null 2>&1; then \ | |
26cb4b87 | 92 | ${top_srcdir}/scripts/commitcheck.sh; \ |
cb524aa2 | 93 | fi |
c11cd7f9 TF |
94 | |
95 | cstyle: | |
351a26dd | 96 | @find ${top_srcdir} -name '*.[hc]' ! -name 'zfs_config.*' \ |
26cb4b87 | 97 | ! -name '*.mod.c' -type f \ |
98 | -exec ${top_srcdir}/scripts/cstyle.pl -cpP {} \+ | |
a35beedf | 99 | |
c11cd7f9 TF |
100 | shellcheck: |
101 | @if type shellcheck > /dev/null 2>&1; then \ | |
c8f9061f | 102 | shellcheck --exclude=SC1090 --format=gcc \ |
26cb4b87 | 103 | $$(find ${top_srcdir}/scripts/*.sh -type f) \ |
104 | $$(find ${top_srcdir}/cmd/zed/zed.d/*.sh -type f) \ | |
105 | $$(find ${top_srcdir}/cmd/zpool/zpool.d/* -executable); \ | |
58c0f374 MA |
106 | else \ |
107 | echo "skipping shellcheck because shellcheck is not installed"; \ | |
74698631 | 108 | fi |
c11cd7f9 | 109 | |
90cdf283 | 110 | mancheck: |
111 | @if type mandoc > /dev/null 2>&1; then \ | |
a94d38c0 GDN |
112 | find ${top_srcdir}/man/man8 -type f -name 'zfs.8' \ |
113 | -o -name 'zpool.8' -o -name 'zdb.8' \ | |
114 | -o -name 'zgenhostid.8' | \ | |
115 | xargs mandoc -Tlint -Werror; \ | |
58c0f374 MA |
116 | else \ |
117 | echo "skipping mancheck because mandoc is not installed"; \ | |
90cdf283 | 118 | fi |
119 | ||
9ca25e70 | 120 | testscheck: |
fe609530 | 121 | @find ${top_srcdir}/tests/zfs-tests -type f \ |
9ca25e70 | 122 | \( -name '*.ksh' -not -executable \) -o \ |
123 | \( -name '*.kshlib' -executable \) -o \ | |
fe609530 | 124 | \( -name '*.shlib' -executable \) -o \ |
9ca25e70 | 125 | \( -name '*.cfg' -executable \) | \ |
126 | xargs -r stat -c '%A %n' | \ | |
127 | awk '{c++; print} END {if(c>0) exit 1}' | |
128 | ||
7b02fae7 | 129 | vcscheck: |
130 | @if git rev-parse --git-dir > /dev/null 2>&1; then \ | |
131 | git ls-files . --exclude-standard --others | \ | |
132 | awk '{c++; print} END {if(c>0) exit 1}' ; \ | |
133 | fi | |
134 | ||
f26eb428 | 135 | lint: cppcheck paxcheck |
b64e02e5 BB |
136 | |
137 | cppcheck: | |
138 | @if type cppcheck > /dev/null 2>&1; then \ | |
94183a9d | 139 | cppcheck --quiet --force --error-exitcode=2 --inline-suppr \ |
34d00e7a | 140 | --suppressions-list=.github/suppressions.txt \ |
94183a9d | 141 | -UHAVE_SSE2 -UHAVE_AVX512F -UHAVE_UIO_ZEROCOPY \ |
5fbf85c4 | 142 | ${top_srcdir}; \ |
58c0f374 MA |
143 | else \ |
144 | echo "skipping cppcheck because cppcheck is not installed"; \ | |
b64e02e5 BB |
145 | fi |
146 | ||
f26eb428 JZ |
147 | paxcheck: |
148 | @if type scanelf > /dev/null 2>&1; then \ | |
26cb4b87 | 149 | ${top_srcdir}/scripts/paxcheck.sh ${top_srcdir}; \ |
58c0f374 MA |
150 | else \ |
151 | echo "skipping paxcheck because scanelf is not installed"; \ | |
f26eb428 JZ |
152 | fi |
153 | ||
46bb91e1 GDN |
154 | flake8: |
155 | @if type flake8 > /dev/null 2>&1; then \ | |
156 | flake8 ${top_srcdir}; \ | |
58c0f374 MA |
157 | else \ |
158 | echo "skipping flake8 because flake8 is not installed"; \ | |
46bb91e1 GDN |
159 | fi |
160 | ||
c9c0d073 | 161 | ctags: |
47a4a6fd | 162 | $(RM) tags |
c9c0d073 BB |
163 | find $(top_srcdir) -name .git -prune -o -name '*.[hc]' | xargs ctags |
164 | ||
165 | etags: | |
47a4a6fd | 166 | $(RM) TAGS |
c9c0d073 BB |
167 | find $(top_srcdir) -name .pc -prune -o -name '*.[hc]' | xargs etags -a |
168 | ||
169 | tags: ctags etags | |
170 | ||
171 | pkg: @DEFAULT_PACKAGE@ | |
7670f721 | 172 | pkg-dkms: @DEFAULT_PACKAGE@-dkms |
f3757573 | 173 | pkg-kmod: @DEFAULT_PACKAGE@-kmod |
c9c0d073 | 174 | pkg-utils: @DEFAULT_PACKAGE@-utils |