diff --git a/Makefile b/Makefile index a06b0f9..ed903d8 100644 --- a/Makefile +++ b/Makefile @@ -26,16 +26,23 @@ ifeq ($(OS),Windows_NT) FixPath = $(subst /,\,$1) SOURCES := source/*.cpp source/common/*.cpp CXXFLAGS:= -std=c++11 -Wall -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -static-libstdc++ -Wl,-subsystem,windows - LDFLAGS := -lmingw32 -lws2_32 -lSDL2main -lSDL2 + LDFLAGS := -lmingw32 -lws2_32 -lSDL2main -lSDL2 -lopengl32 RM = del /Q MKD:= mkdir else FixPath = $1 SOURCES := $(shell find $(DIR_SOURCES) -name '*.cpp') - CXXFLAGS:= -std=c++11 -Wall -Os -ffunction-sections -fdata-sections -framework OpenGL -Wno-deprecated - LDFLAGS := -lSDL2 + CXXFLAGS:= -std=c++11 -Wall -Os -ffunction-sections -fdata-sections -Wno-deprecated + LDFLAGS := -lSDL2 RM = rm -f - MKD:= mkdir -p + MKD:= mkdir -p + UNAME_S := $(shell uname -s) + ifeq ($(UNAME_S),Linux) + LDFLAGS += -lGL + endif + ifeq ($(UNAME_S),Darwin) + LDFLAGS += -framework OpenGL + endif endif OBJECTS := $(subst $(DIR_SOURCES), $(DIR_BUILD), $(SOURCES))