yummy.cricket/Makefile

66 lines
1.8 KiB
Makefile
Raw Normal View History

CSS = $(wildcard style/*.css) $(shell find fonts -type f)
2024-09-04 09:31:06 -04:00
PAGES = index.html pubkey.txt
MEDIA = \
2024-09-22 15:32:01 -04:00
$(wildcard media/*.png) $(wildcard media/*.gif) $(wildcard media/*.webp) \
2024-09-04 09:31:06 -04:00
$(wildcard media/flags/*) $(wildcard media/buttons/*) \
2024-09-22 15:32:01 -04:00
$(wildcard media/icons/*) $(wildcard media/bg/*) 8831.png 8831-quox.png
SCRIPTS = $(patsubst %.ts,%.js,$(wildcard script/*.ts))
2024-08-24 14:46:17 -04:00
MISC = $(shell find .well-known -type f)
2024-09-04 09:31:06 -04:00
ALL = $(CSS) $(PAGES) $(MEDIA) $(SCRIPTS) $(MISC)
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
2024-09-25 15:56:21 -04:00
REMOTE_DIR ?= yummy
2020-06-30 13:33:54 -04:00
all: build
2024-08-24 14:46:17 -04:00
build: $(patsubst %,$(BUILDDIR)/%,$(ALL))
2020-06-30 13:33:54 -04:00
2020-06-30 13:34:20 -04:00
upload: build
2021-05-24 05:41:49 -04:00
@rsync --recursive --partial --progress --copy-links \
--compress --human-readable --hard-links --size-only \
--delete --delete-after \
--rsh='ssh -l $(REMOTE_USER) -i $(IDFILE)' \
$(BUILDDIR)/ $(HOST):$(REMOTE_DIR)/
2020-06-30 13:34:20 -04:00
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-07-02 14:06:51 -04:00
@echo $(notdir $@)
2020-07-03 14:13:03 -04:00
@mkdir -p $(dir $(BUILDDIR)/$* $(TMPDIR)/$*)
2020-06-30 13:33:54 -04:00
@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
2020-07-02 14:13:23 -04: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 $< $@
2024-09-04 09:31:06 -04:00
$(BUILDDIR)/%.js: %.ts
tsc --strict --noUncheckedIndexedAccess --noEmitOnError \
--lib dom,es2021 --target es2015 \
--outDir $(dir $@) $^
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