yummy.cricket/Makefile

56 lines
1.3 KiB
Makefile

FONTS = $(shell find fonts -type f)
CSS = style.css
PAGES = index.html
IMAGES = $(patsubst %,images/%, \
mlem.gif mlem_static.png icon.png \
niss_uwu_bg_dim.png niss_uwu_bg.png \
info_small.png star_small.png sparkles_large.png niss_wave_large.png \
shortcake_large.png \
)
BUILDDIR ?= _build
TMPDIR ?= _tmp
HOST ?= yummy.cricket
REMOTE_USER ?= www-data
IDFILE ?= ~/.ssh/xyz
REMOTE_DIR ?= yummy
all: build
build: $(patsubst %,$(BUILDDIR)/%,$(FONTS) $(CSS) $(PAGES) $(IMAGES))
upload: build
@rsync -rPLzh --delete -e 'ssh -l $(REMOTE_USER) -i $(IDFILE)' \
$(BUILDDIR)/ $(HOST):$(REMOTE_DIR)/
$(BUILDDIR)/%: %
@echo $*
@mkdir -p $(dir $@)
@cp $< $@
$(BUILDDIR)/%.gif: %_bg.gif
@echo $(notdir $@)
@mkdir -p $(dir $(BUILDDIR)/$* $(TMPDIR)/$*)
@gifsicle -U $*_bg.gif -o $(TMPDIR)/$*_bg_u.gif
@convert -transparent '#ff9bc7' $(TMPDIR)/$*_bg_u.gif $(TMPDIR)/$*_t.gif
@gifsicle --disposal=previous $(TMPDIR)/$*_t.gif -o $(BUILDDIR)/$*.gif
$(BUILDDIR)/%_small.png: %.svg
@echo $(notdir $@)
@mkdir -p $(dir $@)
@inkscape -e $@ -h 16 $< >/dev/null
$(BUILDDIR)/%_large.png: %.svg
@echo $(notdir $@)
@mkdir -p $(dir $@)
@inkscape -e $@ -h 30 $< >/dev/null
$(BUILDDIR)/%_dim.png: %.png
@echo $(notdir $@)
@convert -channel A -evaluate Multiply 0.75 $< $@
clean:
$(RM) -r $(TMPDIR) $(BUILDDIR)
.PHONY: clean all build upload