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.

23 lines
1.1 KiB

5 years ago
5 years ago
5 years ago
  1. OUTPUT_DIR= bin
  2. COMPILER = g++
  3. COMPILER_FLAGS=-w
  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 | client_driver | server_driver
  11. game: $(SOURCE_DIR)game.cpp | make_dir
  12. $(COMPILER) $(INCLUDES_DIR) $(SOURCE_DIR)game.cpp $(COMPILER_FLAGS) $(LINKER_FLAGS) -o $(OUTPUT_DIR)/game.out
  13. client_lib: $(SOURCE_DIR)client.cpp | make_dir
  14. $(COMPILER) $(LIBRARY_FLAGS) $(INCLUDES_DIR) $(SOURCE_DIR)client.cpp -lpqxx -o $(CLIENT_LIB)
  15. client_driver: $(SOURCE_DIR)client_driver.cpp | client_lib
  16. $(COMPILER) $(INCLUDES_DIR) $(CLIENT_LIB) $(SOURCE_DIR)client_driver.cpp $(COMPILER_FLAGS) $(LINKER_FLAGS) -o $(OUTPUT_DIR)/client.out
  17. server_lib: $(SOURCE_DIR)server.cpp | make_dir
  18. $(COMPILER) $(LIBRARY_FLAGS) $(INCLUDES_DIR) $(SOURCE_DIR)server.cpp -lpqxx -o $(SERVER_LIB)
  19. server_driver: $(SOURCE_DIR)server_driver.cpp | server_lib
  20. $(COMPILER) $(INCLUDES_DIR) $(SERVER_LIB) $(SOURCE_DIR)server_driver.cpp $(COMPILER_FLAGS) $(LINKER_FLAGS) -o $(OUTPUT_DIR)/server.out
  21. make_dir:
  22. mkdir -p $(OUTPUT_DIR)