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
16 SRCS += entityManager.cpp
17 SRCS += effectManager.cpp
18 SRCS += entityCreator.cpp
24 SRCS += handleSignal.cpp
26 SRCS += Entities/Ball.cpp
27 SRCS += Entities/Entity.cpp
28 SRCS += Entities/Line.cpp
29 SRCS += Entities/Particle.cpp
30 SRCS += Entities/PhysicsEntity.cpp
31 SRCS += Entities/Point.cpp
32 SRCS += Entities/Polygon.cpp
33 SRCS += Entities/WindParticle.cpp
35 SRCS += GameStates/CreatingPolygon.cpp
36 SRCS += GameStates/GameState.cpp
37 SRCS += GameStates/Paused.cpp
38 SRCS += GameStates/Running.cpp
40 SRCS += Effects/Effect.cpp
41 SRCS += Effects/Gravity.cpp
43 SRCS += input/inputManager.cpp
45 SRCS += graphics/graphics.cpp
47 OBJS := ${SRCS:.cpp=.o}
48 DEPENDS := ${SRCS:.cpp=.d}
50 HRDS := ${SRCS:.cpp=.h}
51 HRDS := ${HRDS:main.h=} # remove main.h
54 HRDS += graphics/colors.h
56 TARS := ${SRCS} ${HRDS} Makefile
62 # quiet the echo command
64 # quiet the command that is `replaced' by an echo
67 # EAT the echo command as if it was not there
68 Q1 := @true # NOTE: the space between @true and the # is VERY important!!
69 # do not quiet the command output
77 ${Q1}echo "${CXX}: $@"
78 ${Q2}${CXX} ${CXXFLAGS} -o ${TARGET} $^ ${LIBS}
80 # rule to make a depend file from a .cpp
83 ${Q2}${CXX} -M ${CXXFLAGS} $< | sed 's,: , $@: ,' > $@
85 # rule to make an object file from a .cpp
87 ${Q1}echo "${CXX}: $@"
88 ${Q2}${CXX} ${CXXFLAGS} -c -o $@ $<
93 ${Q1}echo "CLEAN: OBJS"
95 ${Q1}echo "CLEAN: TARGET"
100 ${Q1}echo "CLEAN: DEPENDS"
101 ${Q2}rm -f ${DEPENDS}
102 ${Q1}echo "CLEAN: tags prof gmon.out"
103 ${Q2}rm -f tags prof gmon.out
109 ${Q1}echo "tar: physics.tar.bz2"
110 ${Q2}rm -f physics.tar # prevents appending
111 ${Q2}for f in ${TARS}; do\
112 tar -C ../.. -rf physics.tar "physics/src/$$f"; done
113 ${Q2}bzip2 physics.tar
116 ${Q1}echo "git-archive: ../physics.tar.bz2"
117 ${Q2}cd ..; git-archive --prefix=physics/ HEAD | bzip2 > physics.tar.bz2
129 valgrind --leak-check=full ${TARGET}
134 gprof -b ${TARGET} > prof