2023-01-18 11:05:07 +00:00
|
|
|
_BREW_PREFIX=$(shell brew --prefix)
|
|
|
|
VULKAN_SDK ?= ${HOME}/VulkanSDK/1.3.236.0
|
|
|
|
VK_ICD_FILENAMES=${VULKAN_SDK}/macOS/share/vulkan/icd.d/MoltenVK_icd.json
|
|
|
|
VK_LAYER_PATH=${VULKAN_SDK}/macOS/share/vulkan/explicit_layer.d
|
|
|
|
|
|
|
|
.PHONY: main
|
|
|
|
main: main.cpp
|
|
|
|
# compile
|
2023-01-20 12:04:55 +00:00
|
|
|
clang++ -I${_BREW_PREFIX}/include -I${VULKAN_SDK}/macOS/include --std=c++17 -c main.cpp -o main.o
|
2023-01-18 11:05:07 +00:00
|
|
|
# link
|
|
|
|
clang++ -L${_BREW_PREFIX}/lib -lglfw.3.3 -L${VULKAN_SDK}/macOS/lib -lvulkan.1.3.236 -l vulkan.1 main.o -o main
|
|
|
|
|
2023-01-23 11:48:02 +00:00
|
|
|
.PHONY: %.spv
|
|
|
|
shaders/%.spv: shaders/shader.%
|
|
|
|
${VULKAN_SDK}/macOS/bin/glslc $? -o $@
|
|
|
|
|
|
|
|
.PHONY: shaders
|
|
|
|
shaders: shaders/vert.spv shaders/frag.spv
|
|
|
|
|
2023-01-18 11:05:07 +00:00
|
|
|
.PHONY: run
|
2023-01-23 11:48:02 +00:00
|
|
|
run: shaders main
|
2023-01-18 11:05:07 +00:00
|
|
|
chmod +x ./main
|
|
|
|
./main
|