CC=g++
CFLAGS=-g -Wall
OBJS=Survivor.o ArrayGame.o LinkedGame.o

all:  Survivor

# rule for building the executable
Survivor: $(OBJS)
	$(CC) -o Survivor $(OBJS)

# list of file dependencies
Survivor.o: Game.h ArrayGame.h LinkedGame.h
ArrayGame.o: Game.h ArrayGame.h
LinkedGame.o: Game.h LinkedGame.h

# the following rule is used to compile .cpp files to .o
.cpp.o:
	$(CC) $(CFLAGS) -c $<


# the following removes all .o files, but leaves the executable
clean:
	rm -f *.o