1
0
Fork 0
yummy.cricket/Makefile

38 lines
847 B
Makefile
Raw Normal View History

2020-06-30 10:25:01 -04:00
FONTS = $(shell find fonts -type f)
CSS = style.css
PAGES = index.html
2020-06-30 13:32:33 -04:00
IMAGES = mlem.gif icon.png
2020-06-30 10:25:01 -04:00
2020-06-30 13:33:54 -04:00
BUILDDIR ?= _build
TMPDIR ?= _tmp
2020-06-30 10:25:01 -04:00
2020-06-30 13:34:20 -04:00
HOST ?= yummy.cricket
REMOTE_USER ?= www-data
IDFILE ?= ~/.ssh/xyz
REMOTE_DIR ?= yummy
2020-06-30 13:33:54 -04:00
all: build
build: $(patsubst %,$(BUILDDIR)/%,$(FONTS) $(CSS) $(PAGES) $(IMAGES))
2020-06-30 13:34:20 -04:00
upload: build
@rsync -rPLzh --delete -e 'ssh -l $(REMOTE_USER) -i $(IDFILE)' \
$(BUILDDIR)/ $(HOST):$(REMOTE_DIR)/
2020-06-30 13:33:54 -04:00
$(BUILDDIR)/%: %
2020-06-30 10:25:01 -04:00
@echo $*
@mkdir -p $(dir $@)
@cp $< $@
2020-06-30 13:33:54 -04:00
$(BUILDDIR)/%.gif: %_bg.gif
2020-06-30 10:25:01 -04:00
@echo $*.gif
2020-06-30 13:33:54 -04: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-28 20:21:02 -04:00
clean:
2020-06-30 13:33:54 -04:00
$(RM) -r $(TMPDIR) $(BUILDDIR)
2020-06-28 20:21:02 -04:00
2020-06-30 13:34:20 -04:00
.PHONY: clean all build upload