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
|
MACHINE= $(shell uname -s)
OBJFILES := $(patsubst %.cpp,%.o,$(sort $(wildcard *.cpp)))
ifeq ($(MACHINE),Darwin)
INCLUDES = -I/Library/Frameworks/SDL.framework/Headers -I/Library/Frameworks/SDL_image.framework/Headers -I/Library/Frameworks/SDL_mixer.framework/Headers -I/Library/Frameworks/SDL_ttf.framework/Headers -I/System/Library/Frameworks/OpenGL.framework/Headers
LIBS = -m32 -framework SDL -framework SDL_image -framework SDL_mixer -framework SDL_ttf -framework Cocoa -framework OpenGL
# SDL isn't in a great state on 64-bit Macs, so force 32-bit for now
CXXFLAGS = -g -c -m32 -Wno-deprecated
# to compile on OS X you need to include this Objective C file
OSXCOMPAT = SDLMain.m
else
INCLUDES = `sdl-config --cflags` -I/usr/X11R6/include
LIBS = `sdl-config --libs` -lGL -lGLU -lSDL_mixer -lSDL_ttf -lSDL_gfx -lSDL_image
CXXFLAGS += -g -c -Wno-deprecated
OSXCOMPAT =
endif
# enable c++11
CXXFLAGS += -std=c++11
# object files have corresponding source files
CXX = g++
all: brainparty
brainparty: $(OBJFILES)
$(CXX) $(LDFLAGS) $(OBJFILES) $(INCLUDES) $(LIBS) $(OSXCOMPAT) -o brainparty
%.o: %.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -o $@ $<
clean:
rm -f brainparty *.o
|