From f504cd4b8510272089f131a1e74ecd69826ba796 Mon Sep 17 00:00:00 2001 From: Aryeh Date: Thu, 19 Nov 2020 16:01:18 +1100 Subject: [PATCH] Edited makefile to run OS specific commands --- Makefile | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 26c53e6..c7facab 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,28 @@ -buildfile = ./build/app - +# Variable definitions macOSFrameworks = -framework CoreVideo -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL +ifeq ($(OS), Windows_NT) + # Build for Windows: + + # Not implemented yet +else + # Build for MacOS or Linux: + buildfile = ./build/app + initCommand = mkdir -p build + compileCommand = clang++ -std=c++17 $(macOSFrameworks) -I ./include/ ./lib/libraylib.a ./src/main.cpp -o $(buildfile) + cleanCommand = rm $(buildfile) +endif + all: init compile run clean init: - mkdir -p build + $(initCommand) compile: - clang++ -std=c++17 $(macOSFrameworks) -I ./include/ ./lib/libraylib.a ./src/main.cpp -o $(buildfile) + $(compileCommand) run: $(buildfile) clean: - rm $(buildfile) \ No newline at end of file + $(cleanCommand) \ No newline at end of file