]>
Commit | Line | Data |
---|---|---|
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 rpm | |
8 | if CONFIG_USER | |
9 | SUBDIRS += udev etc man scripts lib tests cmd contrib | |
10 | endif | |
11 | if CONFIG_KERNEL | |
12 | SUBDIRS += module | |
13 | ||
14 | extradir = $(prefix)/src/zfs-$(VERSION) | |
15 | extra_HEADERS = zfs.release.in zfs_config.h.in | |
16 | ||
17 | kerneldir = $(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION) | |
18 | nodist_kernel_HEADERS = zfs.release zfs_config.h module/$(LINUX_SYMBOLS) | |
19 | endif | |
20 | ||
21 | AUTOMAKE_OPTIONS = foreign | |
22 | EXTRA_DIST = autogen.sh copy-builtin | |
23 | EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am | |
24 | EXTRA_DIST += META AUTHORS COPYRIGHT LICENSE NEWS NOTICE README.md | |
25 | ||
26 | # Include all the extra licensing information for modules | |
27 | EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE module/icp/algs/skein/THIRDPARTYLICENSE.descrip | |
28 | EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman.descrip | |
29 | EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl.descrip | |
30 | EXTRA_DIST += module/spl/THIRDPARTYLICENSE.gplv2 module/spl/THIRDPARTYLICENSE.gplv2.descrip | |
31 | EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash module/zfs/THIRDPARTYLICENSE.cityhash.descrip | |
32 | ||
33 | @CODE_COVERAGE_RULES@ | |
34 | ||
35 | .PHONY: gitrev | |
36 | gitrev: | |
37 | -${top_srcdir}/scripts/make_gitrev.sh | |
38 | ||
39 | BUILT_SOURCES = gitrev | |
40 | ||
41 | distclean-local:: | |
42 | -$(RM) -R autom4te*.cache | |
43 | -find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \ | |
44 | -o -name .pc -o -name .hg -o -name .git \) -prune -o \ | |
45 | \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ | |
46 | -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ | |
47 | -o -name '.*.rej' -o -size 0 -o -name '*%' -o -name '.*.cmd' \ | |
48 | -o -name 'core' -o -name 'Makefile' -o -name 'Module.symvers' \ | |
49 | -o -name '*.order' -o -name '*.markers' -o -name '*.gcda' \ | |
50 | -o -name '*.gcno' \) \ | |
51 | -type f -print | xargs $(RM) | |
52 | ||
53 | all-local: | |
54 | -${top_srcdir}/scripts/zfs-tests.sh -c | |
55 | ||
56 | dist-hook: gitrev | |
57 | cp ${top_srcdir}/include/zfs_gitrev.h $(distdir)/include; \ | |
58 | sed -i 's/Release:[[:print:]]*/Release: $(RELEASE)/' \ | |
59 | $(distdir)/META | |
60 | ||
61 | # For compatibility, create a matching spl-x.y.z directly which contains | |
62 | # symlinks to the updated header and object file locations. These | |
63 | # compatibility links will be removed in the next major release. | |
64 | if CONFIG_KERNEL | |
65 | install-data-hook: | |
66 | rm -rf $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \ | |
67 | mkdir $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \ | |
68 | cd $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \ | |
69 | ln -s ../zfs-$(VERSION)/include/spl include && \ | |
70 | ln -s ../zfs-$(VERSION)/$(LINUX_VERSION) $(LINUX_VERSION) && \ | |
71 | ln -s ../zfs-$(VERSION)/zfs_config.h.in spl_config.h.in && \ | |
72 | ln -s ../zfs-$(VERSION)/zfs.release.in spl.release.in && \ | |
73 | cd $(DESTDIR)$(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION) && \ | |
74 | ln -fs zfs_config.h spl_config.h && \ | |
75 | ln -fs zfs.release spl.release | |
76 | endif | |
77 | ||
78 | codecheck: cstyle shellcheck flake8 mancheck testscheck vcscheck | |
79 | ||
80 | checkstyle: codecheck commitcheck | |
81 | ||
82 | commitcheck: | |
83 | @if git rev-parse --git-dir > /dev/null 2>&1; then \ | |
84 | ${top_srcdir}/scripts/commitcheck.sh; \ | |
85 | fi | |
86 | ||
87 | cstyle: | |
88 | @find ${top_srcdir} -name '*.[hc]' ! -name 'zfs_config.*' \ | |
89 | ! -name '*.mod.c' -type f \ | |
90 | -exec ${top_srcdir}/scripts/cstyle.pl -cpP {} \+ | |
91 | ||
92 | shellcheck: | |
93 | @if type shellcheck > /dev/null 2>&1; then \ | |
94 | shellcheck --exclude=SC1090 --format=gcc \ | |
95 | $$(find ${top_srcdir}/scripts/*.sh -type f) \ | |
96 | $$(find ${top_srcdir}/cmd/zed/zed.d/*.sh -type f) \ | |
97 | $$(find ${top_srcdir}/cmd/zpool/zpool.d/* -executable); \ | |
98 | else \ | |
99 | echo "skipping shellcheck because shellcheck is not installed"; \ | |
100 | fi | |
101 | ||
102 | mancheck: | |
103 | @if type mandoc > /dev/null 2>&1; then \ | |
104 | find ${top_srcdir}/man/man8 -type f -name 'zfs.8' \ | |
105 | -o -name 'zpool.8' -o -name 'zdb.8' \ | |
106 | -o -name 'zgenhostid.8' | \ | |
107 | xargs mandoc -Tlint -Werror; \ | |
108 | else \ | |
109 | echo "skipping mancheck because mandoc is not installed"; \ | |
110 | fi | |
111 | ||
112 | testscheck: | |
113 | @find ${top_srcdir}/tests/zfs-tests/tests -type f \ | |
114 | \( -name '*.ksh' -not -executable \) -o \ | |
115 | \( -name '*.kshlib' -executable \) -o \ | |
116 | \( -name '*.cfg' -executable \) | \ | |
117 | xargs -r stat -c '%A %n' | \ | |
118 | awk '{c++; print} END {if(c>0) exit 1}' | |
119 | ||
120 | vcscheck: | |
121 | @if git rev-parse --git-dir > /dev/null 2>&1; then \ | |
122 | git ls-files . --exclude-standard --others | \ | |
123 | awk '{c++; print} END {if(c>0) exit 1}' ; \ | |
124 | fi | |
125 | ||
126 | lint: cppcheck paxcheck | |
127 | ||
128 | cppcheck: | |
129 | @if type cppcheck > /dev/null 2>&1; then \ | |
130 | cppcheck --quiet --force --error-exitcode=2 --inline-suppr \ | |
131 | --suppressions-list=.github/suppressions.txt \ | |
132 | -UHAVE_SSE2 -UHAVE_AVX512F -UHAVE_UIO_ZEROCOPY \ | |
133 | ${top_srcdir}; \ | |
134 | else \ | |
135 | echo "skipping cppcheck because cppcheck is not installed"; \ | |
136 | fi | |
137 | ||
138 | paxcheck: | |
139 | @if type scanelf > /dev/null 2>&1; then \ | |
140 | ${top_srcdir}/scripts/paxcheck.sh ${top_srcdir}; \ | |
141 | else \ | |
142 | echo "skipping paxcheck because scanelf is not installed"; \ | |
143 | fi | |
144 | ||
145 | flake8: | |
146 | @if type flake8 > /dev/null 2>&1; then \ | |
147 | flake8 ${top_srcdir}; \ | |
148 | else \ | |
149 | echo "skipping flake8 because flake8 is not installed"; \ | |
150 | fi | |
151 | ||
152 | ctags: | |
153 | $(RM) tags | |
154 | find $(top_srcdir) -name .git -prune -o -name '*.[hc]' | xargs ctags | |
155 | ||
156 | etags: | |
157 | $(RM) TAGS | |
158 | find $(top_srcdir) -name .pc -prune -o -name '*.[hc]' | xargs etags -a | |
159 | ||
160 | tags: ctags etags | |
161 | ||
162 | pkg: @DEFAULT_PACKAGE@ | |
163 | pkg-dkms: @DEFAULT_PACKAGE@-dkms | |
164 | pkg-kmod: @DEFAULT_PACKAGE@-kmod | |
165 | pkg-utils: @DEFAULT_PACKAGE@-utils |