blob: 31607f75cb441b43c554ba261b0b2780611e9da1 (
plain) (
blame)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
CXX := g++
LINKER := g++
SRCDIR := ./src
BINDIR := ./build
EXE := $(BINDIR)/blackshades
CFLAGS := -O2 -Wall -g $(shell sdl-config --cflags) -I$(SRCDIR)
CXXFLAGS := $(CFLAGS)
LDFLAGS := $(shell sdl-config --libs) -lSDL_image -lGL -lGLU -lopenal -lalut
# Don't want ogg?
#CFLAGS += -DNOOGG
# Got ogg?
LDFLAGS += -lvorbisfile -lvorbis
SRCS := Camera.cpp \
Decals.cpp \
Fog.cpp \
Frustum.cpp \
GameDraw.cpp \
GameInitDispose.cpp \
GameLoop.cpp \
GameTick.cpp \
Globals.cpp \
MacInput.cpp \
Main.cpp \
Models.cpp \
Person.cpp \
Quaternions.cpp \
Serialize.cpp \
Skeleton.cpp \
Sprites.cpp \
Support.cpp \
TGALoader.cpp \
Text.cpp \
Timer.cpp \
Textures.cpp
OBJS := $(foreach f,$(SRCS:.cpp=.o),$(BINDIR)/$(f))
SRCS := $(foreach f,$(SRCS),$(SRCDIR)/$(f))
CLEANUP = $(wildcard *.exe) $(wildcard *.obj) \
$(wildcard $(BINDIR)/*.exe) $(wildcard $(BINDIR)/*.obj) \
$(wildcard *~) $(wildcard *.err) \
$(wildcard .\#*) $(EXE)
# Rules for compiling individual source files...
$(BINDIR)/%.o: $(SRCDIR)/%.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS)
.PHONY: all clean
all: $(EXE)
$(EXE): $(BINDIR) $(OBJS)
$(LINKER) -o $(EXE) $(OBJS) $(LDFLAGS)
$(BINDIR):
mkdir -p $(BINDIR)
make $(BINDIR)
clean:
rm -f $(CLEANUP)
rm -rf $(BINDIR)
|