3 LIBSDL := `sdl-config --libs`
4 LIBS := ${LIBSDL} ${LIBGL}
8 PRFFLAGS := ${DBGFLAGS} -pg
9 CXXFLAGS := -Wall -pedantic -ansi ${DBGFLAGS}
11 VALFLAGS := --leak-check=full
13 TARGET := ../run_physics
15 SRCS := # simply to keep every line below the same
21 SRCS += handleSignal.cpp
23 SRCS += entityCreator.cpp
24 SRCS += entityManager.cpp
25 SRCS += effectManager.cpp
26 SRCS += collisionManager.cpp
27 SRCS += CollisionInfo.cpp
29 SRCS += Entities/Ball.cpp
30 SRCS += Entities/Entity.cpp
31 SRCS += Entities/Line.cpp
32 SRCS += Entities/Particle.cpp
33 SRCS += Entities/PhysicsEntity.cpp
34 SRCS += Entities/Point.cpp
35 SRCS += Entities/Polygon.cpp
36 SRCS += Entities/WindParticle.cpp
38 SRCS += GameStates/CreatingPolygon.cpp
39 SRCS += GameStates/GameState.cpp
40 SRCS += GameStates/Paused.cpp
41 SRCS += GameStates/Running.cpp
43 SRCS += Effects/Effect.cpp
44 SRCS += Effects/Gravity.cpp
45 SRCS += Effects/GravityWell.cpp
46 SRCS += Effects/Screen.cpp
48 SRCS += config/config.cpp
49 SRCS += config/reader.cpp
51 SRCS += input/inputManager.cpp
53 SRCS += graphics/graphics.cpp
56 OBJS := ${SRCS:.cpp=.o}
57 OBJS := $(addprefix ${OBJSDIR},${OBJS})
60 DEPS := ${SRCS:.cpp=.d}
61 DEPS := $(addprefix ${DEPSDIR},${DEPS})
63 HRDS := ${SRCS:.cpp=.h}
64 HRDS := $(filter-out main.h,$HRDS) # remove main.h
67 HRDS += graphics/colors.h
69 TARS := ${SRCS} ${HRDS} Makefile
75 # quiet the echo command
77 # quiet the command that is `replaced' by an echo
80 # EAT the echo command as if it was not there
81 Q1 := @true # NOTE: the space between @true and the # is VERY important!!
82 # do not quiet the command output
90 ${Q1}echo "${CXX}: $@"
91 ${Q2}${CXX} ${CXXFLAGS} -o $@ $^ ${LIBS}
93 # rule to make a depend file from a .cpp
96 ${Q2}${CXX} -M ${CXXFLAGS} $< | sed 's,: , $@: ,' > $@
98 # rule to make an object file from a .cpp
100 ${Q1}echo "${CXX}: $@"
101 ${Q2}${CXX} ${CXXFLAGS} -c -o $@ $<
106 ${Q1}echo "CLEAN: OBJS"
108 ${Q1}echo "CLEAN: TARGET"
113 ${Q1}echo "CLEAN: DEPS"
115 ${Q1}echo "CLEAN: tags prof gmon.out"
116 ${Q2}rm -f tags prof gmon.out
120 ${Q1}echo "git-clean: show, use gitcleanf to force"
121 ${Q2}cd ..; git clean -nxd
125 ${Q1}echo "git-clean: forced"
126 ${Q2}cd ..; git clean -fxd
132 tar: ../physics.tar.bz2
134 .PHONY: ../physics.tar.bz2
136 @echo "git-archive: Warning, archives HEAD not current"
137 ${Q1}echo "git-archive: ../physics.tar.bz2"
138 ${Q2}cd ..; git-archive --prefix=physics/ HEAD | bzip2 > physics.tar.bz2
150 valgrind ${VALFLAGS} ${TARGET}
155 gprof -b ${TARGET} > prof