123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- VERSION = -std=c++14
- CFLAGS = $(shell pkg-config --cflags glfw3)
- LDFLAGS = $(shell pkg-config --static --libs glfw3) -lGL -lGLEW -lpng
- all: game_client game_server
- test_client: game_client
- optirun ./game_client
- run_client: game_client
- #vblank_mode=0 optirun ./game_client
- optirun ./game_client
- game_client: MainClient.cpp\
- Clock.o DirectRenderer.o KeyManager.o Mesh.o MouseManager.o Shader.o\
- Texture.o Utils.o Wrapper.o ShaderProgram.o WorldShader.o FramebufferRectangle.o\
- SSAOShader.o SSAOBlurShader.o WorldPostShader.o OverlayShader.o\
- Matrix3D.o Matrix3DStack.o StackOverflow.o StackUnderflow.o Vector3D.o Plane3D.o Camera3D.o\
- Client.o\
- Block.o Blocks.o BlockAir.o\
- Face.o GUI.o StartMenu.o\
- Chunk.o World.o ChunkRenderer.o ClientChunkProvider.o BlockRenderer.o BlockRenderers.o EntityRenderer.o
- g++ $(VERSION) -o $@ MainClient.cpp Clock.o DirectRenderer.o KeyManager.o Mesh.o MouseManager.o Shader.o\
- Texture.o Utils.o Wrapper.o ShaderProgram.o WorldShader.o FramebufferRectangle.o\
- SSAOShader.o SSAOBlurShader.o WorldPostShader.o OverlayShader.o\
- Matrix3D.o Matrix3DStack.o StackOverflow.o StackUnderflow.o Vector3D.o Plane3D.o Camera3D.o\
- Client.o\
- Block.o Blocks.o BlockAir.o\
- Face.o GUI.o StartMenu.o\
- Chunk.o World.o ChunkRenderer.o ClientChunkProvider.o BlockRenderer.o BlockRenderers.o EntityRenderer.o $(LDFLAGS)
- # ------------------------------------------------------------------------------
- # Engine
- # ------------------------------------------------------------------------------
-
- Clock.o: engine/Clock.cpp engine/Clock.h
- g++ $(VERSION) -c engine/Clock.cpp -o $@
- DirectRenderer.o: engine/DirectRenderer.cpp engine/DirectRenderer.h\
- math/Matrix3D.h engine/Texture.h engine/Utils.h engine/Wrapper.h
- g++ $(VERSION) -c engine/DirectRenderer.cpp -o $@
-
- KeyManager.o: engine/KeyManager.cpp engine/KeyManager.h
- g++ $(VERSION) -c engine/KeyManager.cpp -o $@
- Mesh.o: engine/Mesh.cpp engine/Mesh.h
- g++ $(VERSION) -c engine/Mesh.cpp -o $@
- MouseManager.o: engine/MouseManager.cpp engine/MouseManager.h
- g++ $(VERSION) -c engine/MouseManager.cpp -o $@
-
- Shader.o: engine/Shader.cpp engine/Shader.h\
- math/Plane3D.h math/Vector3D.h math/Matrix3D.h math/Matrix3DStack.h\
- engine/Utils.h engine/Wrapper.h
- g++ $(VERSION) -c engine/Shader.cpp -o $@
-
- Texture.o: engine/Texture.cpp engine/Texture.h
- g++ $(VERSION) -c engine/Texture.cpp -o $@
- Utils.o: engine/Utils.cpp engine/Utils.h
- g++ $(VERSION) -c engine/Utils.cpp -o $@
-
- Wrapper.o: engine/Wrapper.cpp engine/Wrapper.h\
- engine/shader/ShaderProgram.h math/Vector3D.h math/Matrix3D.h\
- engine/shader/WorldShader.h engine/Shader.h\
- engine/shader/SSAOShader.h engine/shader/SSAOBlurShader.h\
- engine/shader/FramebufferRectangle.h engine/shader/WorldPostShader.h\
- engine/shader/OverlayShader.h engine/Mesh.h
- g++ $(VERSION) -c engine/Wrapper.cpp -o $@
-
- ShaderProgram.o: engine/shader/ShaderProgram.cpp engine/shader/ShaderProgram.h
- g++ $(VERSION) -c engine/shader/ShaderProgram.cpp -o $@
-
- WorldShader.o: engine/shader/WorldShader.cpp engine/shader/WorldShader.h\
- engine/shader/ShaderProgram.h engine/Wrapper.h
- g++ $(VERSION) -c engine/shader/WorldShader.cpp -o $@
-
- FramebufferRectangle.o: engine/shader/FramebufferRectangle.cpp engine/shader/FramebufferRectangle.h\
- engine/Wrapper.h
- g++ $(VERSION) -c engine/shader/FramebufferRectangle.cpp -o $@
-
- SSAOShader.o: engine/shader/SSAOShader.cpp engine/shader/SSAOShader.h\
- engine/shader/ShaderProgram.h engine/Wrapper.h
- g++ $(VERSION) -c engine/shader/SSAOShader.cpp -o $@
-
- SSAOBlurShader.o: engine/shader/SSAOBlurShader.cpp engine/shader/SSAOBlurShader.h\
- engine/shader/ShaderProgram.h engine/Wrapper.h
- g++ $(VERSION) -c engine/shader/SSAOBlurShader.cpp -o $@
-
- WorldPostShader.o: engine/shader/WorldPostShader.cpp engine/shader/WorldPostShader.h\
- engine/shader/ShaderProgram.h engine/Wrapper.h
- g++ $(VERSION) -c engine/shader/WorldPostShader.cpp -o $@
-
- OverlayShader.o: engine/shader/OverlayShader.cpp engine/shader/OverlayShader.h\
- engine/shader/ShaderProgram.h math/Matrix3D.h engine/Wrapper.h
- g++ $(VERSION) -c engine/shader/OverlayShader.cpp -o $@
-
- # ------------------------------------------------------------------------------
- # Client
- # ------------------------------------------------------------------------------
-
- Client.o: client/Client.h client/Client.cpp\
- engine/KeyManager.h engine/MouseManager.h engine/Clock.h\
- engine/Shader.h engine/DirectRenderer.h\
- client/rendering/gui/GUIs.h client/rendering/gui/GUI.h client/rendering/gui/StartMenu.h
- g++ $(VERSION) -c client/Client.cpp -o $@
-
- ChunkRenderer.o: client/rendering/ChunkRenderer.h client/rendering/ChunkRenderer.cpp world/IChunkListener.h\
- client/rendering/block/BlockRenderers.h client/rendering/block/BlockRenderer.h\
- engine/Mesh.h engine/Shader.h engine/Texture.h engine/DirectRenderer.h\
- world/IChunkListener.h math/Camera3D.h
- g++ $(VERSION) -c client/rendering/ChunkRenderer.cpp -o $@
-
- ClientChunkProvider.o: client/rendering/ClientChunkProvider.h client/rendering/ClientChunkProvider.cpp world/IChunkProvider.h\
- world/IChunkProvider.h
- g++ $(VERSION) -c client/rendering/ClientChunkProvider.cpp -o $@
-
- BlockRenderer.o: client/rendering/block/BlockRenderer.h client/rendering/block/BlockRenderer.cpp engine/Mesh.h utils/Face.h
- g++ $(VERSION) -c client/rendering/block/BlockRenderer.cpp -o $@
-
- BlockRenderers.o: client/rendering/block/BlockRenderers.h client/rendering/block/BlockRenderers.cpp block/Block.h client/rendering/block/BlockRenderer.h
- g++ $(VERSION) -c client/rendering/block/BlockRenderers.cpp -o $@
-
- EntityRenderer.o: client/rendering/entity/EntityRenderer.h client/rendering/entity/EntityRenderer.cpp\
- engine/Shader.h math/Camera3D.h engine/DirectRenderer.h engine/Mesh.h\
- engine/Texture.h engine/Utils.h
- g++ $(VERSION) -c client/rendering/entity/EntityRenderer.cpp -o $@
-
- GUI.o: client/rendering/gui/GUI.h client/rendering/gui/GUI.cpp\
- engine/KeyManager.h engine/MouseManager.h engine/Shader.h engine/DirectRenderer.h
- g++ $(VERSION) -c client/rendering/gui/GUI.cpp -o $@
-
- StartMenu.o: client/rendering/gui/StartMenu.h client/rendering/gui/StartMenu.cpp\
- client/rendering/gui/GUI.h
- g++ $(VERSION) -c client/rendering/gui/StartMenu.cpp -o $@
-
- # ------------------------------------------------------------------------------
- # Utils
- # ------------------------------------------------------------------------------
-
- Face.o: utils/Face.h utils/Face.cpp
- g++ $(VERSION) -c utils/Face.cpp -o $@
-
- # ------------------------------------------------------------------------------
- # Block
- # ------------------------------------------------------------------------------
-
- Block.o: block/Block.h block/Block.cpp utils/Face.h
- g++ $(VERSION) -c block/Block.cpp -o $@
-
- Blocks.o: block/Blocks.h block/Blocks.cpp block/Block.h block/BlockAir.h
- g++ $(VERSION) -c block/Blocks.cpp -o $@
-
- BlockAir.o: block/BlockAir.h block/BlockAir.cpp block/Block.h
- g++ $(VERSION) -c block/BlockAir.cpp -o $@
-
- # ------------------------------------------------------------------------------
- # World
- # ------------------------------------------------------------------------------
-
- Chunk.o: world/Chunk.h world/Chunk.cpp\
- block/Block.h block/Blocks.h
- g++ $(VERSION) -c world/Chunk.cpp -o $@
-
- World.o: world/World.h world/World.cpp\
- world/Chunk.h world/IChunkProvider.h world/IChunkListener.h data/UnsortedArrayList.h
- g++ $(VERSION) -c world/World.cpp -o $@
- # ------------------------------------------------------------------------------
- # Math
- # ------------------------------------------------------------------------------
- Matrix3D.o: math/Matrix3D.h math/Matrix3D.cpp
- g++ $(VERSION) -c math/Matrix3D.cpp -o $@
-
- Matrix3DStack.o: math/Matrix3DStack.h math/Matrix3DStack.cpp\
- math/Matrix3D.h math/StackOverflow.h math/StackUnderflow.h
- g++ $(VERSION) -c math/Matrix3DStack.cpp -o $@
-
- StackOverflow.o: math/StackOverflow.h math/StackOverflow.cpp
- g++ $(VERSION) -c math/StackOverflow.cpp -o $@
-
- StackUnderflow.o: math/StackUnderflow.h math/StackUnderflow.cpp
- g++ $(VERSION) -c math/StackUnderflow.cpp -o $@
-
- Vector3D.o: math/Vector3D.h math/Vector3D.cpp
- g++ $(VERSION) -c math/Vector3D.cpp -o $@
-
- Plane3D.o: math/Plane3D.h math/Plane3D.cpp\
- math/Vector3D.h
- g++ $(VERSION) -c math/Plane3D.cpp -o $@
-
- Camera3D.o: math/Camera3D.h math/Camera3D.cpp\
- math/Vector3D.h math/Matrix3D.h math/Plane3D.h math/Camera3D.h\
- engine/Wrapper.h engine/Utils.h
- g++ $(VERSION) -c math/Camera3D.cpp -o $@
-
- # ------------------------------------------------------------------------------
- # server
- # ------------------------------------------------------------------------------
-
- run_server: game_server
- ./game_server
-
- game_server: MainServer.cpp GameServer.o Stream.o Server.o
- g++ $(VERSION) -o $@ MainServer.cpp GameServer.o Stream.o Server.o -lpthread
-
- GameServer.o: server/GameServer.h server/GameServer.cpp network/server/Server.h
- g++ $(VERSION) -c server/GameServer.cpp -o $@
-
- # ------------------------------------------------------------------------------
- # network
- # ------------------------------------------------------------------------------
-
- Server.o: network/server/Server.h network/server/Server.cpp\
- network/server/IServerListener.h network/stream/Stream.h
- g++ $(VERSION) -c network/server/Server.cpp -o $@
-
- Stream.o: network/stream/Stream.h network/stream/Stream.cpp
- g++ $(VERSION) -c network/stream/Stream.cpp -o $@
-
- # ------------------------------------------------------------------------------
- # tests
- # ------------------------------------------------------------------------------
-
- run_tests: test
- ./test
-
- test: MainTest.cpp data/UnsortedArrayList.h data/HashMap.h
- g++ $(VERSION) -o $@ MainTest.cpp
-
- # ------------------------------------------------------------------------------
- # clean
- # ------------------------------------------------------------------------------
-
- clean:
- rm -f game_server game_client *.o test
- clean_o:
- rm -f *.o
|