Make updated
[physics.git] / src / Makefile
index c25ab1b..d830a80 100644 (file)
@@ -1,5 +1,4 @@
 
-LIBALLG = `allegro-config --libs release`
 LIBGL = -lGL -lGLU
 LIBSDL = `sdl-config --libs`
 LIBS = ${LIBSDL} ${LIBGL}
@@ -7,47 +6,64 @@ LIBS = ${LIBSDL} ${LIBGL}
 CXX = g++
 CXXFLAGS = -ggdb -Wall -pedantic
 
-SRCS = Vector2.cpp ticks.cpp main.cpp game.cpp entityManager.cpp gldraw.cpp graphics.cpp
+SRCS := entityManager.cpp
+SRCS += game.cpp
+SRCS += graphics.cpp
+SRCS += main.cpp
+SRCS += mathw.cpp
+SRCS += ticks.cpp
+SRCS += Vector2.cpp
+
+SRCS += Entities/Ball.cpp
+SRCS += Entities/Entity.cpp
+SRCS += Entities/Line.cpp
+SRCS += Entities/Particle.cpp
+SRCS += Entities/PhysicsEntity.cpp
+SRCS += Entities/Point.cpp
+SRCS += Entities/Polygon.cpp
+SRCS += Entities/WindParticle.cpp
+
+SRCS += GameStates/CreatingPolygon.cpp
+SRCS += GameStates/GameState.cpp
+SRCS += GameStates/Paused.cpp
+SRCS += GameStates/Running.cpp
+
 OBJS = ${SRCS:.cpp=.o}
 
-TARGETS = ../run_physics
+TARGET = ../run_physics
 DEPEND = depend.mk
 
-# set suffixes to look for ...
-.SUFFIXES: .cpp .o
 
-# set default action for a *.cc to create a *.o
-.cpp.o:
-       g++ -c $< ${CXXFLAGS}
+.PHONY: all
+all: ${TARGET}
 
-all: ${TARGETS}
+${TARGET}: ${OBJS}
+       ${CXX} ${CXXFLAGS} -o ${TARGET} $^ ${LIBS}
 
-depend:
-       ${CXX} -MM ${SRCS} > ${DEPEND}
+.PHONY: depend
+depend: ${SRCS}
+       ${CXX} -MM $^ > ${DEPEND}
 
-tags:
-       ctags ${SRCS}
 
+.PHONY: clean
 clean:
-       rm -f ${OBJS} ${TARGETS} *~
+       rm -f ${OBJS} ${TARGET} *~
 
+.PHONY: distclean
 distclean: clean
        rm -f tags depend.mk
        touch depend.mk
 
-# i need to find a nice way of ijnoring .svn folders for the below
+tags: ${SRCS}
+       ctags $^
+
 tar: clean
        cd ..; tar -cjf bluestar.tar.bz2 images/ source/
 
 
-run: ../run_physics
-       cd ..; ./run_physics
-
-../run_physics: ${OBJS}
-       ${CXX} ${CXXFLAGS} -o ../run_physics ${OBJS} ${LIBS}
-
-Entities.d:
-       cd Entities; make
+.PHONY: run
+run: all
+       ../${TARGET}
 
 include ${DEPEND}