set to ignore *.o files
[physics.git] / src / Makefile
1
2 LIBGL = -lGL -lGLU
3 LIBSDL = `sdl-config --libs`
4 LIBS = ${LIBSDL} ${LIBGL}
5
6 CXX = g++
7 CXXFLAGS = -ggdb -Wall -pedantic
8
9 SRCS := entityManager.cpp
10 SRCS += game.cpp
11 SRCS += graphics.cpp
12 SRCS += main.cpp
13 SRCS += mathw.cpp
14 SRCS += ticks.cpp
15 SRCS += Vector2.cpp
16
17 SRCS += Entities/Ball.cpp
18 SRCS += Entities/Entity.cpp
19 SRCS += Entities/Line.cpp
20 SRCS += Entities/Particle.cpp
21 SRCS += Entities/PhysicsEntity.cpp
22 SRCS += Entities/Point.cpp
23 SRCS += Entities/Polygon.cpp
24 SRCS += Entities/WindParticle.cpp
25
26 SRCS += GameStates/CreatingPolygon.cpp
27 SRCS += GameStates/GameState.cpp
28 SRCS += GameStates/Paused.cpp
29 SRCS += GameStates/Running.cpp
30
31 OBJS = ${SRCS:.cpp=.o}
32
33 TARGET = ../run_physics
34 DEPEND = depend.mk
35
36
37 .PHONY: all
38 all: ${TARGET}
39
40 ${TARGET}: ${OBJS}
41         ${CXX} ${CXXFLAGS} -o ${TARGET} $^ ${LIBS}
42
43 .PHONY: depend
44 depend: ${SRCS}
45         ${CXX} -MM $^ > ${DEPEND}
46
47
48 .PHONY: clean
49 clean:
50         rm -f ${OBJS} ${TARGET} *~
51
52 .PHONY: distclean
53 distclean: clean
54         rm -f tags depend.mk
55         touch depend.mk
56
57 tags: ${SRCS}
58         ctags $^
59
60 tar: clean
61         cd ..; tar -cjf bluestar.tar.bz2 images/ source/
62
63
64 .PHONY: run
65 run: all
66         ${TARGET}
67
68 include ${DEPEND}
69