moved items that a normal make doesn't create to distclean
[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 42TARGET := ../run_physics
466ce08d 43DEPENDS := ${SRCS:.cpp=.d}
ad9f1fb6 44
ad9f1fb6 45
046b034c
PG
46.PHONY: all
47all: ${TARGET}
ad9f1fb6 48
046b034c
PG
49${TARGET}: ${OBJS}
50 ${CXX} ${CXXFLAGS} -o ${TARGET} $^ ${LIBS}
466ce08d 51 @echo ""
ad9f1fb6 52
466ce08d
PG
53# how to make a depend file from a source file
54%.d: %.cpp
55 @echo "DEP: $@"
56 @${CXX} -M ${CXXFLAGS} $< | sed 's,: , $@: ,' > $@
57
58#@${CXX} -M ${CXXFLAGS} $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@
ad9f1fb6 59
ad9f1fb6 60
046b034c 61.PHONY: clean
ad9f1fb6 62clean:
1fdcf18d 63 rm -f ${OBJS} ${TARGET}
ad9f1fb6 64
046b034c 65.PHONY: distclean
ad9f1fb6 66distclean: clean
1fdcf18d 67 rm -f ${DEPENDS} tags prof gmon.out
ad9f1fb6 68
046b034c
PG
69tags: ${SRCS}
70 ctags $^
71
ad9f1fb6 72tar: clean
63a52c99 73 cd ..; tar -cjf physics.tar.bz2 src/
ad9f1fb6
PG
74
75
046b034c
PG
76.PHONY: run
77run: all
27b74820 78 ${TARGET}
ad9f1fb6 79
63a52c99
PG
80.PHONY: val
81val: all
82 valgrind ${TARGET}
83
84.PHONY: prof
85prof: all
86 ${TARGET}
87 gprof -b ${TARGET} > prof
88 kprof -f prof
ad9f1fb6 89
466ce08d 90-include ${DEPENDS}