Add targets check1 (cppcheck) and check2 (clang-tidy)
This commit is contained in:
parent
1f4311529e
commit
7532011245
1 changed files with 27 additions and 18 deletions
45
Makefile
45
Makefile
|
|
@ -56,21 +56,30 @@ endif
|
||||||
# OS dependent flags
|
# OS dependent flags
|
||||||
#
|
#
|
||||||
OS := $(shell uname -s)
|
OS := $(shell uname -s)
|
||||||
ifeq ($(OS),Linux)
|
|
||||||
# installed by system and in PATH
|
ifeq ($(MAKECMDGOALS),check1)
|
||||||
CPPCHECK := cppcheck
|
ifeq ($(OS),Linux)
|
||||||
CHECKFLAGS := --platform=unix64
|
# installed by system and in PATH
|
||||||
DBG_REL +=
|
CPPCHECK := cppcheck
|
||||||
|
CHECKFLAGS :=
|
||||||
|
endif
|
||||||
|
ifeq ($(OS),SunOS)
|
||||||
|
# local installation
|
||||||
|
CPPCHECK := $(HOME)/devl/cppcheck/bin/cppcheck
|
||||||
|
endif
|
||||||
|
# Uncomment one of the following to select an output format
|
||||||
|
#CHECKFLAGS = --template="{file},{line},{severity},{id},{message}"
|
||||||
|
#CHECKFLAGS = --platform=unix64 --quiet --enable=all --error-exitcode=1 --check-level=exhaustive -I./include
|
||||||
|
CHECKFLAGS = --enable=all --error-exitcode=1 --suppress=missingIncludeSystem
|
||||||
endif
|
endif
|
||||||
# OpenIndiana and flavours
|
|
||||||
ifeq ($(OS),SunOS)
|
ifeq ($(MAKECMDGOALS),check2)
|
||||||
# local installation
|
CPPCHECK := clang-tidy
|
||||||
CPPCHECK := $(HOME)/devl/cppcheck/bin/cppcheck
|
CHECKFLAGS := --checks=*
|
||||||
CHECKFLAGS := --platform=unix64
|
|
||||||
DBG_REL +=
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SRC_DIR := src
|
SRC_DIR := src
|
||||||
OBJ_DIR := obj
|
OBJ_DIR := obj
|
||||||
SRC := $(wildcard $(SRC_DIR)/*.cpp)
|
SRC := $(wildcard $(SRC_DIR)/*.cpp)
|
||||||
|
|
@ -134,13 +143,11 @@ APP_LIBS=
|
||||||
LIBS = $(NETBEANSBUILD) $(APP_LIBS)
|
LIBS = $(NETBEANSBUILD) $(APP_LIBS)
|
||||||
|
|
||||||
|
|
||||||
# Uncomment one of the following to select an output format
|
|
||||||
#CHECKFLAGS = --template="{file},{line},{severity},{id},{message}"
|
|
||||||
CHECKFLAGS += --quiet --enable=all --error-exitcode=1 --check-level=exhaustive -I./include
|
|
||||||
#CHECKFLAGS = --enable=all --error-exitcode=1
|
|
||||||
|
|
||||||
debug release: DIRS $(APP)
|
debug release: DIRS $(APP)
|
||||||
check: cppcheck.out
|
.PHONY: check1 check2
|
||||||
|
check1 check2: check
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(APP): $(OBJS)
|
$(APP): $(OBJS)
|
||||||
|
|
@ -152,10 +159,11 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
|
||||||
DIRS:
|
DIRS:
|
||||||
mkdir -p obj bin
|
mkdir -p obj bin
|
||||||
|
|
||||||
cppcheck.out: $(SRC)
|
check: $(SRC)
|
||||||
$(info output to cppcheck.out)
|
$(info output to cppcheck.out)
|
||||||
$(info Check using: : $(CPPCHECK))
|
$(info Check using: : $(CPPCHECK))
|
||||||
$(CPPCHECK) $(CHECKFLAGS) $^ > $@ 2>&1
|
$(CPPCHECK) $(CHECKFLAGS) $^
|
||||||
|
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
|
@ -163,3 +171,4 @@ clean:
|
||||||
@rm -f $(APP) $(OBJ_DIR)/* ./bin/$(APP) cppcheck.out
|
@rm -f $(APP) $(OBJ_DIR)/* ./bin/$(APP) cppcheck.out
|
||||||
@if [ -d "./bin" ]; then rmdir ./bin ; fi
|
@if [ -d "./bin" ]; then rmdir ./bin ; fi
|
||||||
@if [ -d "./obj" ]; then rmdir ./obj ; fi
|
@if [ -d "./obj" ]; then rmdir ./obj ; fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue