Makefile 6.3 KB

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