refactor(Makefile): 用硬链接代替复制并拆分测试目标
This commit is contained in:
11
Makefile
11
Makefile
@@ -32,18 +32,23 @@ debug: $(TARGET_NAME)
|
|||||||
|
|
||||||
prepare:
|
prepare:
|
||||||
@cmake -S $(SRC_DIR) -B $(BUILD_DIR)
|
@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
|
build: prepare
|
||||||
${RM} $(TARGET)
|
${RM} $(TARGET)
|
||||||
@cmake --build $(BUILD_DIR)
|
@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 -S $(SRC_DIR) -B $(BUILD_DIR) -DBUILD_TESTING=ON
|
||||||
cmake --build $(BUILD_DIR)
|
cmake --build $(BUILD_DIR)
|
||||||
|
|
||||||
|
test: build-test
|
||||||
ctest --test-dir $(BUILD_DIR)
|
ctest --test-dir $(BUILD_DIR)
|
||||||
|
|
||||||
|
test-detail: build-test
|
||||||
|
ctest --test-dir $(BUILD_DIR) --rerun-failed --output-on-failure
|
||||||
|
|
||||||
install-hooks:
|
install-hooks:
|
||||||
chmod +x $(MAKEFILE_DIR).githooks/pre-commit
|
chmod +x $(MAKEFILE_DIR).githooks/pre-commit
|
||||||
git -C $(MAKEFILE_DIR) config core.hooksPath $(MAKEFILE_DIR).githooks
|
git -C $(MAKEFILE_DIR) config core.hooksPath $(MAKEFILE_DIR).githooks
|
||||||
|
|||||||
Reference in New Issue
Block a user