MAKEFLAGS += -R -r HTML_MINIFIER_FLAGS += \ --collapse-boolean-attributes \ --collapse-whitespace \ --decode-entities \ --minify-css \ --minify-js '{"mangle": {"eval": true}}' \ --remove-attribute-quotes \ --remove-comments \ --remove-optional-tags \ --remove-redundant-attributes \ --sort-attributes \ --sort-class-name \ --ignore-custom-fragments 'clamp([^;]*);' \ --trim-custom-fragments WFS ?= ~/wfs/wfs.py WFS_FLAGS += \ --desubroutinize \ --layout-scripts=latn \ --layout-features-=frac,locl \ --name-IDs= \ --drop-tables+=gasp,prep deployhosts := pink red blue fonts := resume/EBGaramond-Italic.otf resume/EBGaramond-Regular.otf resume/EBGaramond-Medium.otf fontssubset := $(fonts:.otf=.subset.woff2) staticall := $(patsubst static/%,out/%,$(shell find static)) staticdirs := $(sort $(dir $(staticall))) staticfiles := $(filter-out $(staticdirs),$(staticall)) tocomp := $(filter %.txt %.html %.js %.css,$(staticfiles)) out/resume/index.html all: $(staticall) out/resume $(tocomp:=.br) $(tocomp:=.gz) out/%: static/% install -Dpm644 $< $@ %.br: % brotli -Zc $< > $@ %.gz: % zopfli -c $< > $@ $(staticdirs) out/resume &: mkdir -p $@ out/%.html: static/%.html | $(@D) html-minifier $(HTML_MINIFIER_FLAGS) $< -o $@ out/resume/index.html: resume/resume.html resume/resume.js resume/resume.css $(fontssubset) | out/resume ./inliner.py $< | html-minifier $(HTML_MINIFIER_FLAGS) > $@ $(fontssubset) &: resume/resume.html $(fonts) cd $(<D) && $(WFS) \ --font 'EBGaramond-Italic.otf:EB Garamond:400:italic' \ --font 'EBGaramond-Regular.otf:EB Garamond:400:normal' \ --font 'EBGaramond-Medium.otf:EB Garamond:500:normal' \ $(WFS_FLAGS) $(<F) deploy: $(patsubst %,deploy-%,$(deployhosts)) deploy-%: rsync -e 'ssh -oVisualHostKey=no' -av --delete out/ $*.alxu.ca:public_html/ define check check-$(subst :,_,$(1)): curl -sS --compressed --resolve www.alxu.ca:443:$(1) https://www.alxu.ca/resume/ | cmp - out/resume/index.html check: check-$(subst :,_,$(1)) endef $(foreach ip,$(shell getent ahosts www.alxu.ca | awk '/STREAM/{print $$1}'),$(eval $(call check,$(ip)))) clean: rm -rf out rm -f $(fontssubset) .DELETE_ON_ERROR: .PHONY: all clean deploy