aboutsummaryrefslogtreecommitdiff
path: root/configure
blob: 00d5722e7d13cc5c0ae456e3ef6443efd27c1567 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

python3 --version >/dev/null || ( echo "Install python3" && exit 1 )
pdftex --version >/dev/null || ( echo "Install pdftex (TeXLive)" && exit 1 )
make -v >/dev/null || ( echo "Install make" && exit 1 )
python -c "import numpy" >/dev/null || ( echo "Install numpy" && exit 1 )
python -c "import scipy" >/dev/null || ( echo "Install scipy" && exit 1 )
python -c "import matplotlib" >/dev/null || ( echo "Install matplotlib" && exit 1 )
gs --version >/dev/null || echo "Ghostscript not installed (no PNG poster)"

cp Makefile.orig Makefile

for tgt in */document.tex; do
    DIR=$(dirname $tgt)
    ( echo -en "\n${DIR}/document.pdf: ${DIR}/document.tex "; find $DIR \!\
 -type d \! -name "document.tex" -a -name "*.tex" -exec echo {} +; ) >> Makefile
    echo -e "\noutputs/${DIR}.pdf: ${DIR}/document.pdf outputs\n\tcp -f $< \$@"\
    >> Makefile
done

for gen in gen/*.orig.tex; do
    BASE=$(basename $gen .orig.tex)
    echo "gen/${BASE}.tex: gen/make${BASE}.sh gen/${BASE}.orig.tex" >> Makefile
done