classplates/Makefile

27 lines
708 B
Makefile
Raw Normal View History

2022-01-12 02:47:31 +00:00
WIDTH?=1404
HEIGHT?=1872
DEVICE?=root@10.11.99.1
MANAGER?=/opt/bin/templatectl
SOURCE=templates
BUILD=build
$(shell mkdir -p "$(BUILD)")
TEMPLATES=$(foreach vector,$(shell find "$(SOURCE)" -iname "*.svg" -type f),$(subst .svg,,$(subst $(SOURCE)/,,$(vector)))-push)
all: $(TEMPLATES)
clean:
rm "$(BUILD)"/*
$(BUILD)/%.png: $(SOURCE)/%.svg
inkscape "$^" -o "$@" -w $(WIDTH) -h $(HEIGHT) 2>/dev/null
%-push: $(BUILD)/%.png $(SOURCE)/%.svg $(SOURCE)/%.meta
ssh "$(DEVICE)" $(MANAGER) --version
scp "$(BUILD)"/$*.png "$(SOURCE)"/$*.svg "$(DEVICE):/usr/share/remarkable/templates"
echo '$(MANAGER) add $(shell cat "$(SOURCE)/$*.meta") --filename "$*"' | ssh "$(DEVICE)"
.PHONY: all clean
.NOTPARALLEL: