]> granicus.if.org Git - zfs/blob - Makefile.am
Enable shellcheck to run for select scripts
[zfs] / 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 distclean-local::
27         -$(RM) -R autom4te*.cache
28         -find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
29                 -o -name .pc -o -name .hg -o -name .git \) -prune -o \
30                 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
31                 -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
32                 -o -name '.*.rej' -o -name '.script-config' -o -size 0 \
33                 -o -name '*%' -o -name '.*.cmd' -o -name 'core' \
34                 -o -name 'Makefile' -o -name 'Module.symvers' \
35                 -o -name '*.order' -o -name '*.markers' \) \
36                 -type f -print | xargs $(RM)
37
38 dist-hook:
39         sed -i 's/Release:[[:print:]]*/Release:      $(RELEASE)/' \
40                 $(distdir)/META
41
42 checkstyle: cstyle shellcheck flake8
43
44 cstyle:
45         @find ${top_srcdir} -name '*.[hc]' ! -name 'zfs_config.*' \
46                 ! -name '*.mod.c' -type f -exec scripts/cstyle.pl -cpP {} \+
47
48 shellcheck:
49         @if type shellcheck > /dev/null 2>&1; then \
50                 shellcheck --exclude=SC1090 --format gcc scripts/paxcheck.sh \
51                         scripts/zloop.sh \
52                         scripts/zfs-tests.sh \
53                         scripts/zfs.sh; \
54                 (find cmd/zed/zed.d/*.sh -type f) | \
55                  grep -v 'zfs-script-config' | \
56                  while read file; do \
57                         shellcheck --exclude=SC1090 --format gcc "$$file"; \
58                  done; \
59          fi
60
61 lint: cppcheck paxcheck
62
63 cppcheck:
64         @if type cppcheck > /dev/null 2>&1; then \
65                 cppcheck --quiet --force --error-exitcode=2 ${top_srcdir}; \
66         fi
67
68 paxcheck:
69         @if type scanelf > /dev/null 2>&1; then \
70                 scripts/paxcheck.sh ${top_srcdir}; \
71         fi
72
73 flake8:
74         @if type flake8 > /dev/null 2>&1; then \
75                 flake8 ${top_srcdir}; \
76         fi
77
78 ctags:
79         $(RM) tags
80         find $(top_srcdir) -name .git -prune -o -name '*.[hc]' | xargs ctags
81
82 etags:
83         $(RM) TAGS
84         find $(top_srcdir) -name .pc -prune -o -name '*.[hc]' | xargs etags -a
85
86 tags: ctags etags
87
88 pkg: @DEFAULT_PACKAGE@
89 pkg-kmod: @DEFAULT_PACKAGE@-kmod
90 pkg-utils: @DEFAULT_PACKAGE@-utils