From 586369b63cdede5fa09f5f9ed73abde6c8264425 Mon Sep 17 00:00:00 2001 From: iurii plugatarov Date: Fri, 16 Aug 2024 11:43:03 +0300 Subject: start --- Makefile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5f97b46 --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +# Define the compiler and flags +ODIN = odin +SRC_DIR = src +OUT_DIR_DEBUG = out/debug +OUT_DIR_RELEASE = out/release +PROGRAM_NAME = funhalla + +# Define the build targets +all: debug release + +debug: $(OUT_DIR_DEBUG)/$(PROGRAM_NAME) + +release: $(OUT_DIR_RELEASE)/$(PROGRAM_NAME) + +# Rule for building the debug version +$(OUT_DIR_DEBUG)/$(PROGRAM_NAME): $(SRC_DIR)/*.odin + @mkdir -p $(OUT_DIR_DEBUG) + $(ODIN) build $(SRC_DIR) -out:$(OUT_DIR_DEBUG)/$(PROGRAM_NAME) --debug + +# Rule for building the release version +$(OUT_DIR_RELEASE)/$(PROGRAM_NAME): $(SRC_DIR)/*.odin + @mkdir -p $(OUT_DIR_RELEASE) + $(ODIN) build $(SRC_DIR) -out:$(OUT_DIR_RELEASE)/$(PROGRAM_NAME) + +# Clean up build artifacts +clean: + rm -rf $(OUT_DIR_DEBUG) $(OUT_DIR_RELEASE) + +.PHONY: all debug release clean -- cgit 1.4.1-2-gfad0