From 7dccf6e8684f767b6e377d627b36ccf493947f1e Mon Sep 17 00:00:00 2001 From: "Alex Xu (Hello71)" Date: Sun, 3 Oct 2021 15:03:42 -0400 Subject: Initial commit --- Makefile | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e813d30 --- /dev/null +++ b/Makefile @@ -0,0 +1,82 @@ +MAKEFLAGS += -R -r +HTML_MINIFIER_FLAGS := \ + --collapse-boolean-attributes \ + --collapse-whitespace \ + --decode-entities \ + --minify-css \ + --minify-js \ + --remove-attribute-quotes \ + --remove-comments \ + --remove-optional-tags \ + --remove-redundant-attributes \ + --remove-tag-whitespace \ + --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 + +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 + +fonts := resume/EBGaramond-Italic.otf resume/EBGaramond-Regular.otf resume/EBGaramond-Medium.otf +fontssubset := $(fonts:.otf=.subset.woff2) + +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 $(