-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (35 loc) · 1.21 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
PROFILE := debug
c = \e[35;1m
r = \e[0m
ifeq ($(PROFILE),debug)
flags := $(debug_flags)
else
flags := $(release_flags)
endif
build: build-deps build-shaders cmake
@echo -e " $(c)Building$(r) raytrace"
@make --dir=target/$(PROFILE)
run: build
@echo -e " $(c)Running$(r) raytrace"
@target/$(PROFILE)/raytrace
cmake: target/$(PROFILE)/Makefile
target/debug/Makefile:
@mkdir -p target/$(PROFILE)
@cmake -Btarget/$(PROFILE) -H. -DCMAKE_DEBUG_BUILD=ON -DCMAKE_INSTALL_PREFIX=$(shell pwd)/target/$(PROFILE)
target/release/Makefile:
@mkdir -p target/$(PROFILE)
@cmake -Btarget/$(PROFILE) -H. -DCMAKE_DEBUG_BUILD=OFF -DCMAKE_INSTALL_PREFIX=$(shell pwd)/target/$(PROFILE)
build-shaders: shader/comp.spv
shader/comp.spv: shader/main.comp
@glsllangValidator -V shader/main.comp -o shader/comp.spv
build-deps: target/$(PROFILE)/include/vulkan
target/$(PROFILE)/include/vulkan: target/deps/Vulkan-Hpp
@mkdir -p target/$(PROFILE)/include
@cp -r target/deps/Vulkan-Hpp/vulkan target/$(PROFILE)/include/vulkan
target/deps/Vulkan-Hpp:
@echo -e " $(c)Downloading$(r) Vulkan-Hpp"
@mkdir -p target/deps/Vulkan-Hpp
@git clone https://github.com/KhronosGroup/Vulkan-Hpp target/deps/Vulkan-Hpp
.PHONY: clean
clean:
@rm -rf target