prof and valgrind options added to Makefile
[physics.git] / src / Makefile
CommitLineData
ad9f1fb6 1
44b079f8
PG
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}
ad9f1fb6 12
ad9f1fb6 13
046b034c
PG
14SRCS := entityManager.cpp
15SRCS += game.cpp
046b034c
PG
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
f7b3b2eb
PG
35SRCS += input/inputManager.cpp
36
44b079f8
PG
37SRCS += graphics/graphics.cpp
38
39OBJS := ${SRCS:.cpp=.o}
40
ad9f1fb6 41
44b079f8
PG
42TARGET := ../run_physics
43DEPEND := depend.mk
ad9f1fb6 44
ad9f1fb6 45
046b034c
PG
46.PHONY: all
47all: ${TARGET}
ad9f1fb6 48
046b034c
PG
49${TARGET}: ${OBJS}
50 ${CXX} ${CXXFLAGS} -o ${TARGET} $^ ${LIBS}
ad9f1fb6 51
046b034c
PG
52.PHONY: depend
53depend: ${SRCS}
54 ${CXX} -MM $^ > ${DEPEND}
ad9f1fb6 55
ad9f1fb6 56
046b034c 57.PHONY: clean
ad9f1fb6 58clean:
63a52c99 59 rm -f ${OBJS} ${TARGET} *~ prof gmon.out
ad9f1fb6 60
046b034c 61.PHONY: distclean
ad9f1fb6
PG
62distclean: clean
63 rm -f tags depend.mk
64 touch depend.mk
65
046b034c
PG
66tags: ${SRCS}
67 ctags $^
68
ad9f1fb6 69tar: clean
63a52c99 70 cd ..; tar -cjf physics.tar.bz2 src/
ad9f1fb6
PG
71
72
046b034c
PG
73.PHONY: run
74run: all
27b74820 75 ${TARGET}
ad9f1fb6 76
63a52c99
PG
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
ad9f1fb6 86
63a52c99 87include ${DEPEND}