]> git.proxmox.com Git - mirror_zfs.git/blob - Makefile.am
autoconf: use include directives instead of recursing down etc
[mirror_zfs.git] / Makefile.am
1 CLEANFILES =
2 EXTRA_DIST =
3 INSTALL_DATA_HOOKS =
4 ALL_LOCAL =
5 CHECKS = shellcheck checkbashisms
6
7 include $(top_srcdir)/config/Rules.am
8 include $(top_srcdir)/config/CppCheck.am
9 include $(top_srcdir)/config/Shellcheck.am
10 include $(top_srcdir)/config/Substfiles.am
11
12 ACLOCAL_AMFLAGS = -I config
13
14 SUBDIRS = include
15 if BUILD_LINUX
16 include $(srcdir)/%D%/rpm/Makefile.am
17 endif
18
19 if CONFIG_USER
20 SUBDIRS += . tests
21 include $(srcdir)/%D%/cmd/Makefile.am
22 include $(srcdir)/%D%/contrib/Makefile.am
23 include $(srcdir)/%D%/etc/Makefile.am
24 include $(srcdir)/%D%/lib/Makefile.am
25 include $(srcdir)/%D%/man/Makefile.am
26 include $(srcdir)/%D%/scripts/Makefile.am
27 if BUILD_LINUX
28 include $(srcdir)/%D%/udev/Makefile.am
29 endif
30 endif
31 CPPCHECKDIRS += module
32 if CONFIG_KERNEL
33 SUBDIRS += module
34
35 extradir = $(prefix)/src/zfs-$(VERSION)
36 extra_HEADERS = zfs.release.in zfs_config.h.in
37 endif
38
39 EXTRA_DIST += autogen.sh copy-builtin
40 EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am
41 EXTRA_DIST += AUTHORS CODE_OF_CONDUCT.md COPYRIGHT LICENSE META NEWS NOTICE
42 EXTRA_DIST += README.md RELEASES.md
43 EXTRA_DIST += module/lua/README.zfs module/os/linux/spl/README.md
44
45 # Include all the extra licensing information for modules
46 EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE
47 EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE.descrip
48 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman
49 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman.descrip
50 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl
51 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl.descrip
52 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams
53 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams.descrip
54 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl
55 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl.descrip
56 EXTRA_DIST += module/os/linux/spl/THIRDPARTYLICENSE.gplv2
57 EXTRA_DIST += module/os/linux/spl/THIRDPARTYLICENSE.gplv2.descrip
58 EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash
59 EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash.descrip
60
61 @CODE_COVERAGE_RULES@
62
63 GITREV = include/zfs_gitrev.h
64 CLEANFILES += $(GITREV)
65 PHONY += gitrev
66 gitrev:
67 $(AM_V_GEN)$(top_srcdir)/scripts/make_gitrev.sh $(GITREV)
68
69 all: gitrev
70
71 PHONY += install-data-hook $(INSTALL_DATA_HOOKS)
72 install-data-hook: $(INSTALL_DATA_HOOKS)
73
74 PHONY += maintainer-clean-local
75 maintainer-clean-local:
76 -$(RM) $(GITREV)
77
78 PHONY += distclean-local
79 distclean-local:
80 -$(RM) -R autom4te*.cache build
81 -find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
82 -o -name .pc -o -name .hg -o -name .git \) -prune -o \
83 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
84 -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
85 -o -name '.*.rej' -o -size 0 -o -name '*%' -o -name '.*.cmd' \
86 -o -name 'core' -o -name 'Makefile' -o -name 'Module.symvers' \
87 -o -name '*.order' -o -name '*.markers' -o -name '*.gcda' \
88 -o -name '*.gcno' \) \
89 -type f -delete
90
91 PHONY += $(ALL_LOCAL)
92 all-local: $(ALL_LOCAL)
93
94 dist-hook:
95 $(top_srcdir)/scripts/make_gitrev.sh -D $(distdir) $(GITREV)
96 $(SED) $(ac_inplace) 's/\(Release:[[:space:]]*\).*/\1$(RELEASE)/' $(distdir)/META
97
98 PHONY += codecheck $(CHECKS)
99 codecheck: $(CHECKS)
100
101 SHELLCHECKDIRS = tests
102 SHELLCHECKSCRIPTS += autogen.sh
103
104 PHONY += checkstyle
105 checkstyle: codecheck commitcheck
106
107 PHONY += commitcheck
108 commitcheck:
109 @if git rev-parse --git-dir > /dev/null 2>&1; then \
110 ${top_srcdir}/scripts/commitcheck.sh; \
111 fi
112
113 if HAVE_PARALLEL
114 cstyle_line = -print0 | parallel -X0 ${top_srcdir}/scripts/cstyle.pl -cpP {}
115 else
116 cstyle_line = -exec ${top_srcdir}/scripts/cstyle.pl -cpP {} +
117 endif
118 CHECKS += cstyle
119 cstyle:
120 @find ${top_srcdir} -name build -prune \
121 -o -type f -name '*.[hc]' \
122 ! -name 'zfs_config.*' ! -name '*.mod.c' \
123 ! -name 'opt_global.h' ! -name '*_if*.h' \
124 ! -name 'zstd_compat_wrapper.h' \
125 ! -path './module/zstd/lib/*' \
126 ! -path './include/sys/lua/*' \
127 ! -path './module/lua/l*.[ch]' \
128 ! -path './module/zfs/lz4.c' \
129 $(cstyle_line)
130
131 filter_executable = -exec test -x '{}' \; -print
132 CHECKS += testscheck
133 testscheck:
134 @[ $$(find $(top_srcdir)/tests/zfs-tests -type f \
135 \( -name '*.ksh' -not $(filter_executable) \) -o \
136 \( -name '*.kshlib' $(filter_executable) \) -o \
137 \( -name '*.shlib' $(filter_executable) \) -o \
138 \( -name '*.cfg' $(filter_executable) \) | \
139 tee /dev/stderr | wc -l) -eq 0 ]
140
141 CHECKS += vcscheck
142 vcscheck:
143 @if git rev-parse --git-dir > /dev/null 2>&1; then \
144 git ls-files . --exclude-standard --others | \
145 awk '{c++; print} END {if(c>0) exit 1}' ; \
146 fi
147
148 CHECKS += zstdcheck
149 zstdcheck:
150 @$(MAKE) -C module check-zstd-symbols
151
152 PHONY += lint
153 lint: cppcheck paxcheck
154
155 PHONY += paxcheck
156 paxcheck:
157 @if type scanelf > /dev/null 2>&1; then \
158 ${top_srcdir}/scripts/paxcheck.sh ${top_builddir}; \
159 else \
160 echo "skipping paxcheck because scanelf is not installed"; \
161 fi
162
163 CHECKS += flake8
164 flake8:
165 @if type flake8 > /dev/null 2>&1; then \
166 flake8 ${top_srcdir}; \
167 else \
168 echo "skipping flake8 because flake8 is not installed"; \
169 fi
170
171 PHONY += ctags
172 ctags:
173 $(RM) tags
174 find $(top_srcdir) -name '.?*' -prune \
175 -o -type f -name '*.[hcS]' -exec ctags -a {} +
176
177 PHONY += etags
178 etags:
179 $(RM) TAGS
180 find $(top_srcdir) -name '.?*' -prune \
181 -o -type f -name '*.[hcS]' -exec etags -a {} +
182
183 PHONY += cscopelist
184 cscopelist:
185 find $(top_srcdir) -name '.?*' -prune \
186 -o -type f -name '*.[hc]' -print >cscope.files
187
188 PHONY += tags
189 tags: ctags etags
190
191 PHONY += pkg pkg-dkms pkg-kmod pkg-utils
192 pkg: @DEFAULT_PACKAGE@
193 pkg-dkms: @DEFAULT_PACKAGE@-dkms
194 pkg-kmod: @DEFAULT_PACKAGE@-kmod
195 pkg-utils: @DEFAULT_PACKAGE@-utils
196
197 include config/rpm.am
198 include config/deb.am
199 include config/tgz.am
200
201 .PHONY: $(PHONY)