]> granicus.if.org Git - zfs/commitdiff
Add `make lint` target
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 1 Aug 2016 18:00:47 +0000 (18:00 +0000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 2 Aug 2016 16:25:43 +0000 (09:25 -0700)
Add a `make lint` target which maps to a cppcheck target.  As with
the shellcheck target it will only run when cppcheck is installed.
This allows a `make lint` build check to be incrementally added to
the automated testing for distribution which provide cppcheck.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4915

Makefile.am

index ca8c8a0aa1c85de5df93c411c09b776c923a8ed4..b0d23d00c3760b552af4ab84f1246f30755831e7 100644 (file)
@@ -55,6 +55,13 @@ shellcheck:
                 done; \
         fi
 
+lint: cppcheck
+
+cppcheck:
+       @if type cppcheck > /dev/null 2>&1; then \
+               cppcheck --quiet --force ${top_srcdir}; \
+       fi
+
 ctags:
        $(RM) tags
        find $(top_srcdir) -name .git -prune -o -name '*.[hc]' | xargs ctags