+++ /dev/null
-
-LIBALLG = `allegro-config --libs release`
-LIBGL = -lGL -lGLU
-LIBSDL = `sdl-config --libs`
-LIBS = ${LIBSDL} ${LIBGL}
-
-CXX = g++
-CXXFLAGS = -ggdb -Wall -pedantic
-
-LDFLAGS = -lc
-
-SRCS = Ball.cpp Entity.cpp Line.cpp Particle.cpp PhysicsEntity.cpp \
- Point.cpp Polygon.cpp WindParticle.cpp
-OBJS = ${SRCS:.cpp=.o}
-
-TARGETS = Entity.ld
-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}
-
-all: ${TARGETS}
-
-depend:
- ${CXX} -MM ${SRCS} > ${DEPEND}
-
-tags:
- ctags ${SRCS}
-
-clean:
- rm -f ${OBJS} ${TARGETS} *~
-
-distclean: clean
- rm -f tags depend.mk
- touch depend.mk
-
-Entity.ld: ${OBJS}
-# ld -o Entity.ld ${LDFLAGS} ${OBJS}
-
-include ${DEPEND}
-
+++ /dev/null
-
-LIBALLG = `allegro-config --libs release`
-LIBGL = -lGL -lGLU
-LIBSDL = `sdl-config --libs`
-LIBS = ${LIBSDL} ${LIBGL}
-
-CXX = g++
-CXXFLAGS = -ggdb -Wall -pedantic
-
-LDFLAGS = -lc
-
-SRCS = GameState.cpp
-OBJS = ${SRCS:.cpp=.o}
-
-TARGETS = GameStates.ld
-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}
-
-all: ${TARGETS}
-
-depend:
- ${CXX} -MM ${SRCS} > ${DEPEND}
-
-tags:
- ctags ${SRCS}
-
-clean:
- rm -f ${OBJS} ${TARGETS} *~
-
-distclean: clean
- rm -f tags depend.mk
- touch depend.mk
-
-GameStates.ld: ${OBJS}
-# ld -o Entity.ld ${LDFLAGS} ${OBJS}
-
-include ${DEPEND}
-
-LIBALLG = `allegro-config --libs release`
LIBGL = -lGL -lGLU
LIBSDL = `sdl-config --libs`
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}