| [5a643d3] | 1 | OS = $(shell uname) | 
|---|
| [15c7ed9] | 2 | CC = g++ | 
|---|
| [03f4c64] | 3 | CFLAGS = -std=c++11 -Wall -pedantic -rdynamic | 
|---|
| [17f28a1] | 4 | # -rdynamic is to generate debug info for dynamic symbols on debian-based | 
|---|
|  | 5 | # systems (tested on Linux Mint) | 
|---|
|  | 6 | # for OSX, using -g generates a newgame.dSYS directory which has debug symbols. | 
|---|
|  | 7 | # However, this has no effect on the stack trace, so there must be a way to specify a *.dSYS directory when running ./newgame | 
|---|
|  | 8 | # or to instead put thos symbols directly into the executable, like -rdynamic does for Linux | 
|---|
| [4762301] | 9 | #-Wextra -fno-inline | 
|---|
| [5a643d3] | 10 |  | 
|---|
|  | 11 | ifeq ($(OS),Darwin) | 
|---|
| [e6bc0f4] | 12 | DEP = -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo -lglfw -lglew | 
|---|
| [5a643d3] | 13 | endif | 
|---|
| [15c7ed9] | 14 | ifeq ($(OS),Linux) | 
|---|
|  | 15 | DEP = -lglfw3 -lGLEW -lGL -ldl -lX11 -lXrandr -lXxf86vm -lXinerama -lXcursor  -pthread | 
|---|
| [5a643d3] | 16 | endif | 
|---|
|  | 17 |  | 
|---|
| [1a616e6] | 18 | IMGUI_FILES = IMGUI/imgui_demo.cpp IMGUI/imgui_draw.cpp IMGUI/imgui.cpp | 
|---|
|  | 19 |  | 
|---|
| [fc424f6] | 20 | # If I were generating .o files as well, I should use $? instead of $^ | 
|---|
| [8e232ce] | 21 | # as this well prevent regenerating .o files for unchanged .cpp files | 
|---|
|  | 22 |  | 
|---|
| [a23fc08] | 23 | newgame: new-game.cpp logger.cpp utils.cpp CrashLogger.cpp stb_image.cpp imgui_impl_glfw_gl3.cpp $(IMGUI_FILES) | 
|---|
| [8e232ce] | 24 | $(CC) $^ $(DEP) $(CFLAGS) -o $@ | 
|---|
| [5272b6b] | 25 |  | 
|---|
| [9e81839] | 26 | pong: pong.cpp logger.cpp | 
|---|
| [8e232ce] | 27 | $(CC) $^ $(DEP) $(CFLAGS) -o $@ | 
|---|
| [9e81839] | 28 |  | 
|---|
| [49756cb] | 29 | mygame: mygame.cpp common/shader.cpp common/texture.cpp common/controls-new.cpp | 
|---|
| [8e232ce] | 30 | $(CC) $^ $(DEP) $(CFLAGS) -o $@ | 
|---|
| [8a6d19d] | 31 |  | 
|---|
|  | 32 | demo: game06.cpp common/shader.cpp common/texture.cpp common/controls.cpp | 
|---|
| [8e232ce] | 33 | $(CC) $^ $(DEP) $(CFLAGS) -o $@ | 
|---|
| [cfda3b2] | 34 |  | 
|---|
| [03f4c64] | 35 | VULKAN_SDK_PATH = /home/dportnoy/Desktop/VulkanSDK/1.1.106.0/x86_64 | 
|---|
|  | 36 | CFLAGS_VULKAN = -std=c++17 -I$(VULKAN_SDK_PATH)/include -Wall -pedantic | 
|---|
|  | 37 | LIBFLAGS = -L$(VULKAN_SDK_PATH)/lib `pkg-config --static --libs glfw3` -lvulkan | 
|---|
|  | 38 |  | 
|---|
|  | 39 | vulkangame: vulkan-game.cpp | 
|---|
|  | 40 | $(CC) $(CFLAGS_VULKAN) -o $@ $^ $(LIBFLAGS) | 
|---|
|  | 41 |  | 
|---|
| [cfda3b2] | 42 | clean: | 
|---|
| [5272b6b] | 43 | rm -f newgame | 
|---|
| [9e81839] | 44 | rm -f pong | 
|---|
| [49756cb] | 45 | rm -f mygame | 
|---|
| [8a6d19d] | 46 | rm -f demo | 
|---|
| [03f4c64] | 47 | rm -f vulkangame | 
|---|