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