VERSION = -std=c++14 CFLAGS = $(shell pkg-config --cflags glfw3) LDFLAGS = $(shell pkg-config --static --libs glfw3) -lGL -lGLEW -lpng all: game run_client: game_client vblank_mode=0 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\ Matrix3D.o Matrix3DStack.o StackOverflow.o StackUnderflow.o Vector3D.o\ Client.o\ Chunk.o g++ $(VERSION) -o $@ MainClient.cpp *.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 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 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 g++ $(VERSION) -c engine/Wrapper.cpp -o $@ # ------------------------------------------------------------------------------ # Client # ------------------------------------------------------------------------------ Client.o: client/Client.h client/Client.cpp g++ $(VERSION) -c client/Client.cpp -o $@ # ------------------------------------------------------------------------------ # World # ------------------------------------------------------------------------------ Chunk.o: world/Chunk.h world/Chunk.cpp g++ $(VERSION) -c world/Chunk.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 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 $@ # ------------------------------------------------------------------------------ # server # ------------------------------------------------------------------------------ run_server: game_server ./game_server game_server: MainServer.cpp g++ $(VERSION) -o $@ MainServer.cpp # ------------------------------------------------------------------------------ # clean # ------------------------------------------------------------------------------ clean: rm -f game_server game_client *.o