From 13c7f8418e265000e472e284089474d63ccbbb39 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Thu, 3 Oct 2019 09:12:58 +0200 Subject: Replace Makefile with ninja Also generate and use heatmaps for all layouts by default. --- gen.sh | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100755 gen.sh (limited to 'gen.sh') diff --git a/gen.sh b/gen.sh new file mode 100755 index 0000000..b9b9028 --- /dev/null +++ b/gen.sh @@ -0,0 +1,109 @@ +#!/bin/sh +# Generate build.ninja that builds the docs/stats/… + +layouts="ar-lulua ar-asmo663 ar-linux ar-malas ar-phonetic ar-osman ar-khorshid" +layoutsXmodmap="ar-lulua" + +cat < \$out + +rule render-svg + command = lulua-render -l \$layout svg \$out + +rule render-svg-heat + command = lulua-render -l \$layout svg --heatmap=\$in \$out + +rule render-xmodmap + command = lulua-render -l \$layout xmodmap \$out + +rule analyze-heat + command = lulua-analyze -l \$layout keyheatmap < \$in > \$out + +rule write-bbcarabic + command = find \$in -type f | lulua-write bbcarabic \$layout > \$out + pool = write + +rule write-aljazeera + command = find \$in -type f | lulua-write aljazeera \$layout > \$out + pool = write + +rule write-tanzil + command = echo \$in | lulua-write text \$layout | lulua-analyze combine > \$out + pool = write + +rule write-arwiki + command = \$wikiextractor -ns 0 --json -o - \$in 2>/dev/null | jq .text | lulua-write json \$layout | lulua-analyze combine > \$out + pool = write + +rule combine + command = cat \$in | lulua-analyze combine > \$out + +rule mkdir + command = mkdir -p \$out + +rule letterfreq + command = lulua-analyze -l ar-lulua letterfreq < \$in > \$out + +### build targets ### +build \$docdir/letterfreq.json: letterfreq \$statsdir/ar-lulua/all.pickle + +EOF + +for l in $layouts; do +cat <