Makefile now detects OS.
This commit is contained in:
36
Makefile
36
Makefile
@@ -1,18 +1,36 @@
|
|||||||
|
ifeq ($(OS),Windows_NT)
|
||||||
|
DETECTED_OS := windows
|
||||||
|
else
|
||||||
|
UNAME_S := $(shell uname -s)
|
||||||
|
|
||||||
|
ifeq ($(UNAME_S),Darwin)
|
||||||
|
DETECTED_OS := macos
|
||||||
|
else ifeq ($(UNAME_S),Linux)
|
||||||
|
DETECTED_OS := linux
|
||||||
|
else
|
||||||
|
DETECTED_OS := unknown
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
CC = clang
|
CC = clang
|
||||||
|
|
||||||
UFLAGS =
|
UFLAGS =
|
||||||
FLAGS = -Wall -Wextra -ggdb -fno-caret-diagnostics -fno-show-column
|
FLAGS = -Wall -Wextra -ggdb -fno-caret-diagnostics -fno-show-column
|
||||||
#-std=c99 -pedantic
|
#-std=c99 -pedantic
|
||||||
|
|
||||||
# MacOS
|
ifeq ($(DETECTED_OS),macos)
|
||||||
INCLUDE = $(shell pkg-config --cflags raylib)
|
INCLUDE = $(shell pkg-config --cflags raylib)
|
||||||
LIBS = $(shell pkg-config --libs raylib)
|
LIBS = $(shell pkg-config --libs raylib)
|
||||||
FRAMEWORKS = -framework IOKit -framework Cocoa -framework OpenGL
|
FRAMEWORKS = -framework IOKit -framework Cocoa -framework OpenGL
|
||||||
|
else ifeq ($(DETECTED_OS),linux)
|
||||||
# Linux
|
INCLUDE = -I./third_party/raylib/src/
|
||||||
# INCLUDE = -I./third_party/raylib/src/
|
LIBS = ./third_party/raylib/src/libraylib.a -lm
|
||||||
# LIBS = ./third_party/raylib/src/libraylib.a -lm
|
FRAMEWORKS =
|
||||||
# FRAMEWORKS =
|
else ifeq ($(DETECTED_OS),windows)
|
||||||
|
INCLUDE =
|
||||||
|
LIBS =
|
||||||
|
FRAMEWORKS =
|
||||||
|
endif
|
||||||
|
|
||||||
EXE=main
|
EXE=main
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user