source: opengl-game/makefile@ 826df16

feature/imgui-sdl points-test
Last change on this file since 826df16 was 826df16, checked in by Dmitry Portnoy <dmp1488@…>, 5 years ago

Make the new Vulkan project work in Linux Mint

  • Property mode set to 100644
File size: 2.1 KB
Line 
1# CFLAGS are compiler flags and LIBFLAGS could be renamed LINKER_FLAGS
2OS = $(shell uname)
3CC = g++
4CFLAGS = -std=c++11 -Wall -pedantic -rdynamic
5# -rdynamic is to generate debug info for dynamic symbols on debian-based
6# systems (tested on Linux Mint)
7# for OSX, using -g generates a newgame.dSYS directory which has debug symbols.
8# However, this has no effect on the stack trace, so there must be a way to specify a *.dSYS directory when running ./newgame
9# or to instead put thos symbols directly into the executable, like -rdynamic does for Linux
10#-Wextra -fno-inline
11
12ifeq ($(OS),Darwin)
13 DEP = -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo -lglfw -lglew
14endif
15ifeq ($(OS),Linux)
16 DEP = -lglfw3 -lGLEW -lGL -ldl -lX11 -lXrandr -lXxf86vm -lXinerama -lXcursor -pthread
17endif
18
19IMGUI_FILES = IMGUI/imgui_demo.cpp IMGUI/imgui_draw.cpp IMGUI/imgui.cpp
20
21# If I were generating .o files as well, I should use $? instead of $^
22# as this well prevent regenerating .o files for unchanged .cpp files
23
24newgame: new-game.cpp logger.cpp utils.cpp CrashLogger.cpp stb_image.cpp imgui_impl_glfw_gl3.cpp $(IMGUI_FILES)
25 $(CC) $^ $(DEP) $(CFLAGS) -o $@
26
27pong: pong.cpp logger.cpp
28 $(CC) $^ $(DEP) $(CFLAGS) -o $@
29
30mygame: mygame.cpp common/shader.cpp common/texture.cpp common/controls-new.cpp
31 $(CC) $^ $(DEP) $(CFLAGS) -o $@
32
33demo: game06.cpp common/shader.cpp common/texture.cpp common/controls.cpp
34 $(CC) $^ $(DEP) $(CFLAGS) -o $@
35
36# from the mac makefile
37#CXX_INCLUDES = -I/Users/dportnoy15/Development/vulkan-sdk-macos-1.1.108.0/macOS/include -I/usr/local/Cellar/sdl2/2.0.9_1/include/SDL2
38#LIBFLAGS = -Wl,-rpath,$(VULKAN_SDK_PATH)/macOS/lib $(VULKAN_SDK_PATH)/macOS/lib/libvulkan.dylib -L/usr/local/Cellar/sdl2/2.0.9_1/lib -lSDL2
39
40CXX_FLAGS = -std=c++17 -Wall -pedantic # -O3
41
42VULKAN_SDK_PATH = /home/dportnoy/Desktop/VulkanSDK/1.1.106.0/x86_64
43
44LIB_PATHS = -L$(VULKAN_SDK_PATH)/lib -I$(VULKAN_SDK_PATH)/include
45LIBS = -lvulkan -lSDL2
46
47LIB_FLAGS = $(LIB_PATHS) $(LIBS)
48
49vulkangame: vulkan-game.cpp game-gui-sdl.cpp
50 $(CC) $(CXX_FLAGS) -o $@ $^ $(LIB_FLAGS)
51
52clean:
53 rm -f newgame
54 rm -f pong
55 rm -f mygame
56 rm -f demo
57 rm -f vulkangame
Note: See TracBrowser for help on using the repository browser.