diff options
-rw-r--r-- | README.rst | 6 | ||||
-rwxr-xr-x | gen.sh | 58 |
2 files changed, 33 insertions, 31 deletions
@@ -47,7 +47,7 @@ issues. Then simply run ./gen.sh > build.ninja && ninja -to analyze them and create pretty pictures as well as statistics in ``doc/``. +to analyze them and create pretty pictures as well as statistics in ``_build/report``. .. _me: lars+lulua@6xq.net @@ -65,11 +65,11 @@ Share the folder `doc/_temp/winkbd` with a Windows system, install `Microsoft Keyboard Layout Creator 1.4`_ (MSKLC; the Windows Driver Kit (WDK) would work too, but is much larger), adjust ``make.bat`` pointing to your MSKLC installation and run it. This should generate two directories, ``System32`` and -``SysWOW64``, which must be copied back to `doc/_temp/winkbd`. Then run: +``SysWOW64``, which must be copied back to `_build/_temp/winkbd`. Then run: .. code:: bash - ninja doc/_build/ar-lulua-w64.zip + ninja _build/report/ar-lulua-w64.zip .. _Microsoft Keyboard Layout Creator 1.4: https://www.microsoft.com/en-us/download/details.aspx?id=22339 @@ -1,18 +1,20 @@ #!/bin/sh # Generate build.ninja that builds the docs/stats/… +corpusdir=corpus layouts="ar-lulua ar-asmo663 ar-linux ar-malas ar-phonetic ar-osman ar-khorshid" layoutsXmodmap="ar-lulua" -corpora="`ls corpus`" +corpora="`ls ${corpusdir}`" cat <<EOF ### auto-generated by gen.sh. Do not edit. ### ### settings ### +reportdir=_build/report +tempdir=_build/_temp datadir=lulua/data -corpusdir=corpus +corpusdir=${corpusdir} statsdir=stats -docdir=doc wikiextractor=3rdparty/wikiextractor/WikiExtractor.py osmconvert=3rdparty/osmctools/src/osmconvert fontdir=3rdparty/plex/IBM-Plex-Sans-Arabic/fonts/complete/woff2/ @@ -115,37 +117,37 @@ rule render-winkbd command = lulua-render -l ar-lulua winkbd \$out ### build targets ### -build \$docdir/_build: mkdir -build \$docdir/_build/fonts: mkdir -build \$docdir/_temp: mkdir -build \$docdir/_build/letterfreq.json: letterfreq \$statsdir/ar-lulua/all.pickle || \$docdir/_build -build \$docdir/_build/style.css: cp \$datadir/report/style.css || \$docdir/_build -build \$docdir/_build/lulua-logo.svg: cp \$datadir/report/lulua-logo.svg || \$docdir/_build +build \$reportdir: mkdir +build \$reportdir/fonts: mkdir +build \$tempdir: mkdir +build \$reportdir/letterfreq.json: letterfreq \$statsdir/ar-lulua/all.pickle || \$reportdir +build \$reportdir/style.css: cp \$datadir/report/style.css || \$reportdir +build \$reportdir/lulua-logo.svg: cp \$datadir/report/lulua-logo.svg || \$reportdir # 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 \$tempdir/lulua.combined: wordlist \$statsdir/ar-lulua/all.pickle || \$tempdir +build \$reportdir/lulua.combined.gz: gz \$tempdir/lulua.combined || \$reportdir -build \$docdir/_build/fonts/IBMPlexSansArabic-Regular.woff2: cp \$fontdir/IBMPlexSansArabic-Regular.woff2 || \$docdir/_build/fonts -build \$docdir/_build/fonts/IBMPlexSansArabic-Thin.woff2: cp \$fontdir/IBMPlexSansArabic-Thin.woff2 || \$docdir/_build/fonts +build \$reportdir/fonts/IBMPlexSansArabic-Regular.woff2: cp \$fontdir/IBMPlexSansArabic-Regular.woff2 || \$reportdir/fonts +build \$reportdir/fonts/IBMPlexSansArabic-Thin.woff2: cp \$fontdir/IBMPlexSansArabic-Thin.woff2 || \$reportdir/fonts # build osmconvert build \$osmconvert: configure-make 3rdparty/osmctools # windows drivers -build \$docdir/_temp/winkbd: cpR lulua/data/winkbd -build \$docdir/_temp/winkbd/customization.h: render-winkbd || \$docdir/_temp/winkbd -build \$docdir/_temp/ar-lulua-w64: mkdir +build \$tempdir/winkbd: cpR lulua/data/winkbd +build \$tempdir/winkbd/customization.h: render-winkbd || \$tempdir/winkbd +build \$tempdir/ar-lulua-w64: mkdir EOF w64zipfile="System32/kbdarlulua.dll SysWOW64/kbdarlulua.dll README.txt lulua.reg install.bat" deps="" for f in $w64zipfile; do - echo "build \$docdir/_temp/ar-lulua-w64/$f: cp \$docdir/_temp/winkbd/$f || \$docdir/_temp/ar-lulua-w64" - deps+=" \$docdir/_temp/ar-lulua-w64/$f" + echo "build \$tempdir/ar-lulua-w64/$f: cp \$tempdir/winkbd/$f || \$tempdir/ar-lulua-w64" + deps+=" \$tempdir/ar-lulua-w64/$f" done cat <<EOF -build \$docdir/_build/ar-lulua-w64.zip: zipR \$docdir/_temp/ar-lulua-w64 | $deps +build \$reportdir/ar-lulua-w64.zip: zipR \$tempdir/ar-lulua-w64 | $deps EOF @@ -180,27 +182,27 @@ build \$statsdir/${l}/opensubtitles-2018.pickle: write-opensubtitles \$corpusdir build \$statsdir/${l}/all.pickle: combine \$statsdir/${l}/bbcarabic.pickle \$statsdir/${l}/aljazeera.pickle \$statsdir/${l}/tanzil-quaran.pickle \$statsdir/${l}/arwiki.pickle \$statsdir/${l}/osm.pickle \$statsdir/${l}/hindawi.pickle \$statsdir/${l}/un-v1.0-tei.pickle \$statsdir/${l}/opensubtitles-2018.pickle || \$statsdir/${l} -build \$docdir/_build/${l}.svg: render-svg || \$docdir/_build +build \$reportdir/${l}.svg: render-svg || \$reportdir layout = ${l} -build \$docdir/_temp/${l}-heat.yaml: analyze-heat \$statsdir/${l}/all.pickle || \$docdir/_temp +build \$tempdir/${l}-heat.yaml: analyze-heat \$statsdir/${l}/all.pickle || \$tempdir layout = ${l} -build \$docdir/_build/${l}-heat.svg: render-svg-heat \$docdir/_temp/${l}-heat.yaml || \$docdir/_build +build \$reportdir/${l}-heat.svg: render-svg-heat \$tempdir/${l}-heat.yaml || \$reportdir layout = ${l} -build \$docdir/_temp/${l}-layoutstats.pickle: analyze-layoutstats \$statsdir/${l}/all.pickle || \$docdir/_temp +build \$tempdir/${l}-layoutstats.pickle: analyze-layoutstats \$statsdir/${l}/all.pickle || \$tempdir layout = ${l} EOF # included by index.html and thus must be its dependencies -layoutstatsfiles+=" \$docdir/_temp/${l}-layoutstats.pickle" +layoutstatsfiles+=" \$tempdir/${l}-layoutstats.pickle" done # layouts with xmodmap support for l in $layoutsXmodmap; do cat <<EOF -build \$docdir/_build/${l}.xmodmap: render-xmodmap || \$docdir/_build +build \$reportdir/${l}.xmodmap: render-xmodmap || \$reportdir layout = ${l} EOF @@ -210,18 +212,18 @@ done metafiles="" for c in $corpora; do cat <<EOF -build \$docdir/_temp/metadata-$c.yaml: analyze-corpusstats \$statsdir/ar-lulua/$c.pickle \$corpusdir/$c/metadata.yaml || \$docdir/_temp \$corpusdir/$c/metadata.yaml +build \$tempdir/metadata-$c.yaml: analyze-corpusstats \$statsdir/ar-lulua/$c.pickle \$corpusdir/$c/metadata.yaml || \$tempdir \$corpusdir/$c/metadata.yaml metadata = \$corpusdir/$c/metadata.yaml stats = \$statsdir/ar-lulua/$c.pickle EOF -metafiles+=" \$docdir/_temp/metadata-$c.yaml" +metafiles+=" \$tempdir/metadata-$c.yaml" done # dependencies are not properly modeled, always rebuild cat <<EOF build always: phony -build \$docdir/_build/index.html: report | always || \$docdir/_build $metafiles $layoutstatsfiles +build \$reportdir/index.html: report | always || \$reportdir $metafiles $layoutstatsfiles corpus = $metafiles layoutstats = $layoutstatsfiles EOF |