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