1 all: sitemap.xml light.css plan.plp UPDATE data cache
3 .PHONY: force # applied to download after 2 hours
4 download := $(shell [ -z $$(find data/download -mmin -120) ] && (touch data/download && echo force))
6 # atomically create file by command
7 cmdsave = @echo '$1' $2 \>$@; mispipe '$1 $2' 'ifne sponge $@'
8 # download git checkout
9 gitsave = @if cd $@ 2>/dev/null; \
10 then echo git pull $@; git pull -q --ff-only || true; \
11 else echo git clone $1 $@; git clone -q --progress $1 $@; fi
13 sitemap.xml: tools/mksitemap
16 light.css: tools/stripcss base.css
23 $(call cmdsave,git log -1 --date=short --pretty="%ad %s")
25 cache: $(patsubst %.inc.pl,data/%.json,$(wildcard charset-*.inc.pl) $(wildcard keyboard/altgr/*.inc.pl) writing-latn.inc.pl)
26 word: word/put.min.js data/wordlist.en.json data/wordlist.nl.json data/wordlist.ru.json data/wordpairs.json
28 word/put.js: $(download)
29 tools/wget-ifmodified https://github.com/kriszyp/put-selector/raw/master/put.js $@
30 word/%.min.js: word/%.js
31 uglifyjs -m '' $< -o $@
33 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
35 data/DerivedAge.txt: $(download)
36 tools/wget-ifmodified http://www.unicode.org/Public/UNIDATA/$(@F) $@
38 data/unicode-age.inc.pl: tools/mkcharver data/DerivedAge.txt
41 data/rfc1345.txt: $(download)
42 tools/wget-ifmodified http://www.ietf.org/rfc/$(@F) $@
44 data/digraphs-rfc.inc.pl: tools/mkdigraphs-rfc data/rfc1345.txt
47 data/digraphs-shiar.inc.pl: tools/mkdigraphs-shiar shiar.inc.txt
50 data/xorg-compose: $(download)
51 tools/wget-ifmodified http://gitlab.freedesktop.org/xorg/lib/libx11/-/raw/master/nls/en_US.UTF-8/Compose.pre $@
52 data/keysymdef.h: $(download)
53 tools/wget-ifmodified http://gitlab.freedesktop.org/xorg/proto/xorgproto/-/raw/master/include/X11/$(@F) $@
54 data/keysymdef.json: tools/mkxkeysymdef data/keysymdef.h
56 data/digraphs-xorg.json: tools/mkdigraphs-xorg data/xorg-compose data/keysymdef.json
59 keyboard/symbols/%: tools/mkxkbsymbols data/keyboard/altgr/%.eng.json
62 data/digraphs-vim.inc.pl: tools/mkdigraphs-vim
65 data/digraphs-plan9.txt:
66 tools/wget-ifmodified https://9fans.github.io/usr/local/plan9/lib/keyboard $@
67 data/digraphs-plan9.inc.pl: tools/mkdigraphs-plan9 data/digraphs-plan9.txt
70 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
73 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
76 data/font/%.inc.pl: tools/mkttfinfo data/font/%.ttf #TODO ttc
77 $(call cmdsave,$^) || true
79 data/unicode-sampler: $(download)
80 $(call gitsave,git://git.shiar.nl/unicode-sampler)
82 data/xcolors/themes: data/xcolors
83 data/xcolors: $(download)
84 $(call gitsave,https://github.com/tlatsas/xcolors)
86 data/termcol-xcolor.inc.pl: tools/mktermcol-xcolor data/xcolors/themes
89 data/wordlist.version.txt: force
90 @[ -e $@ ] || date -Is >$@
91 tools/lastword $@ || true
93 data/wordlist.%.inc.pl: tools/mkwordlist data/wordlist.version.txt
95 data/word%.json: data/word%.inc.pl
96 $(call cmdsave,tools/mkjson $<)
98 $(call cmdsave,tools/mkjson $<)
100 data/wordpairs.inc.pl: data/wordlist.version.txt
103 .SECONDARY: data/font/%.ttf
105 find /usr/share/fonts/truetype/ ~/.fonts/ -iname "$(@F)" | head -1 | xargs -i ln -sf {} $@
106 data/font/%.win2k.ttf:
107 find /usr/share/fonts/truetype/msttcorefonts/ -iname "$(*F).ttf" | head -1 | xargs -i ln -sf {} $@
109 find /usr/share/fonts/truetype/dejavu/ -iname "DejaVu*$(*F).ttf" | head -1 | xargs -i ln -sf {} $@
110 data/font/droid%.ttf:
111 find /usr/share/fonts/truetype/droid/ -iname "Droid*$(*F).ttf" | head -1 | xargs -i ln -sf {} $@
112 data/font/droidserif.ttf:
113 ln -sf /usr/share/fonts/truetype/droid/DroidSerif-Regular.ttf $@
115 find /usr/share/fonts/truetype/freefont/ -iname "$(@F)" | head -1 | xargs -i ln -sf {} $@
116 data/font/roboto.ttf:
117 ln -sf /usr/share/fonts/truetype/roboto/unhinted/RobotoTTF/Roboto-Regular.ttf $@
119 find /usr/share/fonts/truetype/noto/ -iname "Noto$(*F)-Regular.ttf" | head -1 | xargs -i ln -sf {} $@
121 data/font: tools/mkttfinfo
123 $(MAKE) data/font/all
126 data/font/all: data/font/all-win2k data/font/all-dejavu data/font/all-google data/font/all-other
127 data/font/all-win2k: data/font/verdana.win2k.inc.pl data/font/times.win2k.inc.pl data/font/arial.win2k.inc.pl data/font/cour.win2k.inc.pl data/font/comic.win2k.inc.pl data/font/georgia.win2k.inc.pl data/font/arialuni.inc.pl
128 data/font/all-dejavu: data/font/dvsans.inc.pl data/font/dvserif.inc.pl data/font/dvmono.inc.pl
129 data/font/all-google: data/font/droidsans.inc.pl data/font/droidserif.inc.pl data/font/droidmono.inc.pl data/font/roboto.inc.pl data/font/notosans.inc.pl data/font/notoserif.inc.pl
130 data/font/all-other: data/font/unifont.inc.pl data/font/code2000.inc.pl data/font/freesans.inc.pl data/font/freeserif.inc.pl
132 #data/font/unifont.inc.pl: tools/mkttfinfo
134 # $< --headless unifont_upper.ttf >>$@
136 data/unicode-cover.inc.pl: tools/mkfontinfo data/font # $(wildcard data/font/*.inc.pl)
139 data/countryInfo.txt: $(download)
140 tools/wget-ifmodified http://download.geonames.org/export/dump/$(@F) $@
142 data/countries.inc.pl: tools/mkcountries-geonames data/countryInfo.txt
145 data/browser: data/browser/support.inc.pl data/browser/usage-wm.inc.pl
147 data/browser/caniuse/fulldata-json/data-2.0.json: data/browser/caniuse
148 data/browser/caniuse/data.json: data/browser/caniuse
149 data/browser/caniuse: $(download)
150 $(call gitsave,https://github.com/Fyrd/caniuse.git)
152 data/browser/support.inc.pl: tools/mkcaniuse data/browser/caniuse/fulldata-json/data-2.0.json
155 data/browser/usage-wm.tsv: $(download)
156 tools/wget-ifmodified https://analytics.wikimedia.org/datasets/periodic/reports/metrics/browser/all_sites_by_browser_family_and_major_percent.tsv $@
158 data/browser/usage-wm.inc.pl: tools/mkusage-wikimedia data/browser/usage-wm.tsv
162 -rm data/digraphs.json
163 -rm data/unicode-char.inc.pl
164 -rm data/unicode-age.inc.pl
166 -rm data/unicode-cover.inc.pl
167 -rm data/browser/support.inc.pl
168 -rm data/browser/usage-wm.inc.pl