3 LIBSDL := `sdl-config --libs`
4 LIBS := ${LIBSDL} ${LIBGL}
8 PRFFLAGS := ${DBGFLAGS} -pg
9 VALFLAGS := --leak-check=full
12 CXXFLAGS := -Wall -pedantic -ansi ${DBGFLAGS}
14 TARGET := ../run_physics
16 SRCS := # simply to keep every line below the same
22 SRCS += handleSignal.cpp
24 SRCS += entityManager.cpp
25 SRCS += effectManager.cpp
26 SRCS += entityCreator.cpp
27 SRCS += collisionHandler.cpp
28 SRCS += CollisionInfo.cpp
30 SRCS += Entities/Ball.cpp
31 SRCS += Entities/Entity.cpp
32 SRCS += Entities/Line.cpp
33 SRCS += Entities/Particle.cpp
34 SRCS += Entities/PhysicsEntity.cpp
35 SRCS += Entities/Point.cpp
36 SRCS += Entities/Polygon.cpp
37 SRCS += Entities/WindParticle.cpp
39 SRCS += GameStates/CreatingPolygon.cpp
40 SRCS += GameStates/GameState.cpp
41 SRCS += GameStates/Paused.cpp
42 SRCS += GameStates/Running.cpp
44 SRCS += Effects/Effect.cpp
45 SRCS += Effects/Gravity.cpp
46 SRCS += Effects/Screen.cpp
48 SRCS += input/inputManager.cpp
50 SRCS += graphics/graphics.cpp
53 OBJS := ${SRCS:.cpp=.o}
54 OBJS := $(addprefix ${OBJSDIR},${OBJS})
57 DEPS := ${SRCS:.cpp=.d}
58 DEPS := $(addprefix ${DEPSDIR},${DEPS})
60 HRDS := ${SRCS:.cpp=.h}
61 HRDS := ${HRDS:main.h=} # remove main.h
64 HRDS += graphics/colors.h
66 TARS := ${SRCS} ${HRDS} Makefile
72 # quiet the echo command
74 # quiet the command that is `replaced' by an echo
77 # EAT the echo command as if it was not there
78 Q1 := @true # NOTE: the space between @true and the # is VERY important!!
79 # do not quiet the command output
87 ${Q1}echo "${CXX}: $@"
88 ${Q2}${CXX} ${CXXFLAGS} -o $@ $^ ${LIBS}
90 # rule to make a depend file from a .cpp
93 ${Q2}${CXX} -M ${CXXFLAGS} $< | sed 's,: , $@: ,' > $@
95 # rule to make an object file from a .cpp
97 ${Q1}echo "${CXX}: $@"
98 ${Q2}${CXX} ${CXXFLAGS} -c -o $@ $<
103 ${Q1}echo "CLEAN: OBJS"
105 ${Q1}echo "CLEAN: TARGET"
110 ${Q1}echo "CLEAN: DEPS"
112 ${Q1}echo "CLEAN: tags prof gmon.out"
113 ${Q2}rm -f tags prof gmon.out
119 tar: ../physics.tar.bz2
121 .PHONY: ../physics.tar.bz2
123 @echo "git-archive: Warning, archives HEAD not current"
124 ${Q1}echo "git-archive: ../physics.tar.bz2"
125 ${Q2}cd ..; git-archive --prefix=physics/ HEAD | bzip2 > physics.tar.bz2
137 valgrind ${VALFLAGS} ${TARGET}
142 gprof -b ${TARGET} > prof