From b64e02e5805e84dcaa4b0820b555b9f90aa5afea Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 1 Aug 2016 18:00:47 +0000 Subject: [PATCH] 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 Closes #4915 --- Makefile.am | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile.am b/Makefile.am index ca8c8a0aa1..b0d23d00c3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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