Makefile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. VERSION = -std=c++14
  2. CFLAGS = $(shell pkg-config --cflags glfw3)
  3. LDFLAGS = $(shell pkg-config --static --libs glfw3) -lGL -lGLEW -lpng
  4. all: game
  5. run_client: game_client
  6. vblank_mode=0 optirun ./game_client
  7. game_client: MainClient.cpp\
  8. Clock.o DirectRenderer.o KeyManager.o Mesh.o MouseManager.o Shader.o Texture.o Utils.o Wrapper.o\
  9. Matrix3D.o Matrix3DStack.o StackOverflow.o StackUnderflow.o Vector3D.o\
  10. Client.o\
  11. Chunk.o World.o
  12. g++ $(VERSION) -o $@ MainClient.cpp *.o $(LDFLAGS)
  13. # ------------------------------------------------------------------------------
  14. # Engine
  15. # ------------------------------------------------------------------------------
  16. Clock.o: engine/Clock.cpp engine/Clock.h
  17. g++ $(VERSION) -c engine/Clock.cpp -o $@
  18. DirectRenderer.o: engine/DirectRenderer.cpp engine/DirectRenderer.h
  19. g++ $(VERSION) -c engine/DirectRenderer.cpp -o $@
  20. KeyManager.o: engine/KeyManager.cpp engine/KeyManager.h
  21. g++ $(VERSION) -c engine/KeyManager.cpp -o $@
  22. Mesh.o: engine/Mesh.cpp engine/Mesh.h
  23. g++ $(VERSION) -c engine/Mesh.cpp -o $@
  24. MouseManager.o: engine/MouseManager.cpp engine/MouseManager.h
  25. g++ $(VERSION) -c engine/MouseManager.cpp -o $@
  26. Shader.o: engine/Shader.cpp engine/Shader.h
  27. g++ $(VERSION) -c engine/Shader.cpp -o $@
  28. Texture.o: engine/Texture.cpp engine/Texture.h
  29. g++ $(VERSION) -c engine/Texture.cpp -o $@
  30. Utils.o: engine/Utils.cpp engine/Utils.h
  31. g++ $(VERSION) -c engine/Utils.cpp -o $@
  32. Wrapper.o: engine/Wrapper.cpp engine/Wrapper.h
  33. g++ $(VERSION) -c engine/Wrapper.cpp -o $@
  34. # ------------------------------------------------------------------------------
  35. # Client
  36. # ------------------------------------------------------------------------------
  37. Client.o: client/Client.h client/Client.cpp
  38. g++ $(VERSION) -c client/Client.cpp -o $@
  39. # ------------------------------------------------------------------------------
  40. # World
  41. # ------------------------------------------------------------------------------
  42. Chunk.o: world/Chunk.h world/Chunk.cpp
  43. g++ $(VERSION) -c world/Chunk.cpp -o $@
  44. World.o: world/World.h world/World.cpp
  45. g++ $(VERSION) -c world/World.cpp -o $@
  46. # ------------------------------------------------------------------------------
  47. # Math
  48. # ------------------------------------------------------------------------------
  49. Matrix3D.o: math/Matrix3D.h math/Matrix3D.cpp
  50. g++ $(VERSION) -c math/Matrix3D.cpp -o $@
  51. Matrix3DStack.o: math/Matrix3DStack.h math/Matrix3DStack.cpp
  52. g++ $(VERSION) -c math/Matrix3DStack.cpp -o $@
  53. StackOverflow.o: math/StackOverflow.h math/StackOverflow.cpp
  54. g++ $(VERSION) -c math/StackOverflow.cpp -o $@
  55. StackUnderflow.o: math/StackUnderflow.h math/StackUnderflow.cpp
  56. g++ $(VERSION) -c math/StackUnderflow.cpp -o $@
  57. Vector3D.o: math/Vector3D.h math/Vector3D.cpp
  58. g++ $(VERSION) -c math/Vector3D.cpp -o $@
  59. # ------------------------------------------------------------------------------
  60. # server
  61. # ------------------------------------------------------------------------------
  62. run_server: game_server
  63. ./game_server
  64. game_server: MainServer.cpp
  65. g++ $(VERSION) -o $@ MainServer.cpp
  66. # ------------------------------------------------------------------------------
  67. # clean
  68. # ------------------------------------------------------------------------------
  69. clean:
  70. rm -f game_server game_client *.o