2024-07-05 10:44:08 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#
|
|
|
|
# Copyright Red Hat
|
|
|
|
# Author: David Gibson <david@gibson.dropbear.id.au>
|
|
|
|
|
2024-07-05 10:44:09 +00:00
|
|
|
TARGETS = reuseaddr-priority recv-zero
|
|
|
|
SRCS = reuseaddr-priority.c recv-zero.c
|
2024-07-05 10:44:08 +00:00
|
|
|
CFLAGS = -Wall
|
|
|
|
|
|
|
|
all: cppcheck clang-tidy $(TARGETS:%=check-%)
|
|
|
|
|
|
|
|
$(TARGETS): %: %.c common.c common.h
|
|
|
|
|
|
|
|
check-%: %
|
|
|
|
./$<
|
|
|
|
|
|
|
|
cppcheck:
|
|
|
|
cppcheck --std=c11 --error-exitcode=1 --enable=all --force \
|
2024-07-05 10:44:09 +00:00
|
|
|
--check-level=exhaustive --inline-suppr \
|
2024-07-05 10:44:08 +00:00
|
|
|
--inconclusive --library=posix --quiet \
|
|
|
|
--suppress=missingIncludeSystem \
|
|
|
|
$(SRCS)
|
|
|
|
|
|
|
|
clang-tidy:
|
|
|
|
clang-tidy --checks=*,\
|
|
|
|
-altera-id-dependent-backward-branch,\
|
|
|
|
-altera-unroll-loops,\
|
|
|
|
-bugprone-easily-swappable-parameters,\
|
|
|
|
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,\
|
|
|
|
-concurrency-mt-unsafe,\
|
|
|
|
-cppcoreguidelines-avoid-non-const-global-variables,\
|
|
|
|
-cppcoreguidelines-init-variables,\
|
|
|
|
-cppcoreguidelines-macro-to-enum,\
|
|
|
|
-google-readability-braces-around-statements,\
|
|
|
|
-hicpp-braces-around-statements,\
|
|
|
|
-llvmlibc-restrict-system-libc-headers,\
|
|
|
|
-misc-include-cleaner,\
|
|
|
|
-modernize-macro-to-enum,\
|
|
|
|
-readability-braces-around-statements,\
|
|
|
|
-readability-identifier-length,\
|
|
|
|
-readability-isolate-declaration \
|
|
|
|
$(SRCS)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(TARGETS) *.o *~
|