unicode: one set of barb arrows from unicode 7.0
[sheet.git] / Makefile
index 2b1c53163067cac0d1e21d533e254144a3dc4d52..738864709f5a106280dd60190fc4e30461c9d24f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-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 word
+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
 more: all
 
 .PHONY: force # applied to download after 2 hours
@@ -17,7 +17,18 @@ sitemap.xml: tools/mksitemap
 light.css: tools/stripcss base.css
        $(call cmdsave,$^)
 
-word: data/wordlist.en.json data/wordlist.nl.json data/wordlist.ru.json
+plan.plp: TODO
+       kramdown $< >$@
+
+UPDATE: $(download)
+       $(call cmdsave,git log -1 --date=short --pretty="%ad    %s")
+
+word: word/put.min.js data/wordlist.inc.pl 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/DerivedAge.txt: $(download)
        tools/wget-ifmodified http://www.unicode.org/Public/UNIDATA/$(@F) $@
@@ -36,13 +47,17 @@ data/digraphs-shiar.inc.pl: tools/mkdigraphs-shiar shiar.inc.txt
 
 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
        $(call cmdsave,$^)
 
 data/digraphs-vim.inc.pl: tools/mkdigraphs-vim
        $(call cmdsave,$<)
 
+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.inc.pl: tools/mkdigraphlist data/digraphs-rfc.inc.pl data/digraphs-vim.inc.pl data/digraphs-shiar.inc.pl data/unicode-char.inc.pl
        $(call cmdsave,$<)
 
@@ -66,13 +81,16 @@ 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
 
-data/wordlist.en.inc.pl: tools/mkwordlist data/wordlist.version.txt
+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/wordlist.%.json: data/wordlist.%.inc.pl
+data/word%.json: data/word%.inc.pl
        $(call cmdsave,perl -MJSON=encode_json -E "print encode_json(do \$$ARGV[0])" ./$<)
 
+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)' >$@
+
 .SECONDARY: data/font/%.ttf
 data/font/%.ttf:
        find /usr/share/fonts/truetype/ ~/.fonts/ -iname "$(@F)" | head -1 | xargs -i ln -sf {} $@