X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/f00f148c4e56bde702d316dd591934adbb4f6232..3f38a7192491a73a1527179cdd68218f023aed61:/Makefile?ds=inline diff --git a/Makefile b/Makefile index 138be91..217fe13 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,10 @@ -all: sitemap.xml light.css plan.plp UPDATE data/digraphs.inc.pl data/unicode-cover.inc.pl data/countries.inc.pl data/browser data/termcol-xcolor.inc.pl data/digraphs-xorg.inc.pl word cache -more: all +all: sitemap.xml style plan.plp UPDATE data cache .PHONY: force # applied to download after 2 hours download := $(shell [ -z $$(find data/download -mmin -120) ] && (touch data/download && echo force)) # atomically create file by command -cmdsave = @echo '$1' $2 \>$@; mispipe '$1 $2' 'ifne sponge $@' +cmdsave = @echo "$1" $2 \>$@; mispipe "$1 $2" 'ifne sponge $@' # download git checkout gitsave = @if cd $@ 2>/dev/null; \ then echo git pull $@; git pull -q --ff-only || true; \ @@ -14,23 +13,26 @@ gitsave = @if cd $@ 2>/dev/null; \ sitemap.xml: tools/mksitemap $(call cmdsave,$<) -light.css: tools/stripcss base.css - $(call cmdsave,$^) +style: light.css sc.css +%.css: style/%.scss $(wildcard style/_*.scss) + $(call cmdsave,sassc -t compressed $< | perl -pE 's/\}+\K/\n/g') plan.plp: TODO kramdown $< >$@ -UPDATE: $(download) - $(call cmdsave,git log -1 --date=short --pretty="%ad %s") +UPDATE: .git + $(call cmdsave,git log -1 --date=short --pretty='%ad %s') -cache: data/writing-latn.json -word: word/put.min.js data/wordlist.inc.pl data/wordlist.en.json data/wordlist.nl.json data/wordlist.ru.json data/wordpairs.json +cache: $(patsubst %.inc.pl,data/%.json,$(wildcard charset-*.inc.pl) $(wildcard keyboard/altgr/*.inc.pl) writing-latn.inc.pl) +word: word/put.min.js data/wordlist.en.json data/wordlist.nl.json data/wordlist.ru.json data/wordpairs.json word/put.js: $(download) tools/wget-ifmodified https://github.com/kriszyp/put-selector/raw/master/put.js $@ word/%.min.js: word/%.js uglifyjs -m '' $< -o $@ +data: data/digraphs.json data/unicode-cover.inc.pl data/countries.inc.pl data/browser data/termcol-xcolor.inc.pl data/digraphs-xorg.json data/unicode-sampler word keyboard/symbols/unigraph + data/DerivedAge.txt: $(download) tools/wget-ifmodified http://www.unicode.org/Public/UNIDATA/$(@F) $@ @@ -47,8 +49,15 @@ data/digraphs-shiar.inc.pl: tools/mkdigraphs-shiar shiar.inc.txt $(call cmdsave,$^) data/xorg-compose: $(download) - tools/wget-ifmodified http://cgit.freedesktop.org/xorg/lib/libX11/plain/nls/en_US.UTF-8/Compose.pre $@ -data/digraphs-xorg.inc.pl: tools/mkdigraphs-xorg data/xorg-compose + tools/wget-ifmodified http://gitlab.freedesktop.org/xorg/lib/libx11/-/raw/master/nls/en_US.UTF-8/Compose.pre $@ +data/keysymdef.h: $(download) + tools/wget-ifmodified http://gitlab.freedesktop.org/xorg/proto/xorgproto/-/raw/master/include/X11/$(@F) $@ +data/keysymdef.json: tools/mkxkeysymdef data/keysymdef.h + $(call cmdsave,$^) +data/digraphs-xorg.json: tools/mkdigraphs-xorg data/xorg-compose data/keysymdef.json + $(call cmdsave,$^) + +keyboard/symbols/%: tools/mkxkbsymbols data/keyboard/altgr/%.eng.json $(call cmdsave,$^) data/digraphs-vim.inc.pl: tools/mkdigraphs-vim @@ -59,13 +68,13 @@ data/digraphs-plan9.txt: data/digraphs-plan9.inc.pl: tools/mkdigraphs-plan9 data/digraphs-plan9.txt $(call cmdsave,$^) -data/digraphs.inc.pl: tools/mkdigraphlist data/digraphs-rfc.inc.pl data/digraphs-vim.inc.pl data/digraphs-shiar.inc.pl data/unicode-char.inc.pl +data/digraphs.json: tools/mkdigraphlist data/digraphs-rfc.inc.pl data/digraphs-vim.inc.pl data/digraphs-shiar.inc.pl data/unicode-char.inc.pl $(call cmdsave,$<) data/unicode-char.inc.pl: tools/mkcharinfo data/digraphs-rfc.inc.pl data/digraphs-shiar.inc.pl data/unicode-age.inc.pl unicode-table.inc.pl $(call cmdsave,$<) -data/font/%.inc.pl: tools/mkttfinfo data/font/%.ttf +data/font/%.inc.pl: tools/mkttfinfo data/font/%.ttf #TODO ttc $(call cmdsave,$^) || true data/unicode-sampler: $(download) @@ -78,21 +87,24 @@ data/xcolors: $(download) data/termcol-xcolor.inc.pl: tools/mktermcol-xcolor data/xcolors/themes $(call cmdsave,$^/*) +data/camels.pexels-4321178.jpg: + tools/wget-ifmodified https://images.pexels.com/photos/4321178/pexels-photo-4321178.jpeg $@ +data/camels.jpg: data/camels.pexels-4321178.jpg + tools/mkimgthumb --jpg 800x400 'data/camels.smaller:-area:0x225.jpg' . + data/wordlist.version.txt: force @[ -e $@ ] || date -Is >$@ - @perl -ni -I. -MShiar_Sheet::DB -E 'say (Shiar_Sheet::DB->connect->select(word => "max(updated)", \["updated>?", $$_])->list or exit 1)' $@ || true + tools/lastword $@ || true -data/wordlist.inc.pl: tools/mkwordlist data/wordlist.version.txt - $(call cmdsave,$<) data/wordlist.%.inc.pl: tools/mkwordlist data/wordlist.version.txt $(call cmdsave,$< $*) data/word%.json: data/word%.inc.pl - $(call cmdsave,perl -MJSON=encode_json -E "print encode_json(do \$$ARGV[0])" ./$<) + $(call cmdsave,tools/mkjson $<) data/%.json: %.inc.pl - $(call cmdsave,perl -MJSON -E "print JSON->new->utf8->canonical->encode(do \$$ARGV[0])" ./$<) + $(call cmdsave,tools/mkjson $<) data/wordpairs.inc.pl: data/wordlist.version.txt - @perl -I. -MShiar_Sheet::DB -MData::Dump=pp -E 'say pp(Shiar_Sheet::DB->connect->select("word w JOIN word a ON w.id=a.ref" => "w.id, a.id", {"a.lang"=>undef})->map or exit 1)' >$@ + tools/wordpairs >$@ .SECONDARY: data/font/%.ttf data/font/%.ttf: @@ -153,7 +165,7 @@ data/browser/usage-wm.inc.pl: tools/mkusage-wikimedia data/browser/usage-wm.tsv $(call cmdsave,$^) clean: - -rm data/digraphs.inc.pl + -rm data/digraphs.json -rm data/unicode-char.inc.pl -rm data/unicode-age.inc.pl -rm -rf data/font/