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
52 OBJS := ${SRCS:.cpp=.o}
53 DEPENDS := ${SRCS:.cpp=.d}
55 HRDS := ${SRCS:.cpp=.h}
56 HRDS := ${HRDS:main.h=} # remove main.h
59 HRDS += graphics/colors.h
61 TARS := ${SRCS} ${HRDS} Makefile
67 # quiet the echo command
69 # quiet the command that is `replaced' by an echo
72 # EAT the echo command as if it was not there
73 Q1 := @true # NOTE: the space between @true and the # is VERY important!!
74 # do not quiet the command output
82 ${Q1}echo "${CXX}: $@"
83 ${Q2}${CXX} ${CXXFLAGS} -o ${TARGET} $^ ${LIBS}
85 # rule to make a depend file from a .cpp
88 ${Q2}${CXX} -M ${CXXFLAGS} $< | sed 's,: , $@: ,' > $@
90 # rule to make an object file from a .cpp
92 ${Q1}echo "${CXX}: $@"
93 ${Q2}${CXX} ${CXXFLAGS} -c -o $@ $<
98 ${Q1}echo "CLEAN: OBJS"
100 ${Q1}echo "CLEAN: TARGET"
105 ${Q1}echo "CLEAN: DEPENDS"
106 ${Q2}rm -f ${DEPENDS}
107 ${Q1}echo "CLEAN: tags prof gmon.out"
108 ${Q2}rm -f tags prof gmon.out
115 ${Q1}echo "tar: physics.tar.bz2"
116 ${Q2}rm -f physics.tar # prevents appending
117 ${Q2}for f in ${TARS}; do\
118 tar -C ../.. -rf physics.tar "physics/src/$$f"; done
119 ${Q2}bzip2 physics.tar
123 ${Q1}echo "git-archive: ../physics.tar.bz2"
124 ${Q2}cd ..; git-archive --prefix=physics/ HEAD | bzip2 > physics.tar.bz2
136 valgrind ${VALFLAGS} ${TARGET}
141 gprof -b ${TARGET} > prof