projects
/
physics.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
moved items that a normal make doesn't create to distclean
[physics.git]
/
src
/
Makefile
diff --git
a/src/Makefile
b/src/Makefile
index
7ef5006
..
885bc9e
100644
(file)
--- a/
src/Makefile
+++ b/
src/Makefile
@@
-1,14
+1,18
@@
-LIBGL = -lGL -lGLU
-LIBSDL = `sdl-config --libs`
-LIBS = ${LIBSDL} ${LIBGL}
+LIBGL := -lGL -lGLU
+LIBSDL := `sdl-config --libs`
+LIBS := ${LIBSDL} ${LIBGL}
+
+OPTFLAGS := -O2
+DBGFLAGS := -ggdb
+PRFFLAGS := ${DBGFLAGS} -pg
+
+#CXX := g++
+CXXFLAGS := -Wall -pedantic -ansi ${DBGFLAGS}
-CXX = g++
-CXXFLAGS = -ggdb -Wall -pedantic
SRCS := entityManager.cpp
SRCS += game.cpp
SRCS := entityManager.cpp
SRCS += game.cpp
-SRCS += graphics.cpp
SRCS += main.cpp
SRCS += mathw.cpp
SRCS += ticks.cpp
SRCS += main.cpp
SRCS += mathw.cpp
SRCS += ticks.cpp
@@
-28,10
+32,15
@@
SRCS += GameStates/GameState.cpp
SRCS += GameStates/Paused.cpp
SRCS += GameStates/Running.cpp
SRCS += GameStates/Paused.cpp
SRCS += GameStates/Running.cpp
-OBJS = ${SRCS:.cpp=.o}
+SRCS += input/inputManager.cpp
+
+SRCS += graphics/graphics.cpp
+
+OBJS := ${SRCS:.cpp=.o}
-TARGET = ../run_physics
-DEPEND = depend.mk
+
+TARGET := ../run_physics
+DEPENDS := ${SRCS:.cpp=.d}
.PHONY: all
.PHONY: all
@@
-39,31
+48,43
@@
all: ${TARGET}
${TARGET}: ${OBJS}
${CXX} ${CXXFLAGS} -o ${TARGET} $^ ${LIBS}
${TARGET}: ${OBJS}
${CXX} ${CXXFLAGS} -o ${TARGET} $^ ${LIBS}
+ @echo ""
+
+# how to make a depend file from a source file
+%.d: %.cpp
+ @echo "DEP: $@"
+ @${CXX} -M ${CXXFLAGS} $< | sed 's,: , $@: ,' > $@
-.PHONY: depend
-depend: ${SRCS}
- ${CXX} -MM $^ > ${DEPEND}
+#@${CXX} -M ${CXXFLAGS} $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@
.PHONY: clean
clean:
.PHONY: clean
clean:
- rm -f ${OBJS} ${TARGET}
*~
+ rm -f ${OBJS} ${TARGET}
.PHONY: distclean
distclean: clean
.PHONY: distclean
distclean: clean
- rm -f tags depend.mk
- touch depend.mk
+ rm -f ${DEPENDS} tags prof gmon.out
tags: ${SRCS}
ctags $^
tar: clean
tags: ${SRCS}
ctags $^
tar: clean
- cd ..; tar -cjf
bluestar.tar.bz2 images/ source
/
+ cd ..; tar -cjf
physics.tar.bz2 src
/
.PHONY: run
run: all
${TARGET}
.PHONY: run
run: all
${TARGET}
-include ${DEPEND}
+.PHONY: val
+val: all
+ valgrind ${TARGET}
+
+.PHONY: prof
+prof: all
+ ${TARGET}
+ gprof -b ${TARGET} > prof
+ kprof -f prof
+-include ${DEPENDS}