From a0f971f4341d70ecc55fdc745c09e21440d832e7 Mon Sep 17 00:00:00 2001 From: Patrick Baudin <patrick.baudin@cea.fr> Date: Fri, 17 Jun 2022 17:31:43 +0200 Subject: [PATCH] [Lint] using CLANG_FORMAT variable --- share/Makefile.linting | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/share/Makefile.linting b/share/Makefile.linting index 478e3c75f7f..2ae15c8c269 100644 --- a/share/Makefile.linting +++ b/share/Makefile.linting @@ -50,7 +50,8 @@ IS_UTF8 ?= iconv -f UTF-8 -t UTF-8 TO_UTF8 ?= iconv -t UTF-8 -f -OCP_INDENT ?= ocp-indent +OCP_INDENT ?= ocp-indent +CLANG_FORMAT ?= clang-format # Default values necessary for # LINT_MAKEFILE=<this-makefile> make -f <this-makefile> <lint-target>` @@ -104,8 +105,8 @@ endif $(TOUCH) $@ .lint/check-clang-format-installed: - if ! command -v clang-format >/dev/null; then \ - echo "error: clang-format must be installed"; \ + if ! command -v $(CLANG_FORMAT) >/dev/null; then \ + echo "error: $(CLANG_FORMAT) must be installed"; \ exit 1; \ fi; mkdir -p $(dir $@) @@ -343,14 +344,14 @@ $(LINT_FILE.fix-ml-indent): .lint/%.fix-indent: % .lint/check-ocp-indent-version $(LINT_FILE.check-c-indent): .lint/%.check-indent: % .lint/check-clang-format-installed echo "Check C indent: $<" - clang-format --dry-run -Werror $< + $(CLANG_FORMAT) --dry-run -Werror $< $(MKDIR) $(dir $@) $(TOUCH) $@ .PHONY: $(LINT_FILE.fix-c-indent) $(LINT_FILE.fix-c-indent): .lint/%.fix-indent: % .lint/check-clang-format-installed echo "Fixes C indent: $<" - clang-format -i $< + $(CLANG_FORMAT) -i $< $(MKDIR) $(dir $@) $(TOUCH) .lint/$<.check-indent # no more need of check-indent -- GitLab