]> git.proxmox.com Git - mirror_zfs.git/blame - Makefile.am
Fix zlib leak on FreeBSD
[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:
9f0a21e6
MM
107 @find ${top_srcdir} -name build -prune -o -type f -name '*.[hc]' \
108 ! -name 'zfs_config.*' ! -name '*.mod.c' \
109 ! -name 'opt_global.h' ! -name '*_if*.h' \
26cb4b87 110 -exec ${top_srcdir}/scripts/cstyle.pl -cpP {} \+
a35beedf 111
bced7e3a
MM
112filter_executable = -exec test -x '{}' \; -print
113
c11cd7f9
TF
114shellcheck:
115 @if type shellcheck > /dev/null 2>&1; then \
bced7e3a 116 shellcheck --exclude=SC1090 --exclude=SC1117 --format=gcc \
26cb4b87 117 $$(find ${top_srcdir}/scripts/*.sh -type f) \
118 $$(find ${top_srcdir}/cmd/zed/zed.d/*.sh -type f) \
bced7e3a
MM
119 $$(find ${top_srcdir}/cmd/zpool/zpool.d/* \
120 -type f ${filter_executable}); \
58c0f374
MA
121 else \
122 echo "skipping shellcheck because shellcheck is not installed"; \
74698631 123 fi
c11cd7f9 124
90cdf283 125mancheck:
126 @if type mandoc > /dev/null 2>&1; then \
a94d38c0
GDN
127 find ${top_srcdir}/man/man8 -type f -name 'zfs.8' \
128 -o -name 'zpool.8' -o -name 'zdb.8' \
129 -o -name 'zgenhostid.8' | \
130 xargs mandoc -Tlint -Werror; \
58c0f374
MA
131 else \
132 echo "skipping mancheck because mandoc is not installed"; \
90cdf283 133 fi
134
bced7e3a
MM
135if BUILD_LINUX
136stat_fmt = -c '%A %n'
137else
138stat_fmt = -f '%Sp %N'
139endif
140
9ca25e70 141testscheck:
fe609530 142 @find ${top_srcdir}/tests/zfs-tests -type f \
bced7e3a
MM
143 \( -name '*.ksh' -not ${filter_executable} \) -o \
144 \( -name '*.kshlib' ${filter_executable} \) -o \
145 \( -name '*.shlib' ${filter_executable} \) -o \
146 \( -name '*.cfg' ${filter_executable} \) | \
147 xargs -r stat ${stat_fmt} | \
9ca25e70 148 awk '{c++; print} END {if(c>0) exit 1}'
149
7b02fae7 150vcscheck:
151 @if git rev-parse --git-dir > /dev/null 2>&1; then \
152 git ls-files . --exclude-standard --others | \
153 awk '{c++; print} END {if(c>0) exit 1}' ; \
154 fi
155
f26eb428 156lint: cppcheck paxcheck
b64e02e5
BB
157
158cppcheck:
159 @if type cppcheck > /dev/null 2>&1; then \
94183a9d 160 cppcheck --quiet --force --error-exitcode=2 --inline-suppr \
34d00e7a 161 --suppressions-list=.github/suppressions.txt \
94183a9d 162 -UHAVE_SSE2 -UHAVE_AVX512F -UHAVE_UIO_ZEROCOPY \
5fbf85c4 163 ${top_srcdir}; \
58c0f374
MA
164 else \
165 echo "skipping cppcheck because cppcheck is not installed"; \
b64e02e5
BB
166 fi
167
f26eb428
JZ
168paxcheck:
169 @if type scanelf > /dev/null 2>&1; then \
26cb4b87 170 ${top_srcdir}/scripts/paxcheck.sh ${top_srcdir}; \
58c0f374
MA
171 else \
172 echo "skipping paxcheck because scanelf is not installed"; \
f26eb428
JZ
173 fi
174
46bb91e1
GDN
175flake8:
176 @if type flake8 > /dev/null 2>&1; then \
177 flake8 ${top_srcdir}; \
58c0f374
MA
178 else \
179 echo "skipping flake8 because flake8 is not installed"; \
46bb91e1
GDN
180 fi
181
c9c0d073 182ctags:
47a4a6fd 183 $(RM) tags
c9c0d073
BB
184 find $(top_srcdir) -name .git -prune -o -name '*.[hc]' | xargs ctags
185
186etags:
47a4a6fd 187 $(RM) TAGS
c9c0d073
BB
188 find $(top_srcdir) -name .pc -prune -o -name '*.[hc]' | xargs etags -a
189
190tags: ctags etags
191
192pkg: @DEFAULT_PACKAGE@
7670f721 193pkg-dkms: @DEFAULT_PACKAGE@-dkms
f3757573 194pkg-kmod: @DEFAULT_PACKAGE@-kmod
c9c0d073 195pkg-utils: @DEFAULT_PACKAGE@-utils