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