aboutsummaryrefslogtreecommitdiff
path: root/lazy.mk
diff options
context:
space:
mode:
Diffstat (limited to 'lazy.mk')
-rw-r--r--lazy.mk20
1 files changed, 20 insertions, 0 deletions
diff --git a/lazy.mk b/lazy.mk
new file mode 100644
index 0000000..2620961
--- /dev/null
+++ b/lazy.mk
@@ -0,0 +1,20 @@
+# this file is for lazy people (loek)
+
+BUILD_DIR ?= build
+TARGET ?= $(BUILD_DIR)/main
+
+.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
+
+$(TARGET): $(BUILD_DIR)/build.ninja FORCE
+ ninja -C $(BUILD_DIR)
+# ninja automatically builds in parallel, so is preferred
+
+clean: FORCE
+ $(RM) -r $(BUILD_DIR)
+