CXX := g++ LINKER := g++ SRCDIR := ./src BINDIR := ./build EXE := $(BINDIR)/blackshades CXXFLAGS := -O2 -Wall -g -I$(SRCDIR) LDFLAGS := -lSDL -lGL -lGLU -lopenal -lalut -lvorbisfile 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)