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