index: release v1.18 with only altgr index linked
[sheet.git] / Makefile
index 99e8db227b488cdec9730b13beb14abf8f9db400..df6cbe5bab35d15e5837a61ca3d67c2f711a6e59 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +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
-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))
@@ -17,6 +16,22 @@ sitemap.xml: tools/mksitemap
 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
+
 data/DerivedAge.txt: $(download)
        tools/wget-ifmodified http://www.unicode.org/Public/UNIDATA/$(@F) $@
 
@@ -33,21 +48,29 @@ 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,$^)
 
 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)
@@ -62,12 +85,17 @@ 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.en.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,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:
@@ -83,7 +111,7 @@ data/font/droidserif.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 {} $@
 
@@ -102,7 +130,7 @@ data/font/all-other: data/font/unifont.inc.pl data/font/code2000.inc.pl data/fon
 #      $< unifont.ttf $@
 #      $< --headless unifont_upper.ttf >>$@
 
-data/unicode-cover.inc.pl: tools/mkfontinfo data/font $(patsubst data/font/%.ttf,data/font/%.inc.pl,$(wildcard data/font/*.ttf))
+data/unicode-cover.inc.pl: tools/mkfontinfo data/font # $(wildcard data/font/*.inc.pl)
        $(call cmdsave,$<)
 
 data/countryInfo.txt: $(download)
@@ -128,7 +156,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/
@@ -136,8 +164,3 @@ clean:
        -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,$^)
-