1 all: sitemap.xml style 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 style: light.css sc.css
17 %.css: style/%.scss $(wildcard style/_*.scss)
18 $(call cmdsave,sassc -t compressed $< | perl -pE 's/\}+\K/\n/g')
24 $(call cmdsave,git log -1 --date=short --pretty='%ad %s')
26 cache: $(patsubst %.inc.pl,data/%.json,$(wildcard charset-*.inc.pl) $(wildcard keyboard/altgr/*.inc.pl) writing-latn.inc.pl)
27 word: word/put.min.js data/wordlist.en.json data/wordlist.nl.json data/wordlist.ru.json data/wordpairs.json
29 word/put.js: $(download)
30 tools/wget-ifmodified https://github.com/kriszyp/put-selector/raw/master/put.js $@
31 word/%.min.js: word/%.js
32 uglifyjs -m '' $< -o $@
34 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
36 data/DerivedAge.txt: $(download)
37 tools/wget-ifmodified http://www.unicode.org/Public/UNIDATA/$(@F) $@
39 data/unicode-age.inc.pl: tools/mkcharver data/DerivedAge.txt
42 data/rfc1345.txt: $(download)
43 tools/wget-ifmodified http://www.ietf.org/rfc/$(@F) $@
45 data/digraphs-rfc.inc.pl: tools/mkdigraphs-rfc data/rfc1345.txt
48 data/digraphs-shiar.inc.pl: tools/mkdigraphs-shiar shiar.inc.txt
51 data/xorg-compose: $(download)
52 tools/wget-ifmodified http://gitlab.freedesktop.org/xorg/lib/libx11/-/raw/master/nls/en_US.UTF-8/Compose.pre $@
53 data/keysymdef.h: $(download)
54 tools/wget-ifmodified http://gitlab.freedesktop.org/xorg/proto/xorgproto/-/raw/master/include/X11/$(@F) $@
55 data/keysymdef.json: tools/mkxkeysymdef data/keysymdef.h
57 data/digraphs-xorg.json: tools/mkdigraphs-xorg data/xorg-compose data/keysymdef.json
60 keyboard/symbols/%: tools/mkxkbsymbols data/keyboard/altgr/%.eng.json
63 data/digraphs-vim.inc.pl: tools/mkdigraphs-vim
66 data/digraphs-plan9.txt:
67 tools/wget-ifmodified https://9fans.github.io/usr/local/plan9/lib/keyboard $@
68 data/digraphs-plan9.inc.pl: tools/mkdigraphs-plan9 data/digraphs-plan9.txt
71 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
74 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
77 data/font/%.inc.pl: tools/mkttfinfo data/font/%.ttf #TODO ttc
78 $(call cmdsave,$^) || true
80 data/unicode-sampler: $(download)
81 $(call gitsave,git://git.shiar.nl/unicode-sampler)
83 data/xcolors/themes: data/xcolors
84 data/xcolors: $(download)
85 $(call gitsave,https://github.com/tlatsas/xcolors)
87 data/termcol-xcolor.inc.pl: tools/mktermcol-xcolor data/xcolors/themes
90 data/camels.pexels-4321178.jpg:
91 tools/wget-ifmodified https://images.pexels.com/photos/4321178/pexels-photo-4321178.jpeg $@
92 data/camels.jpg: data/camels.pexels-4321178.jpg
93 tools/mkimgthumb --jpg 800x400 'data/camels.smaller:-area:0x225.jpg' .
95 data/wordlist.version.txt: force
96 @[ -e $@ ] || date -Is >$@
97 tools/lastword $@ || true
99 data/wordlist.%.inc.pl: tools/mkwordlist data/wordlist.version.txt
100 $(call cmdsave,$< $*)
101 data/word%.json: data/word%.inc.pl
102 $(call cmdsave,tools/mkjson $<)
103 data/%.json: %.inc.pl
104 $(call cmdsave,tools/mkjson $<)
106 data/wordpairs.inc.pl: data/wordlist.version.txt
109 .SECONDARY: data/font/%.ttf
111 find /usr/share/fonts/truetype/ ~/.fonts/ -iname "$(@F)" | head -1 | xargs -i ln -sf {} $@
112 data/font/%.win2k.ttf:
113 find /usr/share/fonts/truetype/msttcorefonts/ -iname "$(*F).ttf" | head -1 | xargs -i ln -sf {} $@
115 find /usr/share/fonts/truetype/dejavu/ -iname "DejaVu*$(*F).ttf" | head -1 | xargs -i ln -sf {} $@
116 data/font/droid%.ttf:
117 find /usr/share/fonts/truetype/droid/ -iname "Droid*$(*F).ttf" | head -1 | xargs -i ln -sf {} $@
118 data/font/droidserif.ttf:
119 ln -sf /usr/share/fonts/truetype/droid/DroidSerif-Regular.ttf $@
121 find /usr/share/fonts/truetype/freefont/ -iname "$(@F)" | head -1 | xargs -i ln -sf {} $@
122 data/font/roboto.ttf:
123 ln -sf /usr/share/fonts/truetype/roboto/unhinted/RobotoTTF/Roboto-Regular.ttf $@
125 find /usr/share/fonts/truetype/noto/ -iname "Noto$(*F)-Regular.ttf" | head -1 | xargs -i ln -sf {} $@
127 data/font: tools/mkttfinfo
129 $(MAKE) data/font/all
132 data/font/all: data/font/all-win2k data/font/all-dejavu data/font/all-google data/font/all-other
133 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
134 data/font/all-dejavu: data/font/dvsans.inc.pl data/font/dvserif.inc.pl data/font/dvmono.inc.pl
135 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
136 data/font/all-other: data/font/unifont.inc.pl data/font/code2000.inc.pl data/font/freesans.inc.pl data/font/freeserif.inc.pl
138 #data/font/unifont.inc.pl: tools/mkttfinfo
140 # $< --headless unifont_upper.ttf >>$@
142 data/unicode-cover.inc.pl: tools/mkfontinfo data/font # $(wildcard data/font/*.inc.pl)
145 data/countryInfo.txt: $(download)
146 tools/wget-ifmodified http://download.geonames.org/export/dump/$(@F) $@
148 data/countries.inc.pl: tools/mkcountries-geonames data/countryInfo.txt
151 data/browser: data/browser/support.inc.pl data/browser/usage-wm.inc.pl
153 data/browser/caniuse/fulldata-json/data-2.0.json: data/browser/caniuse
154 data/browser/caniuse/data.json: data/browser/caniuse
155 data/browser/caniuse: $(download)
156 $(call gitsave,https://github.com/Fyrd/caniuse.git)
158 data/browser/support.inc.pl: tools/mkcaniuse data/browser/caniuse/fulldata-json/data-2.0.json
161 data/browser/usage-wm.tsv: $(download)
162 tools/wget-ifmodified https://analytics.wikimedia.org/datasets/periodic/reports/metrics/browser/all_sites_by_browser_family_and_major_percent.tsv $@
164 data/browser/usage-wm.inc.pl: tools/mkusage-wikimedia data/browser/usage-wm.tsv
168 -rm data/digraphs.json
169 -rm data/unicode-char.inc.pl
170 -rm data/unicode-age.inc.pl
172 -rm data/unicode-cover.inc.pl
173 -rm data/browser/support.inc.pl
174 -rm data/browser/usage-wm.inc.pl