From 10fa3740a8197dd3bcc768c537b224a8e43727db Mon Sep 17 00:00:00 2001 From: Zedhugh Chen Date: Mon, 27 Apr 2026 01:28:31 +0800 Subject: [PATCH] =?UTF-8?q?refactor(Makefile):=20=E7=94=A8=E7=A1=AC?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E4=BB=A3=E6=9B=BF=E5=A4=8D=E5=88=B6=E5=B9=B6?= =?UTF-8?q?=E6=8B=86=E5=88=86=E6=B5=8B=E8=AF=95=E7=9B=AE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index cdc72b4..f6ef8b7 100644 --- a/Makefile +++ b/Makefile @@ -32,18 +32,23 @@ debug: $(TARGET_NAME) prepare: @cmake -S $(SRC_DIR) -B $(BUILD_DIR) - @cp $(BUILD_DIR)/compile_commands.json $(MAKEFILE_DIR) + @cp -lf $(BUILD_DIR)/compile_commands.json $(MAKEFILE_DIR) build: prepare ${RM} $(TARGET) @cmake --build $(BUILD_DIR) - @cp $(BUILD_DIR)/$(TARGET_NAME) $(TARGET) + @cp -lf $(BUILD_DIR)/$(TARGET_NAME) $(TARGET) -test: +build-test: cmake -S $(SRC_DIR) -B $(BUILD_DIR) -DBUILD_TESTING=ON cmake --build $(BUILD_DIR) + +test: build-test ctest --test-dir $(BUILD_DIR) +test-detail: build-test + ctest --test-dir $(BUILD_DIR) --rerun-failed --output-on-failure + install-hooks: chmod +x $(MAKEFILE_DIR).githooks/pre-commit git -C $(MAKEFILE_DIR) config core.hooksPath $(MAKEFILE_DIR).githooks