#!/bin/python RESOLUTIONS = [4096, 2048, 1024, 512, 256, 128, 64, 32, 16] FORMATS = ["webp", "png", "avif"] VARIANTS = ["default", "pride", "chrismas", "secondary"] outputs = [] for v in VARIANTS: for r in RESOLUTIONS: for f in FORMATS: outputs.append(f"{v}-{r}.{f}") outputs.append(f"{v}-16.ico") print(f"OUTPUTS = {' '.join(outputs)}") print(f"SOURCES = LICENCE makefile gen_makefile.py $(wildcard *.blend)") print(f""" .PHONY: all all: $(OUTPUTS) bundle-all.tar.zst bundle-sources.tar.zst bundle-output.tar.zst .PHONY: clean clean: \trm *.webp *.png *.blend1 *.ico *.tar.zst bundle-all.tar.zst: $(OUTPUTS) $(SOURCES) \ttar --zstd --create --file $@ $^ bundle-sources.tar.zst: $(SOURCES) \ttar --zstd --create --file $@ $^ bundle-output.tar.zst: $(OUTPUTS) \ttar --zstd --create --file $@ $^ %.webp: %.png \tffmpeg -y -i $< $@ %.avif: %.png \tffmpeg -y -i $< $@ %.ico: %.png \tffmpeg -y -i $< $@ """) for v in VARIANTS: print(f"""{v}.png: {v}.blend \tblender --background $^ --render-format PNG --render-output {v} --render-frame 0 \tmv {v}0000.png $@ """) for v in VARIANTS: for r in RESOLUTIONS: print( f"{v}-{r}.png: {v}.png\n\tffmpeg -y -i {v}.png -vf scale={r}x{r} {v}-{r}.png")