From f04947830ef288e3064ea017e5f75cbd7383277f Mon Sep 17 00:00:00 2001 From: josh Date: Fri, 9 Oct 2009 19:59:08 +0000 Subject: [PATCH] updated to build on Windows git-svn-id: svn://anubis/misc/wfobj-view@165 bd8a9e45-a331-0410-811e-c64571078777 --- Makefile | 20 +++++++++++++++++--- wfobj-view.cc | 2 +- 2 files changed, 18 insertions(+), 4 deletions(-) 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