From 9724b7f7cd74083ffc8394db8ab4fc899030af96 Mon Sep 17 00:00:00 2001 From: Aryeh Date: Sun, 27 Jun 2021 14:39:00 +1000 Subject: [PATCH] Added ability to add custom macro definitions --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 87616f0..3bd3964 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,9 @@ objects := $(patsubst src/%, $(buildDir)/%, $(patsubst %.cpp, %.o, $(sources))) depends := $(patsubst %.o, %.d, $(objects)) compileFlags := -std=c++17 -I include linkFlags = -L lib/$(platform) -l raylib +ifdef MACRO_DEFS + macroDefines := -D $(MACRO_DEFS) +endif # Check for Windows ifeq ($(OS), Windows_NT) @@ -85,7 +88,7 @@ $(target): $(objects) # Compile objects to the build directory $(buildDir)/%.o: src/%.cpp Makefile $(MKDIR) $(call platformpth, $(@D)) - $(CXX) -MMD -MP -c $(compileFlags) $< -o $@ + $(CXX) -MMD -MP -c $(compileFlags) $< -o $@ $(macroDefines) # Run the executable execute: