]> git.proxmox.com Git - mirror_zfs.git/blame - Makefile.am
ZTS: Fix non-portable date format
[mirror_zfs.git] / Makefile.am
CommitLineData
8c392629
JE
1ACLOCAL_AMFLAGS = -I config
2
47a4a6fd
TF
3include config/rpm.am
4include config/deb.am
5include config/tgz.am
c9c0d073 6
bced7e3a
MM
7SUBDIRS = include
8if BUILD_LINUX
9SUBDIRS += rpm
10endif
11
c9c0d073 12if CONFIG_USER
bced7e3a
MM
13SUBDIRS += etc man scripts lib tests cmd contrib
14if BUILD_LINUX
15SUBDIRS += udev
16endif
c9c0d073
BB
17endif
18if CONFIG_KERNEL
fd7fd5eb 19SUBDIRS += module
775f2d34 20
93ce2b4c 21extradir = $(prefix)/src/zfs-$(VERSION)
775f2d34
BB
22extra_HEADERS = zfs.release.in zfs_config.h.in
23
bced7e3a 24if BUILD_LINUX
93ce2b4c 25kerneldir = $(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION)
775f2d34 26nodist_kernel_HEADERS = zfs.release zfs_config.h module/$(LINUX_SYMBOLS)
c9c0d073 27endif
bced7e3a 28endif
c9c0d073 29
8160dd9a 30AUTOMAKE_OPTIONS = foreign
f3757573 31EXTRA_DIST = autogen.sh copy-builtin
c9c0d073 32EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am
145c88fb 33EXTRA_DIST += META AUTHORS COPYRIGHT LICENSE NEWS NOTICE README.md
294fcb54 34EXTRA_DIST += CODE_OF_CONDUCT.md
c9c0d073 35
53b5fcd3 36# Include all the extra licensing information for modules
f66a1f88
RM
37EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE
38EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE.descrip
39EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman
40EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman.descrip
41EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl
42EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl.descrip
bced7e3a
MM
43EXTRA_DIST += module/os/linux/spl/THIRDPARTYLICENSE.gplv2
44EXTRA_DIST += module/os/linux/spl/THIRDPARTYLICENSE.gplv2.descrip
f66a1f88
RM
45EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash
46EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash.descrip
53b5fcd3 47
acf04442
PS
48@CODE_COVERAGE_RULES@
49
4cbde2ec
MA
50.PHONY: gitrev
51gitrev:
52 -${top_srcdir}/scripts/make_gitrev.sh
53
54BUILT_SOURCES = gitrev
55
142f84dd
RM
56# Double-colon rules are allowed; there are multiple independent definitions.
57distclean-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 69all-local:
8f12a4f8
BB
70 -[ -x ${top_builddir}/scripts/zfs-tests.sh ] && \
71 ${top_builddir}/scripts/zfs-tests.sh -c
a430cef9 72
4cbde2ec
MA
73dist-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 78if 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.
82if CONFIG_KERNEL
83install-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 94endif
bced7e3a 95endif
93ce2b4c 96
7b02fae7 97codecheck: cstyle shellcheck flake8 mancheck testscheck vcscheck
c23f8d48
MA
98
99checkstyle: codecheck commitcheck
cb524aa2
GDN
100
101commitcheck:
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
106cstyle:
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
111filter_executable = -exec test -x '{}' \; -print
112
c11cd7f9
TF
113shellcheck:
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 124mancheck:
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
134if BUILD_LINUX
135stat_fmt = -c '%A %n'
136else
137stat_fmt = -f '%Sp %N'
138endif
139
9ca25e70 140testscheck:
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 149vcscheck:
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 155lint: cppcheck paxcheck
b64e02e5
BB
156
157cppcheck:
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
167paxcheck:
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
174flake8:
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 181ctags:
47a4a6fd 182 $(RM) tags
c9c0d073
BB
183 find $(top_srcdir) -name .git -prune -o -name '*.[hc]' | xargs ctags
184
185etags:
47a4a6fd 186 $(RM) TAGS
c9c0d073
BB
187 find $(top_srcdir) -name .pc -prune -o -name '*.[hc]' | xargs etags -a
188
189tags: ctags etags
190
191pkg: @DEFAULT_PACKAGE@
7670f721 192pkg-dkms: @DEFAULT_PACKAGE@-dkms
f3757573 193pkg-kmod: @DEFAULT_PACKAGE@-kmod
c9c0d073 194pkg-utils: @DEFAULT_PACKAGE@-utils