Added Linux case to Makefile
This commit is contained in:
parent
604d4045e4
commit
e02caa69bd
29
Makefile
29
Makefile
@ -1,15 +1,26 @@
|
|||||||
# Variable definitions
|
# Set platform-specific macros
|
||||||
macOSFrameworks = -framework CoreVideo -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL
|
|
||||||
|
|
||||||
ifeq ($(OS), Windows_NT)
|
ifeq ($(OS), Windows_NT)
|
||||||
# Build for Windows:
|
# Build for Windows
|
||||||
|
|
||||||
# Not implemented yet
|
|
||||||
else
|
else
|
||||||
# Build for MacOS or Linux:
|
# Build for MacOS/Linux
|
||||||
|
|
||||||
|
UNAME_S := $(shell uname -s)
|
||||||
|
ifeq ($(UNAME_S), Linux)
|
||||||
|
# Set Linux macros
|
||||||
|
compiler = g++
|
||||||
|
libPath = ./lib/Linux/libraylib.a
|
||||||
|
endif
|
||||||
|
ifeq ($(UNAME_S), Darwin)
|
||||||
|
# Set macOS macros
|
||||||
|
compiler = clang++
|
||||||
|
frameworks = -framework CoreVideo -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL
|
||||||
|
libPath = ./lib/macOS/libraylib.a
|
||||||
|
endif
|
||||||
|
|
||||||
buildfile = ./build/app
|
buildfile = ./build/app
|
||||||
initCommand = mkdir -p build
|
initCommand = mkdir -p build
|
||||||
compileCommand = clang++ -std=c++17 $(macOSFrameworks) -I ./include/ ./lib/libraylib.a ./src/main.cpp -o $(buildfile)
|
compileCommand = $(compiler) -std=c++17 $(frameworks) -I ./include/ $(libPath) ./src/main.cpp -o $(buildfile)
|
||||||
cleanCommand = rm $(buildfile)
|
cleanCommand = rm $(buildfile)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -25,4 +36,4 @@ run:
|
|||||||
$(buildfile)
|
$(buildfile)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(cleanCommand)
|
$(cleanCommand)
|
||||||
|
Loading…
Reference in New Issue
Block a user