aboutsummaryrefslogtreecommitdiff
path: root/lazy.mk
diff options
context:
space:
mode:
Diffstat (limited to 'lazy.mk')
-rw-r--r--lazy.mk16
1 files changed, 13 insertions, 3 deletions
diff --git a/lazy.mk b/lazy.mk
index 2620961..3b9813a 100644
--- a/lazy.mk
+++ b/lazy.mk
@@ -3,18 +3,28 @@
BUILD_DIR ?= build
TARGET ?= $(BUILD_DIR)/main
+CMFLAGS += --fresh
+CMFLAGS += --log-level WARNING
+CMFLAGS += -Wno-deprecated
+
.PHONY: FORCE
all: FORCE $(TARGET)
$(BUILD_DIR)/build.ninja: CMakeLists.txt
- mkdir -p $(BUILD_DIR)
- cmake -B $(BUILD_DIR) -G Ninja --fresh --log-level WARNING
+ @mkdir -p $(BUILD_DIR)
+ @cmake -B $(BUILD_DIR) -G Ninja $(CMFLAGS)
$(TARGET): $(BUILD_DIR)/build.ninja FORCE
- ninja -C $(BUILD_DIR)
+ @ninja -C $(BUILD_DIR)
# ninja automatically builds in parallel, so is preferred
clean: FORCE
$(RM) -r $(BUILD_DIR)
+# forward other targets to cmake
+ifneq ($(MAKECMDGOALS),)
+%::
+ @ninja -C $(BUILD_DIR) $@
+endif
+