-all: sitemap.xml light.css 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
-more: all
+all: sitemap.xml light.css 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))
light.css: tools/stripcss base.css
$(call cmdsave,$^)
+plan.plp: TODO
+ kramdown $< >$@
+
+UPDATE: $(download)
+ $(call cmdsave,git log -1 --date=short --pretty="%ad %s")
+
+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) $@
$(call cmdsave,$^)
data/xorg-compose: $(download)
- tools/wget-ifmodified http://cgit.freedesktop.org/xorg/lib/libX11/plain/nls/en_US.UTF-8/Compose.pre $@
+ 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,$^)
-data/digraphs-xorg.inc.pl: tools/mkdigraphs-xorg data/xorg-compose
+keyboard/symbols/%: tools/mkxkbsymbols data/keyboard/altgr/%.eng.json
$(call cmdsave,$^)
data/digraphs-vim.inc.pl: tools/mkdigraphs-vim
$(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-plan9.txt:
+ tools/wget-ifmodified https://9fans.github.io/usr/local/plan9/lib/keyboard $@
+data/digraphs-plan9.inc.pl: tools/mkdigraphs-plan9 data/digraphs-plan9.txt
+ $(call cmdsave,$^)
+
+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)
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.en.inc.pl: tools/mkwordlist data/wordlist.version.txt
- $(call cmdsave,$<)
data/wordlist.%.inc.pl: tools/mkwordlist data/wordlist.version.txt
$(call cmdsave,$< $*)
-data/wordlist.%.json: data/wordlist.%.inc.pl
- $(call cmdsave,perl -MJSON=encode_json -E "print encode_json(do \$$ARGV[0])" ./$<)
+data/word%.json: data/word%.inc.pl
+ $(call cmdsave,tools/mkjson $<)
+data/%.json: %.inc.pl
+ $(call cmdsave,tools/mkjson $<)
+
+data/wordpairs.inc.pl: data/wordlist.version.txt
+ tools/wordpairs >$@
.SECONDARY: data/font/%.ttf
data/font/%.ttf:
data/font/free%.ttf:
find /usr/share/fonts/truetype/freefont/ -iname "$(@F)" | head -1 | xargs -i ln -sf {} $@
data/font/roboto.ttf:
- ln -sf /usr/share/fonts/truetype/roboto/Roboto-Regular.ttf $@
+ ln -sf /usr/share/fonts/truetype/roboto/unhinted/RobotoTTF/Roboto-Regular.ttf $@
data/font/noto%.ttf:
find /usr/share/fonts/truetype/noto/ -iname "Noto$(*F)-Regular.ttf" | head -1 | xargs -i ln -sf {} $@
$(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/
-rm data/browser/support.inc.pl
-rm data/browser/usage-wm.inc.pl
-.SECONDEXPANSION:
-
-data/writing-latn.inc.pl: tools/perlinc-static $$(@F)
- $(call cmdsave,$^)
-