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 += entityCreator.cpp
23 SRCS += handleSignal.cpp
25 SRCS += Entities/Ball.cpp
26 SRCS += Entities/Entity.cpp
27 SRCS += Entities/Line.cpp
28 SRCS += Entities/Particle.cpp
29 SRCS += Entities/PhysicsEntity.cpp
30 SRCS += Entities/Point.cpp
31 SRCS += Entities/Polygon.cpp
32 SRCS += Entities/WindParticle.cpp
34 SRCS += GameStates/CreatingPolygon.cpp
35 SRCS += GameStates/GameState.cpp
36 SRCS += GameStates/Paused.cpp
37 SRCS += GameStates/Running.cpp
39 SRCS += input/inputManager.cpp
41 SRCS += graphics/graphics.cpp
43 OBJS := ${SRCS:.cpp=.o}
44 DEPENDS := ${SRCS:.cpp=.d}
46 HRDS := ${SRCS:.cpp=.h}
47 HRDS := ${HRDS:main.h=} # remove main.h
49 HRDS += graphics/colors.h
51 TARS := ${SRCS} ${HRDS} Makefile
57 # quiet the echo command
59 # quiet the command that is `replaced' by an echo
62 # EAT the echo command as if it was not there
63 Q1 := @true # NOTE: the space between @true and the # is VERY important!!
64 # do not quiet the command output
72 ${Q1}echo "${CXX}: $@"
73 ${Q2}${CXX} ${CXXFLAGS} -o ${TARGET} $^ ${LIBS}
75 # rule to make a depend file from a .cpp
78 ${Q2}${CXX} -M ${CXXFLAGS} $< | sed 's,: , $@: ,' > $@
80 # rule to make an object file from a .cpp
82 ${Q1}echo "${CXX}: $@"
83 ${Q2}${CXX} ${CXXFLAGS} -c -o $@ $<
88 ${Q1}echo "CLEAN: OBJS"
90 ${Q1}echo "CLEAN: TARGET"
95 ${Q1}echo "CLEAN: DEPENDS"
97 ${Q1}echo "CLEAN: tags prof gmon.out"
98 ${Q2}rm -f tags prof gmon.out
104 ${Q1}echo "tar: physics.tar.bz2"
105 ${Q2}rm -f physics.tar # prevents appending
106 ${Q2}for f in ${TARS}; do\
107 tar -C ../.. -rf physics.tar "physics/src/$$f"; done
108 ${Q2}bzip2 physics.tar
111 ${Q1}echo "git-archive: ../physics.tar.bz2"
112 ${Q2}cd ..; git-archive --prefix=physics/ HEAD | bzip2 > physics.tar.bz2
120 valgrind --leak-check=full ${TARGET}
125 gprof -b ${TARGET} > prof