3 LIBSDL := `sdl-config --libs`
4 LIBS := ${LIBSDL} ${LIBGL}
8 PRFFLAGS := ${DBGFLAGS} -pg
11 CXXFLAGS := -Wall -pedantic -ansi ${DBGFLAGS}
13 TARGET := ../run_physics
15 SRCS := # simply to keep every line below the same
21 SRCS += handleSignal.cpp
23 SRCS += entityManager.cpp
24 SRCS += effectManager.cpp
25 SRCS += entityCreator.cpp
26 SRCS += collisionHandler.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/Screen.cpp
47 SRCS += input/inputManager.cpp
49 SRCS += graphics/graphics.cpp
51 OBJS := ${SRCS:.cpp=.o}
52 DEPENDS := ${SRCS:.cpp=.d}
54 HRDS := ${SRCS:.cpp=.h}
55 HRDS := ${HRDS:main.h=} # remove main.h
58 HRDS += graphics/colors.h
60 TARS := ${SRCS} ${HRDS} Makefile
66 # quiet the echo command
68 # quiet the command that is `replaced' by an echo
71 # EAT the echo command as if it was not there
72 Q1 := @true # NOTE: the space between @true and the # is VERY important!!
73 # do not quiet the command output
81 ${Q1}echo "${CXX}: $@"
82 ${Q2}${CXX} ${CXXFLAGS} -o ${TARGET} $^ ${LIBS}
84 # rule to make a depend file from a .cpp
87 ${Q2}${CXX} -M ${CXXFLAGS} $< | sed 's,: , $@: ,' > $@
89 # rule to make an object file from a .cpp
91 ${Q1}echo "${CXX}: $@"
92 ${Q2}${CXX} ${CXXFLAGS} -c -o $@ $<
97 ${Q1}echo "CLEAN: OBJS"
99 ${Q1}echo "CLEAN: TARGET"
104 ${Q1}echo "CLEAN: DEPENDS"
105 ${Q2}rm -f ${DEPENDS}
106 ${Q1}echo "CLEAN: tags prof gmon.out"
107 ${Q2}rm -f tags prof gmon.out
114 ${Q1}echo "tar: physics.tar.bz2"
115 ${Q2}rm -f physics.tar # prevents appending
116 ${Q2}for f in ${TARS}; do\
117 tar -C ../.. -rf physics.tar "physics/src/$$f"; done
118 ${Q2}bzip2 physics.tar
122 ${Q1}echo "git-archive: ../physics.tar.bz2"
123 ${Q2}cd ..; git-archive --prefix=physics/ HEAD | bzip2 > physics.tar.bz2
135 valgrind --leak-check=full ${TARGET}
140 gprof -b ${TARGET} > prof