aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Kropf <josh@slashdev.ca>2011-04-21 17:21:59 (GMT)
committerJosh Kropf <josh@slashdev.ca>2011-04-21 17:21:59 (GMT)
commit6706467239a11bd944e998786c9fe7c365282483 (patch)
tree704d8cda73c402cf04ad6ab292e42341bc538799
parentf340d4f55f22b3044cd323f02a08586af6cd97f2 (diff)
downloadballdemo-6706467239a11bd944e998786c9fe7c365282483.zip
balldemo-6706467239a11bd944e998786c9fe7c365282483.tar.gz
balldemo-6706467239a11bd944e998786c9fe7c365282483.tar.bz2
added mingw detection in Makefile
-rw-r--r--desktop/Makefile13
1 files changed, 10 insertions, 3 deletions
diff --git a/desktop/Makefile b/desktop/Makefile
index 644c42c..bbd5ea9 100644
--- a/desktop/Makefile
+++ b/desktop/Makefile
@@ -1,14 +1,18 @@
UNAME=$(shell uname)
CC=g++
-ifeq ($(UNAME), Linux)
+ifeq ($(UNAME),Linux)
LDFLAGS=-lGL -lGLEW -lglut
CFLAGS=-g -Wall -I../common
endif
-ifeq ($(UNAME), Darwin)
+ifeq ($(UNAME),Darwin)
LDFLAGS=-framework GLUT -framework OpenGL -L/opt/local/lib -lGLEW
CFLAGS=-g -Wall -I../common -I/opt/local/include
endif
+ifneq (,$(findstring MINGW,$(UNAME)))
+ LDFLAGS=-lglew32 -lglut -lglu32 -lopengl32
+ CFLAGS=-g -Wall -I../common
+endif
OUTPUT=balldemo
@@ -62,8 +66,11 @@ OBJ=$(SRC:.cpp=.o)
all: $(SRC) $(OUTPUT)
+# mingw for some crazzy reason has a ton of linker errors if the object files
+# appear after LDFLAGS, so swap them (doesn't seems to effect Linux or OSX)
+
$(OUTPUT): $(OBJ)
- $(CC) $(LDFLAGS) $(OBJ) -o $@
+ $(CC) $(OBJ) $(LDFLAGS) -o $@
.cpp.o:
$(CC) -c $(CFLAGS) $< -o $@