41 lines
1.1 KiB
Makefile
41 lines
1.1 KiB
Makefile
# See LICENSE for license details.
|
|
|
|
|
|
################################################################################
|
|
# clang-tidy
|
|
################################################################################
|
|
|
|
clang_tidy_files := $(shell \
|
|
find $(firesim_base_dir) -name '*.cc' -or -name '*.h' \
|
|
| grep -v TestPointerChaser.cc \
|
|
| grep -v simif_ \
|
|
| grep -v tracerv \
|
|
| grep -v tsibridge \
|
|
| grep -v dmibridge \
|
|
| grep -v fesvr \
|
|
| grep -v generated-src \
|
|
| grep -v output \
|
|
| grep -v -F 'entry.cc' \
|
|
| grep -v -F 'dpi.cc' \
|
|
)
|
|
|
|
clang_tidy_flags :=\
|
|
-I$(firesim_base_dir)/midas/src/main/cc \
|
|
-I$(firesim_base_dir)/firesim-lib/src/main/cc \
|
|
-I$(firesim_base_dir)/src/main/cc/midasexamples \
|
|
-std=c++20 \
|
|
-x c++
|
|
|
|
# Checks the files in parallel without applying fixes.
|
|
.PHONY: clang-tidy
|
|
clang-tidy:
|
|
@echo $(clang_tidy_files) \
|
|
| tr ' ' '\n' \
|
|
| parallel -I% --max-args 1 clang-tidy % -- $(clang_tidy_flags)
|
|
|
|
|
|
# Applies fixes to issues detected.
|
|
.PHONY: clang-tidy-fix
|
|
clang-tidy-fix:
|
|
@clang-tidy -fix $(clang_tidy_files) -- $(clang_tidy_flags)
|