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