#!/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" corpora="`ls corpus`" 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 | lulua-analyze combine > \$out pool = write rule write-aljazeera command = find \$in -type f | lulua-write aljazeera \$layout | lulua-analyze combine > \$out pool = write rule write-epub command = find \$in -type f | lulua-write epub \$layout | lulua-analyze combine > \$out pool = write rule write-tanzil command = echo \$in | lulua-write text \$layout | lulua-analyze combine > \$out pool = write rule write-tei2 command = find \$in -type f -name '*.xml' | lulua-write tei2 \$layout | lulua-analyze combine > \$out pool = write rule write-opensubtitles command = find \$in -type f -name '*.xml' | lulua-write opensubtitles \$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 rule analyze-fingerhand command = lulua-analyze -l \$layout fingerhand < \$in > \$out rule analyze-corpusstats command = lulua-analyze -l ar-lulua corpusstats \$metadata < \$stats > \$out rule analyze-corpushtml command = cat \$in | lulua-analyze -l ar-lulua corpushtml > \$out rule wordlist command = lulua-analyze -l ar-lulua latinime < \$in > \$out rule cpp command = gcc -E -x c -nostdinc -MMD -MF \$out.d -C -P -I \$docdir/_temp \$in -o \$out depfile = \$out.d deps = gcc rule cp command = cp \$in \$out rule gz command = gzip -c \$in > \$out ### build targets ### build \$docdir/_build: mkdir build \$docdir/_build/fonts: mkdir build \$docdir/_temp: mkdir build \$docdir/_build/index.html: cpp \$docdir/index.html || \$docdir/_build build \$docdir/_build/letterfreq.json: letterfreq \$statsdir/ar-lulua/all.pickle || \$docdir/_build build \$docdir/_build/style.css: cp \$docdir/style.css || \$docdir/_build build \$docdir/_build/lulua-logo.svg: cp \$docdir/lulua-logo.svg || \$docdir/_build # wordlist build \$docdir/_temp/lulua.combined: wordlist \$statsdir/ar-lulua/all.pickle || \$docdir/_temp build \$docdir/_build/lulua.combined.gz: gz \$docdir/_temp/lulua.combined || \$docdir/_build build \$docdir/_build/fonts/IBMPlexArabic-Regular.woff2: cp \$fontdir/IBMPlexArabic-Regular.woff2 || \$docdir/_build/fonts build \$docdir/_build/fonts/IBMPlexArabic-Thin.woff2: cp \$fontdir/IBMPlexArabic-Thin.woff2 || \$docdir/_build/fonts EOF # targets for every layout for l in $layouts; do cat <