LIBGL := -lGL -lGLU LIBSDL := `sdl-config --libs` LIBS := ${LIBSDL} ${LIBGL} OPTFLAGS := -O2 DBGFLAGS := -ggdb PRFFLAGS := ${DBGFLAGS} -pg #CXX := g++ CXXFLAGS := -Wall -pedantic -ansi ${DBGFLAGS} SRCS := entityManager.cpp SRCS += game.cpp SRCS += main.cpp SRCS += mathw.cpp SRCS += ticks.cpp SRCS += Vector2.cpp SRCS += Entities/Ball.cpp SRCS += Entities/Entity.cpp SRCS += Entities/Line.cpp SRCS += Entities/Particle.cpp SRCS += Entities/PhysicsEntity.cpp SRCS += Entities/Point.cpp SRCS += Entities/Polygon.cpp SRCS += Entities/WindParticle.cpp SRCS += GameStates/CreatingPolygon.cpp SRCS += GameStates/GameState.cpp SRCS += GameStates/Paused.cpp SRCS += GameStates/Running.cpp SRCS += input/inputManager.cpp SRCS += graphics/graphics.cpp OBJS := ${SRCS:.cpp=.o} TARGET := ../run_physics DEPENDS := ${SRCS:.cpp=.d} .PHONY: all all: ${TARGET} ${TARGET}: ${OBJS} ${CXX} ${CXXFLAGS} -o ${TARGET} $^ ${LIBS} @echo "" # how to make a depend file from a source file %.d: %.cpp @echo "DEP: $@" @${CXX} -M ${CXXFLAGS} $< | sed 's,: , $@: ,' > $@ #@${CXX} -M ${CXXFLAGS} $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@ .PHONY: clean clean: rm -f ${OBJS} ${TARGET} .PHONY: distclean distclean: clean rm -f ${DEPENDS} tags prof gmon.out tags: ${SRCS} ctags $^ tar: clean cd ..; tar -cjf physics.tar.bz2 src/ .PHONY: run run: all ${TARGET} .PHONY: val val: all valgrind ${TARGET} .PHONY: prof prof: all ${TARGET} gprof -b ${TARGET} > prof kprof -f prof -include ${DEPENDS}