]>
Commit | Line | Data |
---|---|---|
c3ef9f75 AZ |
1 | include $(top_srcdir)/config/Shellcheck.am |
2 | ||
8c392629 JE |
3 | ACLOCAL_AMFLAGS = -I config |
4 | ||
bced7e3a MM |
5 | SUBDIRS = include |
6 | if BUILD_LINUX | |
7 | SUBDIRS += rpm | |
8 | endif | |
9 | ||
c9c0d073 | 10 | if CONFIG_USER |
5a1fb060 | 11 | SUBDIRS += man scripts lib tests cmd etc contrib |
bced7e3a MM |
12 | if BUILD_LINUX |
13 | SUBDIRS += udev | |
14 | endif | |
c9c0d073 BB |
15 | endif |
16 | if CONFIG_KERNEL | |
fd7fd5eb | 17 | SUBDIRS += module |
775f2d34 | 18 | |
93ce2b4c | 19 | extradir = $(prefix)/src/zfs-$(VERSION) |
775f2d34 BB |
20 | extra_HEADERS = zfs.release.in zfs_config.h.in |
21 | ||
bced7e3a | 22 | if BUILD_LINUX |
93ce2b4c | 23 | kerneldir = $(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION) |
775f2d34 | 24 | nodist_kernel_HEADERS = zfs.release zfs_config.h module/$(LINUX_SYMBOLS) |
c9c0d073 | 25 | endif |
bced7e3a | 26 | endif |
c9c0d073 | 27 | |
8160dd9a | 28 | AUTOMAKE_OPTIONS = foreign |
f3757573 | 29 | EXTRA_DIST = autogen.sh copy-builtin |
c9c0d073 | 30 | EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am |
c0af3c7b BB |
31 | EXTRA_DIST += AUTHORS CODE_OF_CONDUCT.md COPYRIGHT LICENSE META NEWS NOTICE |
32 | EXTRA_DIST += README.md RELEASES.md | |
6b99fc06 | 33 | EXTRA_DIST += module/lua/README.zfs module/os/linux/spl/README.md |
c9c0d073 | 34 | |
53b5fcd3 | 35 | # Include all the extra licensing information for modules |
f66a1f88 RM |
36 | EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE |
37 | EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE.descrip | |
38 | EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman | |
39 | EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman.descrip | |
40 | EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl | |
41 | EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl.descrip | |
9642beef AS |
42 | EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams |
43 | EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams.descrip | |
44 | EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl | |
45 | EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl.descrip | |
bced7e3a MM |
46 | EXTRA_DIST += module/os/linux/spl/THIRDPARTYLICENSE.gplv2 |
47 | EXTRA_DIST += module/os/linux/spl/THIRDPARTYLICENSE.gplv2.descrip | |
f66a1f88 RM |
48 | EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash |
49 | EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash.descrip | |
53b5fcd3 | 50 | |
acf04442 PS |
51 | @CODE_COVERAGE_RULES@ |
52 | ||
109d2c93 AS |
53 | GITREV = include/zfs_gitrev.h |
54 | ||
94a2dca6 | 55 | PHONY = gitrev |
4cbde2ec | 56 | gitrev: |
d32a59fe | 57 | $(AM_V_GEN)$(top_srcdir)/scripts/make_gitrev.sh $(GITREV) |
109d2c93 | 58 | |
e6c093dd | 59 | all: gitrev |
4cbde2ec | 60 | |
142f84dd | 61 | # Double-colon rules are allowed; there are multiple independent definitions. |
59415fc9 AS |
62 | maintainer-clean-local:: |
63 | -$(RM) $(GITREV) | |
64 | ||
142f84dd | 65 | distclean-local:: |
608f8749 | 66 | -$(RM) -R autom4te*.cache build |
c9c0d073 BB |
67 | -find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \ |
68 | -o -name .pc -o -name .hg -o -name .git \) -prune -o \ | |
69 | \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ | |
70 | -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ | |
c8f9061f BB |
71 | -o -name '.*.rej' -o -size 0 -o -name '*%' -o -name '.*.cmd' \ |
72 | -o -name 'core' -o -name 'Makefile' -o -name 'Module.symvers' \ | |
d9ec8b9b BB |
73 | -o -name '*.order' -o -name '*.markers' -o -name '*.gcda' \ |
74 | -o -name '*.gcno' \) \ | |
c9c0d073 BB |
75 | -type f -print | xargs $(RM) |
76 | ||
a430cef9 | 77 | all-local: |
8f12a4f8 BB |
78 | -[ -x ${top_builddir}/scripts/zfs-tests.sh ] && \ |
79 | ${top_builddir}/scripts/zfs-tests.sh -c | |
a430cef9 | 80 | |
109d2c93 | 81 | dist-hook: |
59415fc9 | 82 | $(AM_V_GEN)$(top_srcdir)/scripts/make_gitrev.sh -D $(distdir) $(GITREV) |
5ca349f9 | 83 | $(SED) ${ac_inplace} -e 's/Release:[[:print:]]*/Release: $(RELEASE)/' \ |
f6fb7651 BB |
84 | $(distdir)/META |
85 | ||
bced7e3a | 86 | if BUILD_LINUX |
93ce2b4c BB |
87 | # For compatibility, create a matching spl-x.y.z directly which contains |
88 | # symlinks to the updated header and object file locations. These | |
89 | # compatibility links will be removed in the next major release. | |
90 | if CONFIG_KERNEL | |
91 | install-data-hook: | |
d1f06ec5 | 92 | rm -rf $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \ |
93ce2b4c BB |
93 | mkdir $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \ |
94 | cd $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \ | |
95 | ln -s ../zfs-$(VERSION)/include/spl include && \ | |
96 | ln -s ../zfs-$(VERSION)/$(LINUX_VERSION) $(LINUX_VERSION) && \ | |
97 | ln -s ../zfs-$(VERSION)/zfs_config.h.in spl_config.h.in && \ | |
98 | ln -s ../zfs-$(VERSION)/zfs.release.in spl.release.in && \ | |
99 | cd $(DESTDIR)$(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION) && \ | |
d1f06ec5 MA |
100 | ln -fs zfs_config.h spl_config.h && \ |
101 | ln -fs zfs.release spl.release | |
93ce2b4c | 102 | endif |
bced7e3a | 103 | endif |
93ce2b4c | 104 | |
94a2dca6 | 105 | PHONY += codecheck |
d2bce6d0 | 106 | codecheck: cstyle shellcheck checkbashisms flake8 mancheck testscheck vcscheck |
c23f8d48 | 107 | |
94a2dca6 | 108 | PHONY += checkstyle |
c23f8d48 | 109 | checkstyle: codecheck commitcheck |
cb524aa2 | 110 | |
94a2dca6 | 111 | PHONY += commitcheck |
cb524aa2 GDN |
112 | commitcheck: |
113 | @if git rev-parse --git-dir > /dev/null 2>&1; then \ | |
26cb4b87 | 114 | ${top_srcdir}/scripts/commitcheck.sh; \ |
cb524aa2 | 115 | fi |
c11cd7f9 | 116 | |
94a2dca6 | 117 | PHONY += cstyle |
c11cd7f9 | 118 | cstyle: |
dc544aba MN |
119 | @find ${top_srcdir} -name build -prune \ |
120 | -o -type f -name '*.[hc]' \ | |
9f0a21e6 MM |
121 | ! -name 'zfs_config.*' ! -name '*.mod.c' \ |
122 | ! -name 'opt_global.h' ! -name '*_if*.h' \ | |
dc544aba | 123 | ! -path './module/zstd/lib/*' \ |
26cb4b87 | 124 | -exec ${top_srcdir}/scripts/cstyle.pl -cpP {} \+ |
a35beedf | 125 | |
bced7e3a MM |
126 | filter_executable = -exec test -x '{}' \; -print |
127 | ||
c3ef9f75 AZ |
128 | SHELLCHECKDIRS = cmd contrib etc scripts tests |
129 | SHELLCHECKSCRIPTS = autogen.sh | |
c11cd7f9 | 130 | |
14c34c3d AR |
131 | PHONY += checkabi storeabi |
132 | checkabi: lib | |
133 | $(MAKE) -C lib checkabi | |
134 | ||
135 | storeabi: lib | |
136 | $(MAKE) -C lib storeabi | |
137 | ||
94a2dca6 | 138 | PHONY += mancheck |
90cdf283 | 139 | mancheck: |
4a98300f | 140 | ${top_srcdir}/scripts/mancheck.sh ${top_srcdir}/man ${top_srcdir}/tests/test-runner/man |
90cdf283 | 141 | |
bced7e3a MM |
142 | if BUILD_LINUX |
143 | stat_fmt = -c '%A %n' | |
144 | else | |
145 | stat_fmt = -f '%Sp %N' | |
146 | endif | |
147 | ||
94a2dca6 | 148 | PHONY += testscheck |
9ca25e70 | 149 | testscheck: |
fe609530 | 150 | @find ${top_srcdir}/tests/zfs-tests -type f \ |
bced7e3a MM |
151 | \( -name '*.ksh' -not ${filter_executable} \) -o \ |
152 | \( -name '*.kshlib' ${filter_executable} \) -o \ | |
153 | \( -name '*.shlib' ${filter_executable} \) -o \ | |
154 | \( -name '*.cfg' ${filter_executable} \) | \ | |
155 | xargs -r stat ${stat_fmt} | \ | |
9ca25e70 | 156 | awk '{c++; print} END {if(c>0) exit 1}' |
157 | ||
94a2dca6 | 158 | PHONY += vcscheck |
7b02fae7 | 159 | vcscheck: |
160 | @if git rev-parse --git-dir > /dev/null 2>&1; then \ | |
161 | git ls-files . --exclude-standard --others | \ | |
162 | awk '{c++; print} END {if(c>0) exit 1}' ; \ | |
163 | fi | |
164 | ||
94a2dca6 | 165 | PHONY += lint |
f26eb428 | 166 | lint: cppcheck paxcheck |
b64e02e5 | 167 | |
0e6c493f | 168 | CPPCHECKDIRS = cmd lib module |
94a2dca6 | 169 | PHONY += cppcheck |
0e6c493f BB |
170 | cppcheck: $(CPPCHECKDIRS) |
171 | @if test -n "$(CPPCHECK)"; then \ | |
172 | set -e ; for dir in $(CPPCHECKDIRS) ; do \ | |
173 | $(MAKE) -C $$dir cppcheck ; \ | |
174 | done \ | |
58c0f374 MA |
175 | else \ |
176 | echo "skipping cppcheck because cppcheck is not installed"; \ | |
b64e02e5 BB |
177 | fi |
178 | ||
94a2dca6 | 179 | PHONY += paxcheck |
f26eb428 JZ |
180 | paxcheck: |
181 | @if type scanelf > /dev/null 2>&1; then \ | |
2b5f3045 | 182 | ${top_srcdir}/scripts/paxcheck.sh ${top_builddir}; \ |
58c0f374 MA |
183 | else \ |
184 | echo "skipping paxcheck because scanelf is not installed"; \ | |
f26eb428 JZ |
185 | fi |
186 | ||
94a2dca6 | 187 | PHONY += flake8 |
46bb91e1 GDN |
188 | flake8: |
189 | @if type flake8 > /dev/null 2>&1; then \ | |
190 | flake8 ${top_srcdir}; \ | |
58c0f374 MA |
191 | else \ |
192 | echo "skipping flake8 because flake8 is not installed"; \ | |
46bb91e1 GDN |
193 | fi |
194 | ||
94a2dca6 | 195 | PHONY += ctags |
c9c0d073 | 196 | ctags: |
47a4a6fd | 197 | $(RM) tags |
0b032548 AS |
198 | find $(top_srcdir) -name '.?*' -prune \ |
199 | -o -type f -name '*.[hcS]' -print | xargs ctags -a | |
c9c0d073 | 200 | |
94a2dca6 | 201 | PHONY += etags |
c9c0d073 | 202 | etags: |
47a4a6fd | 203 | $(RM) TAGS |
0b032548 AS |
204 | find $(top_srcdir) -name '.?*' -prune \ |
205 | -o -type f -name '*.[hcS]' -print | xargs etags -a | |
206 | ||
94a2dca6 | 207 | PHONY += cscopelist |
0b032548 AS |
208 | cscopelist: |
209 | find $(top_srcdir) -name '.?*' -prune \ | |
210 | -o -type f -name '*.[hc]' -print >cscope.files | |
c9c0d073 | 211 | |
94a2dca6 | 212 | PHONY += tags |
c9c0d073 BB |
213 | tags: ctags etags |
214 | ||
94a2dca6 | 215 | PHONY += pkg pkg-dkms pkg-kmod pkg-utils |
c9c0d073 | 216 | pkg: @DEFAULT_PACKAGE@ |
7670f721 | 217 | pkg-dkms: @DEFAULT_PACKAGE@-dkms |
f3757573 | 218 | pkg-kmod: @DEFAULT_PACKAGE@-kmod |
c9c0d073 | 219 | pkg-utils: @DEFAULT_PACKAGE@-utils |
94a2dca6 | 220 | |
e6c093dd AS |
221 | include config/rpm.am |
222 | include config/deb.am | |
223 | include config/tgz.am | |
224 | ||
94a2dca6 | 225 | .PHONY: $(PHONY) |