yummy.cricket/Makefile

56 lines
1.3 KiB
Makefile
Raw Normal View History

2020-06-30 16:25:01 +02:00
FONTS = $(shell find fonts -type f)
CSS = style.css
PAGES = index.html
2020-07-02 20:30:38 +02:00
IMAGES = \
mlem.gif mlem_static.png icon.png \
niss_uwu_bg_dim.png niss_uwu_bg.png \
2020-07-03 17:27:45 +02:00
star_small.png sparkles_large.png niss_wave_large.png \
shortcake_large.png
2020-06-30 16:25:01 +02:00
2020-06-30 19:33:54 +02:00
BUILDDIR ?= _build
TMPDIR ?= _tmp
2020-06-30 16:25:01 +02:00
2020-06-30 19:34:20 +02:00
HOST ?= yummy.cricket
REMOTE_USER ?= www-data
IDFILE ?= ~/.ssh/xyz
REMOTE_DIR ?= yummy
2020-06-30 19:33:54 +02:00
all: build
build: $(patsubst %,$(BUILDDIR)/%,$(FONTS) $(CSS) $(PAGES) $(IMAGES))
2020-06-30 19:34:20 +02:00
upload: build
@rsync -rPLzh --delete -e 'ssh -l $(REMOTE_USER) -i $(IDFILE)' \
$(BUILDDIR)/ $(HOST):$(REMOTE_DIR)/
2020-06-30 19:33:54 +02:00
$(BUILDDIR)/%: %
2020-06-30 16:25:01 +02:00
@echo $*
@mkdir -p $(dir $@)
@cp $< $@
2020-06-30 19:33:54 +02:00
$(BUILDDIR)/%.gif: %_bg.gif
2020-07-02 20:06:51 +02:00
@echo $(notdir $@)
2020-06-30 19:33:54 +02:00
@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
2020-06-29 02:21:02 +02:00
2020-07-02 20:13:23 +02:00
$(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 $< $@
2020-06-29 02:21:02 +02:00
clean:
2020-06-30 19:33:54 +02:00
$(RM) -r $(TMPDIR) $(BUILDDIR)
2020-06-29 02:21:02 +02:00
2020-06-30 19:34:20 +02:00
.PHONY: clean all build upload