]> git.proxmox.com Git - mirror_zfs.git/blob - Makefile.am
Create "bin" directory so that zloop.sh works
[mirror_zfs.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 DISCLAIMER COPYRIGHT README.markdown OPENSOLARIS.LICENSE
25
26 @CODE_COVERAGE_RULES@
27
28 distclean-local::
29 -$(RM) -R autom4te*.cache
30 -find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
31 -o -name .pc -o -name .hg -o -name .git \) -prune -o \
32 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
33 -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
34 -o -name '.*.rej' -o -size 0 -o -name '*%' -o -name '.*.cmd' \
35 -o -name 'core' -o -name 'Makefile' -o -name 'Module.symvers' \
36 -o -name '*.order' -o -name '*.markers' -o -name '*.gcda' \
37 -o -name '*.gcno' \) \
38 -type f -print | xargs $(RM)
39
40 all-local:
41 -${top_srcdir}/scripts/zfs-tests.sh -c
42
43 dist-hook:
44 sed -i 's/Release:[[:print:]]*/Release: $(RELEASE)/' \
45 $(distdir)/META
46
47 checkstyle: cstyle shellcheck flake8 commitcheck mancheck testscheck
48
49 commitcheck:
50 @if git rev-parse --git-dir > /dev/null 2>&1; then \
51 ${top_srcdir}/scripts/commitcheck.sh; \
52 fi
53
54 cstyle:
55 @find ${top_srcdir} -name '*.[hc]' ! -name 'zfs_config.*' \
56 ! -name '*.mod.c' -type f \
57 -exec ${top_srcdir}/scripts/cstyle.pl -cpP {} \+
58
59 shellcheck:
60 @if type shellcheck > /dev/null 2>&1; then \
61 shellcheck --exclude=SC1090 --format=gcc \
62 $$(find ${top_srcdir}/scripts/*.sh -type f) \
63 $$(find ${top_srcdir}/cmd/zed/zed.d/*.sh -type f) \
64 $$(find ${top_srcdir}/cmd/zpool/zpool.d/* -executable); \
65 fi
66
67 mancheck:
68 @if type mandoc > /dev/null 2>&1; then \
69 find ${top_srcdir}/man/man8 -type f -name 'zfs.8' \
70 -o -name 'zpool.8' -o -name 'zdb.8' \
71 -o -name 'zgenhostid.8' | \
72 xargs mandoc -Tlint -Werror; \
73 fi
74
75 testscheck:
76 @find ${top_srcdir}/tests/zfs-tests/tests -type f \
77 \( -name '*.ksh' -not -executable \) -o \
78 \( -name '*.kshlib' -executable \) -o \
79 \( -name '*.cfg' -executable \) | \
80 xargs -r stat -c '%A %n' | \
81 awk '{c++; print} END {if(c>0) exit 1}'
82
83 lint: cppcheck paxcheck
84
85 cppcheck:
86 @if type cppcheck > /dev/null 2>&1; then \
87 cppcheck --quiet --force --error-exitcode=2 --inline-suppr \
88 --suppressions-list=.github/suppressions.txt \
89 -UHAVE_SSE2 -UHAVE_AVX512F -UHAVE_UIO_ZEROCOPY \
90 -UHAVE_DNLC ${top_srcdir}; \
91 fi
92
93 paxcheck:
94 @if type scanelf > /dev/null 2>&1; then \
95 ${top_srcdir}/scripts/paxcheck.sh ${top_srcdir}; \
96 fi
97
98 flake8:
99 @if type flake8 > /dev/null 2>&1; then \
100 flake8 ${top_srcdir}; \
101 fi
102
103 ctags:
104 $(RM) tags
105 find $(top_srcdir) -name .git -prune -o -name '*.[hc]' | xargs ctags
106
107 etags:
108 $(RM) TAGS
109 find $(top_srcdir) -name .pc -prune -o -name '*.[hc]' | xargs etags -a
110
111 tags: ctags etags
112
113 pkg: @DEFAULT_PACKAGE@
114 pkg-dkms: @DEFAULT_PACKAGE@-dkms
115 pkg-kmod: @DEFAULT_PACKAGE@-kmod
116 pkg-utils: @DEFAULT_PACKAGE@-utils