yummy.cricket/Makefile

67 lines
1.9 KiB
Makefile
Raw Normal View History

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