-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (28 loc) · 1021 Bytes
/
Makefile
File metadata and controls
36 lines (28 loc) · 1021 Bytes
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
MODELS = Corset \
DamagedHelmet \
FireHydrant
MODELS_ZIPS = $(addsuffix .zip, $(MODELS))
MODELS_OPTIMIZED_ZIPS = $(addsuffix _optimized.zip, $(MODELS))
# Hack for CURL progress-bar https://stackoverflow.com/a/41860083/2367848
all: $(MODELS_ZIPS) $(MODELS_OPTIMIZED_ZIPS)
upload: $(MODELS_ZIPS) $(MODELS_OPTIMIZED_ZIPS)
@$(foreach target, $^, \
echo "Uploading $(target)"; \
curl --progress-bar --user 'upload:${UPLOAD_PASSWORD}' -T $(target) https://thirdparty-dl.lugbench.eu/models/$(target) | tee /dev/null; \
)
%.zip: %
@echo zipping $^ to $@
$(eval tmp = $(shell mktemp -d))
cp -Ra $^/. $(tmp)
[ -x $(tmp)/optimize.sh ] && cd $(tmp) && rm optimize.sh || true
cd $(tmp) && zip -r $(abspath $@) *
%_optimized.zip: %
@echo zipping $^ to $@
$(eval tmp = $(shell mktemp -d))
cp -Ra $^/. $(tmp)
[ -x $(tmp)/optimize.sh ] && cd $(tmp) && ./optimize.sh && rm optimize.sh || true
python3 ./json_minifier.py $(tmp)/*.gltf
cd $(tmp) && zip -r $(abspath $@) *
clean:
rm *.zip
.PHONY: clean all upload