summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..b8a8022
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,27 @@
+PREFIX ?= /usr/local
+
+stub:
+ @echo "Use 'make release' or 'make debug' to build the project."
+
+release:
+ cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:STRING=${PREFIX} -S . -B ./build
+ cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF`
+
+debug:
+ cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_INSTALL_PREFIX:STRING=${PREFIX} -S . -B ./build
+ cmake --build ./build --config Debug --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF`
+
+clean:
+ rm -rf build
+
+all:
+ $(MAKE) clean
+ $(MAKE) release
+
+install:
+ cmake --install ./build
+
+uninstall:
+ xargs rm < ./build/install_manifest.txt
+
+.PHONY: stub release debug clean all install uninstall format