]> git.proxmox.com Git - mirror_zfs.git/blob - Makefile.am
Perform KABI checks in parallel
[mirror_zfs.git] / Makefile.am
1 ACLOCAL_AMFLAGS = -I config
2
3 include config/rpm.am
4 include config/deb.am
5 include config/tgz.am
6
7 SUBDIRS = include
8 if BUILD_LINUX
9 SUBDIRS += rpm
10 endif
11
12 if CONFIG_USER
13 SUBDIRS += etc man scripts lib tests cmd contrib
14 if BUILD_LINUX
15 SUBDIRS += udev
16 endif
17 endif
18 if CONFIG_KERNEL
19 SUBDIRS += module
20
21 extradir = $(prefix)/src/zfs-$(VERSION)
22 extra_HEADERS = zfs.release.in zfs_config.h.in
23
24 if BUILD_LINUX
25 kerneldir = $(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION)
26 nodist_kernel_HEADERS = zfs.release zfs_config.h module/$(LINUX_SYMBOLS)
27 endif
28 endif
29
30 AUTOMAKE_OPTIONS = foreign
31 EXTRA_DIST = autogen.sh copy-builtin
32 EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am
33 EXTRA_DIST += META AUTHORS COPYRIGHT LICENSE NEWS NOTICE README.md
34 EXTRA_DIST += CODE_OF_CONDUCT.md
35
36 # Include all the extra licensing information for modules
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
43 EXTRA_DIST += module/os/linux/spl/THIRDPARTYLICENSE.gplv2
44 EXTRA_DIST += module/os/linux/spl/THIRDPARTYLICENSE.gplv2.descrip
45 EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash
46 EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash.descrip
47
48 @CODE_COVERAGE_RULES@
49
50 .PHONY: gitrev
51 gitrev:
52 -${top_srcdir}/scripts/make_gitrev.sh
53
54 BUILT_SOURCES = gitrev
55
56 # Double-colon rules are allowed; there are multiple independent definitions.
57 distclean-local::
58 -$(RM) -R autom4te*.cache build
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' \
63 -o -name '.*.rej' -o -size 0 -o -name '*%' -o -name '.*.cmd' \
64 -o -name 'core' -o -name 'Makefile' -o -name 'Module.symvers' \
65 -o -name '*.order' -o -name '*.markers' -o -name '*.gcda' \
66 -o -name '*.gcno' \) \
67 -type f -print | xargs $(RM)
68
69 all-local:
70 -[ -x ${top_builddir}/scripts/zfs-tests.sh ] && \
71 ${top_builddir}/scripts/zfs-tests.sh -c
72
73 dist-hook: gitrev
74 cp ${top_srcdir}/include/zfs_gitrev.h $(distdir)/include; \
75 sed ${ac_inplace} -e 's/Release:[[:print:]]*/Release: $(RELEASE)/' \
76 $(distdir)/META
77
78 if BUILD_LINUX
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:
84 rm -rf $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
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) && \
92 ln -fs zfs_config.h spl_config.h && \
93 ln -fs zfs.release spl.release
94 endif
95 endif
96
97 codecheck: cstyle shellcheck flake8 mancheck testscheck vcscheck
98
99 checkstyle: codecheck commitcheck
100
101 commitcheck:
102 @if git rev-parse --git-dir > /dev/null 2>&1; then \
103 ${top_srcdir}/scripts/commitcheck.sh; \
104 fi
105
106 cstyle:
107 @find ${top_srcdir} -name build -prune -o -name '*.[hc]' \
108 ! -name 'zfs_config.*' ! -name '*.mod.c' -type f \
109 -exec ${top_srcdir}/scripts/cstyle.pl -cpP {} \+
110
111 filter_executable = -exec test -x '{}' \; -print
112
113 shellcheck:
114 @if type shellcheck > /dev/null 2>&1; then \
115 shellcheck --exclude=SC1090 --exclude=SC1117 --format=gcc \
116 $$(find ${top_srcdir}/scripts/*.sh -type f) \
117 $$(find ${top_srcdir}/cmd/zed/zed.d/*.sh -type f) \
118 $$(find ${top_srcdir}/cmd/zpool/zpool.d/* \
119 -type f ${filter_executable}); \
120 else \
121 echo "skipping shellcheck because shellcheck is not installed"; \
122 fi
123
124 mancheck:
125 @if type mandoc > /dev/null 2>&1; then \
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; \
130 else \
131 echo "skipping mancheck because mandoc is not installed"; \
132 fi
133
134 if BUILD_LINUX
135 stat_fmt = -c '%A %n'
136 else
137 stat_fmt = -f '%Sp %N'
138 endif
139
140 testscheck:
141 @find ${top_srcdir}/tests/zfs-tests -type f \
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} | \
147 awk '{c++; print} END {if(c>0) exit 1}'
148
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
155 lint: cppcheck paxcheck
156
157 cppcheck:
158 @if type cppcheck > /dev/null 2>&1; then \
159 cppcheck --quiet --force --error-exitcode=2 --inline-suppr \
160 --suppressions-list=.github/suppressions.txt \
161 -UHAVE_SSE2 -UHAVE_AVX512F -UHAVE_UIO_ZEROCOPY \
162 ${top_srcdir}; \
163 else \
164 echo "skipping cppcheck because cppcheck is not installed"; \
165 fi
166
167 paxcheck:
168 @if type scanelf > /dev/null 2>&1; then \
169 ${top_srcdir}/scripts/paxcheck.sh ${top_srcdir}; \
170 else \
171 echo "skipping paxcheck because scanelf is not installed"; \
172 fi
173
174 flake8:
175 @if type flake8 > /dev/null 2>&1; then \
176 flake8 ${top_srcdir}; \
177 else \
178 echo "skipping flake8 because flake8 is not installed"; \
179 fi
180
181 ctags:
182 $(RM) tags
183 find $(top_srcdir) -name .git -prune -o -name '*.[hc]' | xargs ctags
184
185 etags:
186 $(RM) TAGS
187 find $(top_srcdir) -name .pc -prune -o -name '*.[hc]' | xargs etags -a
188
189 tags: ctags etags
190
191 pkg: @DEFAULT_PACKAGE@
192 pkg-dkms: @DEFAULT_PACKAGE@-dkms
193 pkg-kmod: @DEFAULT_PACKAGE@-kmod
194 pkg-utils: @DEFAULT_PACKAGE@-utils