-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
29 lines (22 loc) · 953 Bytes
/
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
# THIS MAKEFILE REQUIRES SH TO RUN, and is only used for rendering voxel models
# render commands
RENDER_LIST_FILE := render_list.json
RENDER_EXE := renderobject
CMD_RENDER := $(RENDER_EXE) -overwrite
# vox files
VOX := $(shell find vox -name "*.vox")
# corresponding png files
PNG_8BPP := $(VOX:.vox=_8bpp.png)
PNG_MASK := $(VOX:.vox=_mask.png)
PNG_32BPP := $(VOX:.vox=_32bpp.png)
PNG := $(PNG_8BPP) $(PNG_MASK) $(PNG_32BPP)
# convert vox to png
%_8bpp.png %_mask.png %_32bpp.png: %.vox
@export MANIFEST=$(shell python3 get_render_file.py $(RENDER_LIST_FILE) $< yes); \
export PALETTE=$(shell python3 get_render_file.py $(RENDER_LIST_FILE) $<); \
echo "Rendering $<, using manifest $$MANIFEST" and palette $$PALETTE; \
$(CMD_RENDER) -manifest $$MANIFEST -palette $$PALETTE -input $<
.PHONY: render
# default target, renders all voxel models in this repo
render: $(PNG)
@echo "========== Rendering complete =========="