Makefile 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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: run_client
  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\
  9. Texture.o Utils.o Wrapper.o ShaderProgram.o WorldShader.o FramebufferRectangle.o\
  10. SSAOShader.o SSAOBlurShader.o WorldPostShader.o OverlayShader.o\
  11. Matrix3D.o Matrix3DStack.o StackOverflow.o StackUnderflow.o Vector3D.o Plane3D.o Camera3D.o\
  12. Client.o\
  13. Block.o Blocks.o BlockAir.o\
  14. Face.o\
  15. Chunk.o World.o ChunkRenderer.o ClientChunkProvider.o
  16. g++ $(VERSION) -o $@ MainClient.cpp *.o $(LDFLAGS)
  17. # ------------------------------------------------------------------------------
  18. # Engine
  19. # ------------------------------------------------------------------------------
  20. Clock.o: engine/Clock.cpp engine/Clock.h
  21. g++ $(VERSION) -c engine/Clock.cpp -o $@
  22. DirectRenderer.o: engine/DirectRenderer.cpp engine/DirectRenderer.h
  23. g++ $(VERSION) -c engine/DirectRenderer.cpp -o $@
  24. KeyManager.o: engine/KeyManager.cpp engine/KeyManager.h
  25. g++ $(VERSION) -c engine/KeyManager.cpp -o $@
  26. Mesh.o: engine/Mesh.cpp engine/Mesh.h
  27. g++ $(VERSION) -c engine/Mesh.cpp -o $@
  28. MouseManager.o: engine/MouseManager.cpp engine/MouseManager.h
  29. g++ $(VERSION) -c engine/MouseManager.cpp -o $@
  30. Shader.o: engine/Shader.cpp engine/Shader.h
  31. g++ $(VERSION) -c engine/Shader.cpp -o $@
  32. Texture.o: engine/Texture.cpp engine/Texture.h
  33. g++ $(VERSION) -c engine/Texture.cpp -o $@
  34. Utils.o: engine/Utils.cpp engine/Utils.h
  35. g++ $(VERSION) -c engine/Utils.cpp -o $@
  36. Wrapper.o: engine/Wrapper.cpp engine/Wrapper.h
  37. g++ $(VERSION) -c engine/Wrapper.cpp -o $@
  38. ShaderProgram.o: engine/shader/ShaderProgram.cpp engine/shader/ShaderProgram.h
  39. g++ $(VERSION) -c engine/shader/ShaderProgram.cpp -o $@
  40. WorldShader.o: engine/shader/WorldShader.cpp engine/shader/WorldShader.h
  41. g++ $(VERSION) -c engine/shader/WorldShader.cpp -o $@
  42. FramebufferRectangle.o: engine/shader/FramebufferRectangle.cpp engine/shader/FramebufferRectangle.h
  43. g++ $(VERSION) -c engine/shader/FramebufferRectangle.cpp -o $@
  44. SSAOShader.o: engine/shader/SSAOShader.cpp engine/shader/SSAOShader.h
  45. g++ $(VERSION) -c engine/shader/SSAOShader.cpp -o $@
  46. SSAOBlurShader.o: engine/shader/SSAOBlurShader.cpp engine/shader/SSAOBlurShader.h
  47. g++ $(VERSION) -c engine/shader/SSAOBlurShader.cpp -o $@
  48. WorldPostShader.o: engine/shader/WorldPostShader.cpp engine/shader/WorldPostShader.h
  49. g++ $(VERSION) -c engine/shader/WorldPostShader.cpp -o $@
  50. OverlayShader.o: engine/shader/OverlayShader.cpp engine/shader/OverlayShader.h
  51. g++ $(VERSION) -c engine/shader/OverlayShader.cpp -o $@
  52. # ------------------------------------------------------------------------------
  53. # Client
  54. # ------------------------------------------------------------------------------
  55. Client.o: client/Client.h client/Client.cpp
  56. g++ $(VERSION) -c client/Client.cpp -o $@
  57. ChunkRenderer.o: client/rendering/ChunkRenderer.h client/rendering/ChunkRenderer.cpp world/IChunkListener.h
  58. g++ $(VERSION) -c client/rendering/ChunkRenderer.cpp -o $@
  59. ClientChunkProvider.o: client/rendering/ClientChunkProvider.h client/rendering/ClientChunkProvider.cpp world/IChunkProvider.h
  60. g++ $(VERSION) -c client/rendering/ClientChunkProvider.cpp -o $@
  61. # ------------------------------------------------------------------------------
  62. # Utils
  63. # ------------------------------------------------------------------------------
  64. Face.o: utils/Face.h utils/Face.cpp
  65. g++ $(VERSION) -c utils/Face.cpp -o $@
  66. # ------------------------------------------------------------------------------
  67. # Block
  68. # ------------------------------------------------------------------------------
  69. Block.o: block/Block.h block/Block.cpp
  70. g++ $(VERSION) -c block/Block.cpp -o $@
  71. Blocks.o: block/Blocks.h block/Blocks.cpp
  72. g++ $(VERSION) -c block/Blocks.cpp -o $@
  73. BlockAir.o: block/BlockAir.h block/BlockAir.cpp
  74. g++ $(VERSION) -c block/BlockAir.cpp -o $@
  75. # ------------------------------------------------------------------------------
  76. # World
  77. # ------------------------------------------------------------------------------
  78. Chunk.o: world/Chunk.h world/Chunk.cpp
  79. g++ $(VERSION) -c world/Chunk.cpp -o $@
  80. World.o: world/World.h world/World.cpp data/UnsortedArrayList.h
  81. g++ $(VERSION) -c world/World.cpp -o $@
  82. # ------------------------------------------------------------------------------
  83. # Math
  84. # ------------------------------------------------------------------------------
  85. Matrix3D.o: math/Matrix3D.h math/Matrix3D.cpp
  86. g++ $(VERSION) -c math/Matrix3D.cpp -o $@
  87. Matrix3DStack.o: math/Matrix3DStack.h math/Matrix3DStack.cpp
  88. g++ $(VERSION) -c math/Matrix3DStack.cpp -o $@
  89. StackOverflow.o: math/StackOverflow.h math/StackOverflow.cpp
  90. g++ $(VERSION) -c math/StackOverflow.cpp -o $@
  91. StackUnderflow.o: math/StackUnderflow.h math/StackUnderflow.cpp
  92. g++ $(VERSION) -c math/StackUnderflow.cpp -o $@
  93. Vector3D.o: math/Vector3D.h math/Vector3D.cpp
  94. g++ $(VERSION) -c math/Vector3D.cpp -o $@
  95. Plane3D.o: math/Plane3D.h math/Plane3D.cpp
  96. g++ $(VERSION) -c math/Plane3D.cpp -o $@
  97. Camera3D.o: math/Camera3D.h math/Camera3D.cpp
  98. g++ $(VERSION) -c math/Camera3D.cpp -o $@
  99. # ------------------------------------------------------------------------------
  100. # server
  101. # ------------------------------------------------------------------------------
  102. run_server: game_server
  103. ./game_server
  104. game_server: MainServer.cpp
  105. g++ $(VERSION) -o $@ MainServer.cpp
  106. # ------------------------------------------------------------------------------
  107. # tests
  108. # ------------------------------------------------------------------------------
  109. run_tests: test
  110. ./test
  111. test: MainTest.cpp data/UnsortedArrayList.h data/HashMap.h
  112. g++ $(VERSION) -o $@ MainTest.cpp
  113. # ------------------------------------------------------------------------------
  114. # clean
  115. # ------------------------------------------------------------------------------
  116. clean:
  117. rm -f game_server game_client *.o test
  118. clean_o:
  119. rm -f *.o