prof and valgrind options added to Makefile
[physics.git] / src / Makefile
... / ...
CommitLineData
1
2LIBGL := -lGL -lGLU
3LIBSDL := `sdl-config --libs`
4LIBS := ${LIBSDL} ${LIBGL}
5
6OPTFLAGS := -O2
7DBGFLAGS := -ggdb
8PRFFLAGS := ${DBGFLAGS} -pg
9
10#CXX := g++
11CXXFLAGS := -Wall -pedantic -ansi ${DBGFLAGS}
12
13
14SRCS := entityManager.cpp
15SRCS += game.cpp
16SRCS += main.cpp
17SRCS += mathw.cpp
18SRCS += ticks.cpp
19SRCS += Vector2.cpp
20
21SRCS += Entities/Ball.cpp
22SRCS += Entities/Entity.cpp
23SRCS += Entities/Line.cpp
24SRCS += Entities/Particle.cpp
25SRCS += Entities/PhysicsEntity.cpp
26SRCS += Entities/Point.cpp
27SRCS += Entities/Polygon.cpp
28SRCS += Entities/WindParticle.cpp
29
30SRCS += GameStates/CreatingPolygon.cpp
31SRCS += GameStates/GameState.cpp
32SRCS += GameStates/Paused.cpp
33SRCS += GameStates/Running.cpp
34
35SRCS += input/inputManager.cpp
36
37SRCS += graphics/graphics.cpp
38
39OBJS := ${SRCS:.cpp=.o}
40
41
42TARGET := ../run_physics
43DEPEND := depend.mk
44
45
46.PHONY: all
47all: ${TARGET}
48
49${TARGET}: ${OBJS}
50 ${CXX} ${CXXFLAGS} -o ${TARGET} $^ ${LIBS}
51
52.PHONY: depend
53depend: ${SRCS}
54 ${CXX} -MM $^ > ${DEPEND}
55
56
57.PHONY: clean
58clean:
59 rm -f ${OBJS} ${TARGET} *~ prof gmon.out
60
61.PHONY: distclean
62distclean: clean
63 rm -f tags depend.mk
64 touch depend.mk
65
66tags: ${SRCS}
67 ctags $^
68
69tar: clean
70 cd ..; tar -cjf physics.tar.bz2 src/
71
72
73.PHONY: run
74run: all
75 ${TARGET}
76
77.PHONY: val
78val: all
79 valgrind ${TARGET}
80
81.PHONY: prof
82prof: all
83 ${TARGET}
84 gprof -b ${TARGET} > prof
85 kprof -f prof
86
87include ${DEPEND}