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