From 9c387937ef0583f913a6ab448d804608c3b33e83 Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Sat, 18 Nov 2023 21:36:08 +0100 Subject: [PATCH] chore: clean up makefiles a bit --- Makefile | 14 +++++++++----- landerctl/Makefile | 4 ++-- lsm/Makefile | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 63c35f2..f2c448c 100644 --- a/Makefile +++ b/Makefile @@ -106,10 +106,14 @@ $(BUILD_DIR)/$(TEST_DIR)/%.c.o: $(TEST_DIR)/%.c .PHONY: lint lint: clang-format -n --Werror $(SRCS) $(SRCS_H) $(SRCS_H_INTERNAL) + make -C lsm lint + make -C landerctl lint .PHONY: fmt fmt: clang-format -i $(SRCS) $(SRCS_H) $(SRCS_H_INTERNAL) + make -C lsm fmt + make -C landerctl fmt .PHONY: check check: @@ -117,21 +121,21 @@ check: cppcheck \ $(addprefix -I,$(INC_DIRS)) \ --cppcheck-build-dir=$(BUILD_DIR)/cppcheck \ - --project=compile_commands.json \ --error-exitcode=1 \ --enable=warning,style \ - -ithirdparty/* \ - -itrie/* \ --inline-suppr \ --check-level=exhaustive \ --quiet \ - -j$(shell nproc) + -j$(shell nproc) \ + $(SRCS) + make -C lsm check + make -C landerctl check .PHONY: clean clean: rm -rf $(BUILD_DIR) $(MAKE) -C lsm clean - + $(MAKE) -C landerctl clean .PHONY: bear bear: clean diff --git a/landerctl/Makefile b/landerctl/Makefile index 72b8239..487e0f2 100644 --- a/landerctl/Makefile +++ b/landerctl/Makefile @@ -98,13 +98,13 @@ check: cppcheck \ $(addprefix -I,$(INC_DIRS)) \ --cppcheck-build-dir=$(BUILD_DIR)/cppcheck \ - --project=compile_commands.json \ --error-exitcode=1 \ --enable=warning,style \ --inline-suppr \ --check-level=exhaustive \ --quiet \ - -j$(shell nproc) + -j$(shell nproc) \ + $(SRCS) .PHONY: clean clean: diff --git a/lsm/Makefile b/lsm/Makefile index c853ed9..716d82d 100644 --- a/lsm/Makefile +++ b/lsm/Makefile @@ -97,6 +97,20 @@ lint: fmt: clang-format -i $(SRCS) $(SRCS_H) $(SRCS_H_INTERNAL) $(SRCS_EXAMPLE) +.PHONY: check +check: + mkdir -p $(BUILD_DIR)/cppcheck + cppcheck \ + $(addprefix -I,$(INC_DIRS)) \ + --cppcheck-build-dir=$(BUILD_DIR)/cppcheck \ + --error-exitcode=1 \ + --enable=warning,style \ + --inline-suppr \ + --check-level=exhaustive \ + --quiet \ + -j$(shell nproc) \ + $(SRCS) + .PHONY: clean clean: rm -rf $(BUILD_DIR)