You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
1.2 KiB

5 years ago
5 years ago
5 years ago
5 years ago
  1. OUTPUT_DIR= bin
  2. COMPILER = g++
  3. COMPILER_FLAGS=-w -std=c++11
  4. SOURCE_DIR = source/
  5. INCLUDES_DIR =-I includes/
  6. LINKER_FLAGS =-lSDL2 -lGL -lGLU -lpthread
  7. LIBRARY_FLAGS= -std=c++11 -c -fPIC -shared
  8. SERVER_LIB=$(OUTPUT_DIR)/server.so
  9. CLIENT_LIB=$(OUTPUT_DIR)/client.so
  10. all: game | driver
  11. driver: client_driver | server_driver
  12. game: $(SOURCE_DIR)game.cpp | make_dir
  13. $(COMPILER) $(INCLUDES_DIR) $(SOURCE_DIR)game.cpp $(COMPILER_FLAGS) $(LINKER_FLAGS) -o $(OUTPUT_DIR)/game.out
  14. client_lib: $(SOURCE_DIR)client.cpp | make_dir
  15. $(COMPILER) $(LIBRARY_FLAGS) $(INCLUDES_DIR) $(SOURCE_DIR)client.cpp -lpqxx -o $(CLIENT_LIB)
  16. client_driver: $(SOURCE_DIR)client_driver.cpp | client_lib
  17. $(COMPILER) $(INCLUDES_DIR) $(CLIENT_LIB) $(SOURCE_DIR)client_driver.cpp $(COMPILER_FLAGS) $(LINKER_FLAGS) -o $(OUTPUT_DIR)/client.out
  18. server_lib: $(SOURCE_DIR)server.cpp | make_dir
  19. $(COMPILER) $(LIBRARY_FLAGS) $(INCLUDES_DIR) $(SOURCE_DIR)server.cpp -lpqxx -o $(SERVER_LIB)
  20. server_driver: $(SOURCE_DIR)server_driver.cpp | server_lib
  21. $(COMPILER) $(INCLUDES_DIR) $(SERVER_LIB) $(SOURCE_DIR)server_driver.cpp $(COMPILER_FLAGS) $(LINKER_FLAGS) -o $(OUTPUT_DIR)/server.out
  22. make_dir:
  23. mkdir -p $(OUTPUT_DIR)