summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 290971d8586b2c3a10ab0a033a5911d4ac97fd7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
UNAME := $(shell uname -s)

CC=g++
CXXFLAGS=-g

ifeq ($(UNAME),Darwin)

ifdef APPLE_NATIVE_GLUT
CXXFLAGS=-DAPPLE_NATIVE_GLUT
LDFLAGS=-framework GLUT -framework OpenGL -framework Cocoa
else
CXXFLAGS=-I/usr/X11/include
LDFLAGS=-L/usr/X11/lib -lGLU -lglut -lGL
endif

else
LDFLAGS=-lGLU -lglut
endif

SOURCES=Cell.cpp Field.cpp Controller.cpp Game.cpp MainWindow.cpp KeyboardController.cpp Player.cpp AIController.cpp TrollTron.cpp
OBJECTS=$(SOURCES:.cpp=.o)
MAIN=trolltron

all: $(MAIN)

$(MAIN): $(OBJECTS)
	$(CC) -o $(MAIN) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS)

.o:
	$(CC) $(CXXFLAGS) $< -o $@

clean:
	rm -f *.o $(MAIN)