school/cs142/lab10/Makefile

34 lines
646 B
Makefile
Raw Permalink Normal View History

2016-04-06 20:45:34 -07:00
CXXFLAGS= -Wall -g
OBJECTS=main.o arena.o Factory.o archer.o fighter.o util.o cleric.o robot.o
EXE=main
all: $(EXE)
$(EXE): main.o
$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@
main.o: main.cpp Factory.o arena.o fighter.o archer.o util.o cleric.o robot.o
Factory.o: Factory.cpp Factory.h
arena.o: arena.cpp arena.h
fighter.o: fighter.cpp fighter.h
archer.o: archer.cpp archer.h fighter.h
cleric.o: cleric.cpp cleric.h fighter.h
robot.o: robot.cpp robot.h fighter.h
util.o: util.cpp util.h
run: $(EXE)
@./$(EXE)
clean:
@rm -vf *.o
@rm -vf $(EXE)
debug: $(EXE)
gdb ./$(EXE)
valgrind: $(EXE)
valgrind --tool=memcheck --leak-check=yes ./$(EXE)