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