From fda39fc4c0f04602ad4175a2d8587d2143e89f63 Mon Sep 17 00:00:00 2001 From: AramJonghu Date: Fri, 30 Oct 2026 02:19:50 +0100 Subject: [PATCH] feat(makefile): adds a make formatter as task runner --- makefile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/makefile b/makefile index a4ec05a..17a224f 100644 --- a/makefile +++ b/makefile @@ -1,13 +1,13 @@ -BUILD ?= cmake -B build -G Ninja -NONUITKA ?= cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DENABLE_MODULES="plugin;shell;m3shapes" -NINJA ?= ninja -C build -COMPILE ?= $(BUILD) && $(NINJA) -INSTALL ?= $(BUILD) && $(NINJA) && sudo ninja -C build install +BUILD ?= cmake -B build -G Ninja +NONUITKA ?= cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DENABLE_MODULES="plugin;shell;m3shapes" +NINJA ?= ninja -C build +COMPILE ?= $(BUILD) && $(NINJA) +INSTALL ?= $(BUILD) && $(NINJA) && sudo ninja -C build install -CPPFMT ?= find . \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) -not -path './build/*' -exec clang-format -i --style=file {} + -CPPLINT ?= run-clang-tidy -p build -j "$$(nproc)" -source-filter="^$$(pwd)/Plugins/" -header-filter=".*Plugins/.*" -removed-arg=-mno-direct-extern-access +CPPFMT ?= find . \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) -not -path './build/*' -exec clang-format -i --style=file {} + +CPPLINT ?= run-clang-tidy -p build -j "$$(nproc)" -source-filter="^$$(pwd)/Plugins/" -header-filter=".*Plugins/.*" -removed-arg=-mno-direct-extern-access -NUITKA ?= nuitka --module --include-package=zshell cli/src/zshell/ --output-dir=cli/ +NUITKA ?= nuitka --module --include-package=zshell cli/src/zshell/ --output-dir=cli/ .DEFAULT_GOAL := help @@ -32,6 +32,7 @@ help: @echo "check-cpp runs all C++ checks" @echo "check-py runs all Python checks" @echo "check-rs runs all Rust checks" + @echo "fmt-make formats the makefile using mbake (in case you like spaces instead of tabs)" build: $(BUILD) @@ -104,3 +105,6 @@ check-py: $(MAKE) py-test $(MAKE) py-check $(MAKE) py-compile + +fmt-make: + mbake format makefile