From 5bf50af74bf4b88182dda0e7cb36c2e7b81ee9b7 Mon Sep 17 00:00:00 2001 From: rektdie Date: Tue, 15 Oct 2024 15:41:56 +0200 Subject: [PATCH] Makefile now accepts EXE and CXX commands from command line --- Makefile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 229f359..ae288ed 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,11 @@ SRC_DIR := source OBJ_DIR := obj -CXX := g++ -EXE := Engine-Eleanor +# Set default C++ compiler, but allow override from the command line +CXX ?= g++ + +# Set default executable name, but allow override from the command line +EXE ?= Engine-Eleanor # Determine platform ifeq ($(OS),Windows_NT) @@ -28,4 +31,9 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/types.h | $(OBJ_DIR) # Create the object directory if it doesn't exist $(OBJ_DIR): - mkdir $@ + mkdir -p $@ + +# Clean up build artifacts +.PHONY: clean +clean: + rm -rf $(OBJ_DIR) $(EXE)$(EXE_EXT)