From 56e0318c6a13c477621d497f2156df9944ffa778 Mon Sep 17 00:00:00 2001 From: Jonathan Moallem Date: Thu, 26 Nov 2020 16:53:00 +1100 Subject: [PATCH] Added the ability to explicitly define compiler --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3ab49bc..722d388 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,11 @@ else cleanCommand = rm $(buildFile) endif +# Explicitly set compiler to platform default if unset +ifeq ($(CXX),) + CXX = $(compiler) +endif + # Default target, compiles, executes and cleans run: compile execute clean @@ -60,12 +65,13 @@ lib: pull mkdir $(mkdirOptions) lib/$(platform) cp vendor/raylib-cpp/vendor/raylib/$(libGenDirectory)/libraylib.a lib/$(platform)/libraylib.a +# Create the build folder build: mkdir $(mkdirOptions) build # Create the build folder and compile the executable compile: build - $(compiler) -std=c++17 -I include -L lib/$(platform) src/main.cpp -o $(buildFile) -l raylib $(options) + $(CXX) -std=c++17 -I include -L lib/$(platform) src/main.cpp -o $(buildFile) -l raylib $(options) # Run the executable execute: