Makefile now detects OS.
This commit is contained in:
30
Makefile
30
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
|
||||
|
||||
UFLAGS =
|
||||
FLAGS = -Wall -Wextra -ggdb -fno-caret-diagnostics -fno-show-column
|
||||
#-std=c99 -pedantic
|
||||
|
||||
# MacOS
|
||||
ifeq ($(DETECTED_OS),macos)
|
||||
INCLUDE = $(shell pkg-config --cflags raylib)
|
||||
LIBS = $(shell pkg-config --libs raylib)
|
||||
FRAMEWORKS = -framework IOKit -framework Cocoa -framework OpenGL
|
||||
|
||||
# Linux
|
||||
# INCLUDE = -I./third_party/raylib/src/
|
||||
# LIBS = ./third_party/raylib/src/libraylib.a -lm
|
||||
# FRAMEWORKS =
|
||||
else ifeq ($(DETECTED_OS),linux)
|
||||
INCLUDE = -I./third_party/raylib/src/
|
||||
LIBS = ./third_party/raylib/src/libraylib.a -lm
|
||||
FRAMEWORKS =
|
||||
else ifeq ($(DETECTED_OS),windows)
|
||||
INCLUDE =
|
||||
LIBS =
|
||||
FRAMEWORKS =
|
||||
endif
|
||||
|
||||
EXE=main
|
||||
|
||||
|
||||
Reference in New Issue
Block a user