From 3e2b29f84548a3d44e10e996a3d6832774b9a44c Mon Sep 17 00:00:00 2001
From: Joscha Schmiedt <joscha@schmiedt.dev>
Date: Mon, 29 Jul 2024 23:03:01 +0200
Subject: [PATCH] CHG: Add more options to Makefile

- build
- test
- clean
---
 Makefile | 33 +++++++++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 214c6f2..38ba967 100644
--- a/Makefile
+++ b/Makefile
@@ -35,14 +35,39 @@ CLANG_TIDY_CMD = $(CLANG_TIDY) \
 .PHONY: help
 help:
 	@echo "Targets:"
-	@echo "    conan-install - Install locally with Conan."
+	@echo "    conan-install-debug - Install locally with Conan."
+	@echo "    conan-install-release - Install locally with Conan."
 	@echo "    format - auto-format the source files."
+	@echo "    build-debug - Build the project in Debug mode."
+	@echo "    build-release - Build the project in Release mode."
+	@echo "    test-debug - Run the tests in Debug mode."
+	@echo "    test-release - Run the tests in Release mode."
+	@echo "    clean - Remove build directories."
 
-conan-install:
-	conan install . -s "compiler.libcxx=libstdc++11"
-.PHONY: conan-install
+conan-install-debug:
+	conan install . -s "compiler.libcxx=libstdc++11" -s build_type=Debug --build=missing
+
+conan-install-release:
+	conan install . -s "compiler.libcxx=libstdc++11" -s build_type=Release --build=missing
 
 format:
 	$(CLANG_FORMAT) -i --verbose \
 	 $$(find test/ -type f -iname "*.cpp" -o -iname "*.h" -o -iname "*.h.in")
 .PHONY: format
+
+build-debug: conan-install-debug
+	cmake --preset conan-debug && cmake --build build/Debug
+
+build-release: conan-install-release
+	cmake --preset conan-release && cmake --build build/Release
+
+test-debug: build-debug
+	cd build/Debug && ctest
+
+test-release: build-release
+	cd build/Release && ctest
+
+clean:
+	rm -rf build
+
+.PHONY: conan-install-debug conan-install-release build-debug build-release test-debug test-release
\ No newline at end of file
-- 
GitLab