From f1080c6095450af0d8b8c05a353b3feddd019597 Mon Sep 17 00:00:00 2001 From: proddy Date: Sun, 22 Nov 2020 16:15:07 +0100 Subject: [PATCH] add cppcheck --- .gitignore | 1 + makefile | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index aafac8a94..8271f2001 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ firmware /interface/build/ /interface/node_modules/ .VSCodeCounter/ +cppcheck.out.xml diff --git a/makefile b/makefile index 5f780ba0d..6926d277b 100644 --- a/makefile +++ b/makefile @@ -21,6 +21,9 @@ SOURCES := src lib_standalone lib/uuid-common/src lib/uuid-console/src lib/uui INCLUDES := lib/ArduinoJson/src lib_standalone lib/uuid-common/src lib/uuid-console/src lib/uuid-log/src lib/uuid-telnet/src lib/uuid-syslog/src src/devices src LIBRARIES := +CPPCHECK = cppcheck +CHECKFLAGS = -q + #---------------------------------------------------------------------- # Languages Standard #---------------------------------------------------------------------- @@ -110,7 +113,7 @@ COMPILE.cpp = $(CXX) $(CXX_STANDARD) $(CXXFLAGS) $(DEPFLAGS) -c $< -o $@ #---------------------------------------------------------------------- # Targets #---------------------------------------------------------------------- -all: $(OUTPUT) +all: cppcheck.out.xml $(OUTPUT) $(OUTPUT): $(OBJS) @mkdir -p $(@D) @@ -129,11 +132,14 @@ $(BUILD)/%.o: %.s @mkdir -p $(@D) $(COMPILE.s) +cppcheck.out.xml: $(SOURCES) + $(CPPCHECK) $(CHECKFLAGS) $^ --xml >$@ + run: $(OUTPUT) @$< clean: - @$(RM) -r $(BUILD) $(OUTPUT) + @$(RM) -r $(BUILD) $(OUTPUT) cppcheck.out.xml help: @echo available targets: all run clean