keyboard/altgr: photos of relevant reallife keys as og:image
[sheet.git] / Makefile
index 75f269b81c478281499b4abfc9d75470a402262d..7d1e2e35e122db0a6baf51402cfbf275365eeefc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,4 @@
-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 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))
@@ -23,7 +22,7 @@ plan.plp: TODO
 UPDATE: $(download)
        $(call cmdsave,git log -1 --date=short --pretty="%ad    %s")
 
-cache: data/writing-latn.json
+cache: $(patsubst %.inc.pl,data/%.json,$(wildcard charset-*.inc.pl) writing-latn.inc.pl)
 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)
@@ -31,6 +30,8 @@ word/put.js: $(download)
 word/%.min.js: word/%.js
        uglifyjs -m '' $< -o $@
 
+data: 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 data/unicode-sampler word
+
 data/DerivedAge.txt: $(download)
        tools/wget-ifmodified http://www.unicode.org/Public/UNIDATA/$(@F) $@
 
@@ -65,7 +66,7 @@ data/digraphs.inc.pl: tools/mkdigraphlist data/digraphs-rfc.inc.pl data/digraphs
 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)
@@ -80,7 +81,7 @@ data/termcol-xcolor.inc.pl: tools/mktermcol-xcolor data/xcolors/themes
 
 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,$<)
@@ -89,10 +90,10 @@ data/wordlist.%.inc.pl: tools/mkwordlist data/wordlist.version.txt
 data/word%.json: data/word%.inc.pl
        $(call cmdsave,perl -MJSON=encode_json -E "print encode_json(do \$$ARGV[0])" ./$<)
 data/%.json: %.inc.pl
-       $(call cmdsave,perl -MJSON=encode_json -E "print encode_json([ do \$$ARGV[0] ])" ./$<)
+       $(call cmdsave,perl -MJSON -E "print JSON->new->utf8->canonical->encode(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)' >$@
+       tools/wordpairs >$@
 
 .SECONDARY: data/font/%.ttf
 data/font/%.ttf: