make: Clean-indented makefiles

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2019-03-17 16:24:26 +00:00
commit 68f25261ba
6 changed files with 23 additions and 23 deletions

View file

@ -4,7 +4,7 @@
# $Id$
ifndef TARGETS_TOOLS_MK_INCLUDED
TARGETS_TOOLS_MK_INCLUDED = true
TARGETS_TOOLS_MK_INCLUDED = true
include $(MODDIR)/make/rules.mk
@ -52,34 +52,34 @@ clean.link:
rmdir -p $(dir $(HDRDIR_SCOPE_SUFFIX)) 2>/dev/null || : ;\
fi
CLANG_TIDY_H_C_CPP := $(shell $(ECHO) $(LOCAL_H) | xargs -r $(GREP) -l 'extern *"C"')
CLANG_TIDY_H_C := $(wildcard [a-z]*.h)
CLANG_TIDY_H_CPP := $(wildcard [A-Z]*.h)
#CLANG_TIDY_H_CPP := $(filter-out $(CLANG_TIDY_H_C),$(LOCAL_H))
CLANG_TIDY_H_C_CPP := $(shell $(ECHO) $(LOCAL_H) | xargs -r $(GREP) -l 'extern *"C"')
CLANG_TIDY_H_C := $(wildcard [a-z]*.h)
CLANG_TIDY_H_CPP := $(wildcard [A-Z]*.h)
#CLANG_TIDY_H_CPP := $(filter-out $(CLANG_TIDY_H_C),$(LOCAL_H))
# false positives on assert(), see https://reviews.llvm.org/D31130
CLANG_TIDY_EXTRA_ARGS += -cppcoreguidelines-pro-bounds-array-to-pointer-decay
CLANG_TIDY_EXTRA_ARGS += -cppcoreguidelines-pro-bounds-array-to-pointer-decay
# keep va_args
CLANG_TIDY_EXTRA_ARGS += -cppcoreguidelines-pro-type-vararg
CLANG_TIDY_EXTRA_ARGS += -cppcoreguidelines-pro-type-vararg
# keep pointer arithmetic
CLANG_TIDY_EXTRA_ARGS += -cppcoreguidelines-pro-bounds-pointer-arithmetic
CLANG_TIDY_EXTRA_ARGS += -cppcoreguidelines-pro-bounds-pointer-arithmetic
# don't have GSL (for now)
CLANG_TIDY_EXTRA_ARGS += -cppcoreguidelines-pro-bounds-constant-array-index
CLANG_TIDY_EXTRA_ARGS += -cppcoreguidelines-pro-bounds-constant-array-index
CLANG_TIDY_FILTER = $(SED) 's%\[\([a-z-]\+\)\]$$%[https://clang.llvm.org/extra/clang-tidy/checks/\1.html]%'
comma := ,
empty :=
space := $(empty) $(empty)
CLANG_TIDY_CHECKS ?= -$(subst $(space),,*,clang-analyzer-*,-clang-analyzer-cplusplus*,modernize-*,portability-*,cppcoreguidelines-*$(addprefix $(comma),$(CLANG_TIDY_EXTRA_ARGS)))
CLANG_TIDY ?= clang-tidy -checks=$(CLANG_TIDY_CHECKS)
CLANG_TIDY_FILTER = $(SED) 's%\[\([a-z-]\+\)\]$$%[https://clang.llvm.org/extra/clang-tidy/checks/\1.html]%'
comma := ,
empty :=
space := $(empty) $(empty)
CLANG_TIDY_CHECKS ?= -$(subst $(space),,*,clang-analyzer-*,-clang-analyzer-cplusplus*,modernize-*,portability-*,cppcoreguidelines-*$(addprefix $(comma),$(CLANG_TIDY_EXTRA_ARGS)))
CLANG_TIDY ?= clang-tidy -checks=$(CLANG_TIDY_CHECKS)
clean: clang-tidy-clean
clang-tidy-clean:
rm -f clang-tidy-cache*.tmp
CLANG_TIDY_CACHE_CPP = clang-tidy-cache-cpp.tmp
CLANG_TIDY_CACHE_CPP = clang-tidy-cache-cpp.tmp
$(CLANG_TIDY_CACHE_CPP): $(LOCAL_CPP)
$(CLANG_TIDY) $(LOCAL_CPP) -- $(INCLUDE) -x c++ | $(CLANG_TIDY_FILTER) | tee $@