-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
52 lines (37 loc) · 1.37 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
49
50
51
52
CC=ocamlbuild
CCO=$(CC) -use-ocamlfind -use-menhir
DUNE=dune build
SPIR=glslangValidator -V
all: vk bin/infolivine bin/triangle bin/tesseract
bin/triangle: shaders/triangle/vert.spv shaders/triangle/frag.spv | vk
$(DUNE) examples/$(notdir $@).exe
mv _build/default/examples/$(notdir $@).exe $@
bin/tesseract: examples/tesseract.ml shaders/tesseract/vert.spv shaders/tesseract/frag.spv | vk
$(DUNE) examples/$(notdir $@).exe
mv _build/default/examples/$(notdir $@).exe $@
bin/infolivine: info/*
$(DUNE) info/infolivine.exe \
&& mv _build/default/info/$(notdir [email protected]) $@
bin/libgen: aster/*.ml generator/*.ml info/*.ml
$(DUNE) generator/libgen.exe \
&& mv _build/default/generator/$(notdir [email protected]) $@
lib/vk.ml: bin/libgen spec/vk.xml
./bin/libgen spec/vk.xml lib
vk: spec/vk.xml lib/vk.ml
cp lib_aux/*.ml lib
$(DUNE) @install
shaders/%/frag.spv : shaders/%/base.frag
cd shaders/$* && $(SPIR) base.frag
shaders/%/vert.spv : shaders/%/base.vert
cd shaders/$* && $(SPIR) base.vert
test-triangle: bin/triangle
VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_standard_validation ./bin/triangle
test-tesseract: bin/tesseract
VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_standard_validation ./bin/tesseract
.PHONY: vkspec
vkspec:
mkdir -p spec \
&& cd spec \
&& wget "https://raw.githubusercontent.com/KhronosGroup/Vulkan-Docs/master/xml/vk.xml"
clean:
dune clean; rm lib/*.ml{,i}; rm bin/*