Commit 2eaf5fa1 authored by Vaibhav Gupta's avatar Vaibhav Gupta

Makefiles: Add cppcheck and flawfinder

Signed-off-by: 's avatarVaibhav Gupta <vaibhav.gupta@cern.ch>
parent a657a13d
......@@ -13,7 +13,7 @@ all clean cleanall install: $(DIRS)
modules modules_install:
@$(MAKE) -C drivers/fmc/ $@
cppcheck:
@$(MAKE) -C tools $@
flawfinder cppcheck:
for d in $(C_DIRS); do $(MAKE) -C $$d $@ || exit 1; done
.PHONY: sources srpm modules modules_install clean all cppcheck tools
.PHONY: modules modules_install clean all cppcheck flawfinder $(DIRS)
......@@ -12,6 +12,9 @@ KERNELSRC ?= /lib/modules/$(shell uname -r)/build
export CONFIG_FMC=m
CPPCHECK ?= cppcheck
FLAWFINDER ?= flawfinder
all: modules
clean modules help modules_install coccicheck:
......@@ -21,4 +24,10 @@ cleanall: clean
install: modules_install
.PHONY: all modules clean help install modules_install
cppcheck:
$(CPPCHECK) -q -I. -I$(KERNELSRC)/include --enable=all *.c *.h
flawfinder:
$(FLAWFINDER) -SQDC --error-level=5 .
.PHONY: all modules clean help install modules_install cppcheck flawfinder
......@@ -22,6 +22,7 @@ LDFLAGS = -L$(LIB)
LDLIBS = -lfmc
CPPCHECK ?= cppcheck
FLAWFINDER ?= flawfinder
all: $(TOOLS)
......@@ -43,4 +44,7 @@ cppcheck:
@$(MAKE) -C $(LIB) $@
$(CPPCHECK) -q -I. -I$(LIB) --suppress=missingIncludeSystem --enable=all *.c *.h --error-exitcode=1
flawfinder:
$(FLAWFINDER) -SQDC --error-level=6 .
.PHONY: cppcheck clean cleanall install all
......@@ -23,7 +23,9 @@ CFLAGS += -DGIT_VERSION="\"$(GIT_VERSION)\""
CFLAGS += $(EXTRACFLAGS)
DESTDIR ?= /usr/local
CPPCHECK ?= cppcheck
FLAWFINDER ?= flawfinder
all: lib
......@@ -61,4 +63,10 @@ cppcheck:
-include .depend
.PHONY: cppcheck all lib clean clanall install modules_install
cppcheck:
$(CPPCHECK) -q -I. --enable=all *.c *.h
flawfinder:
$(FLAWFINDER) -SQDC --error-level=6 .
.PHONY: cppcheck all lib clean clanall install modules_install flawfinder
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment