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