Add `make lint` target

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
This commit is contained in:
Brian Behlendorf 2016-08-01 18:00:47 +00:00 committed by Ned Bass
parent 9a6fcfd47d
commit 2aec0bf4c5
1 changed files with 7 additions and 0 deletions

View 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