# Rule for building a .o file from a .cpp source file -------
.SUFFIXES: .cpp
.cpp.o:
	c++ -c $(CXXFLAGS) $<

# Compile with debug option and all warnings on. ------------
CXXFLAGS = -g -Wall 

# Object modules comprising this application ----------------
OBJ = main.o game.o board.o rstrings.o ssstore.o tools.o words.o

game: $(OBJ)
	c++  -o game $(CXXFLAGS) $(OBJ)

# Delete .o and exe files and force recompilation. ----------
clean:
	rm -f $(OBJ) game

# Dependencies ----------------------------------------------
board.o: board.cpp board.hpp words.hpp tools.hpp
game.o: game.cpp game.hpp rstrings.hpp tools.hpp ssstore.hpp board.hpp \
 words.hpp
main.o: main.cpp tools.hpp game.hpp rstrings.hpp ssstore.hpp board.hpp \
 words.hpp
rstrings.o: rstrings.cpp tools.hpp rstrings.hpp ssstore.hpp
ssstore.o: ssstore.cpp tools.hpp ssstore.hpp
tools.o: tools.cpp tools.hpp
words.o: words.cpp tools.hpp words.hpp
