diff --git a/Makefile b/Makefile index c81e670..0f13067 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,20 @@ -CXX := g++ -CXXFLAGS := -O2 `sdl-config --cflags` -LDFLAGS := -lGL -lGLU `sdl-config --libs` -lSDL_image + +WINCHECK := $(shell which msys-1.0.dll >/dev/null 2>&1; if [ $$? -eq 0 ]; then echo MSYS; fi) +ifeq ($(strip $(WINCHECK)),) +WINDOWS := 0 +else +WINDOWS := 1 +endif + +ifeq ($(WINDOWS),1) +GLLIBS := -lopengl32 -lglu32 +WINDOWSLIBS := -lmingw32 +else +GLLIBS := -lGL -lGLU +endif + +export CXXFLAGS := -O2 $(shell sdl-config --cflags) +LDFLAGS := $(GLLIBS) $(WINDOWSLIBS) $(shell sdl-config --libs) -lSDL_image TARGET := wfobj-view .PHONY: all clean TextureCache wfobj diff --git a/wfobj-view.cc b/wfobj-view.cc index a6620b9..4318988 100644 --- a/wfobj-view.cc +++ b/wfobj-view.cc @@ -1,6 +1,6 @@ /* Libraries we use */ -#include +#include #include #include #include