Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Makefiles
Browse files Browse the repository at this point in the history
HiGarfield committed Jan 26, 2025
1 parent a31c4e5 commit b5d2d9f
Showing 2 changed files with 30 additions and 6 deletions.
18 changes: 15 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ override LDFLAGS += $(shell \
# cppcheck options
CPPCHECK_OPTS := $(shell \
echo | $(CC) -E -x c -v - 2>&1 | \
grep "^[[:space:]]*/usr.*/include" | \
grep "^[[:space:]]*/.*/include" | \
sed 's/^/-I /' \
)
CPPCHECK_OPTS += $(if $(findstring Linux,$(UNAME)),-D__linux__) \
@@ -79,17 +79,29 @@ CPPCHECK_OPTS += $(if $(findstring Linux,$(UNAME)),-D__linux__) \
CPPCHECK_OPTS += -D_GNU_SOURCE
CPPCHECK_OPTS += --enable=all \
--inconclusive \
--check-level=exhaustive \
--max-ctu-depth=10 \
--library=gnu \
--force \
--std=c89 \
--suppress=missingIncludeSystem \
--suppress=*:/usr/* \
--suppress=ConfigurationNotChecked \
--suppress=unmatchedSuppression \
--suppress=*:/*/include/* \
--suppress=unusedFunction \
--suppress=checkersReport \
-j 12

# cppcheck version >= 2.11
CPPCHECK_HIGH_VERSION := $(shell \
cppcheck --version 2>/dev/null | \
grep -oP '\d+\.\d+' | \
awk -F. '{print $$1*10000 + $$2 >= 20011 ? 1 : 0}' \
)

ifeq ($(CPPCHECK_HIGH_VERSION),1)
CPPCHECK_OPTS += --check-level=exhaustive
endif

# Check report file
CHECK_REPORT := check-report.txt

18 changes: 15 additions & 3 deletions tests/Makefile
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ override LDFLAGS += $(shell \
# cppcheck options
CPPCHECK_OPTS := $(shell \
echo | $(CC) -E -x c -v - 2>&1 | \
grep "^[[:space:]]*/usr.*/include" | \
grep "^[[:space:]]*/.*/include" | \
sed 's/^/-I /' \
)
CPPCHECK_OPTS += $(if $(findstring Linux,$(UNAME)),-D__linux__) \
@@ -80,17 +80,29 @@ CPPCHECK_OPTS += $(if $(findstring Linux,$(UNAME)),-D__linux__) \
CPPCHECK_OPTS += -D_GNU_SOURCE
CPPCHECK_OPTS += --enable=all \
--inconclusive \
--check-level=exhaustive \
--max-ctu-depth=10 \
--library=gnu \
--force \
--std=c89 \
--suppress=missingIncludeSystem \
--suppress=*:/usr/* \
--suppress=ConfigurationNotChecked \
--suppress=unmatchedSuppression \
--suppress=*:/*/include/* \
--suppress=unusedFunction \
--suppress=checkersReport \
-j 12

# cppcheck version >= 2.11
CPPCHECK_HIGH_VERSION := $(shell \
cppcheck --version 2>/dev/null | \
grep -oP '\d+\.\d+' | \
awk -F. '{print $$1*10000 + $$2 >= 20011 ? 1 : 0}' \
)

ifeq ($(CPPCHECK_HIGH_VERSION),1)
CPPCHECK_OPTS += --check-level=exhaustive
endif

# Check report file
CHECK_REPORT := check-report.txt

0 comments on commit b5d2d9f

Please sign in to comment.