aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripts/elua/apps/gendoc.sh
blob: f14fcfda6e755d22afa5f43378c9ea7e3d4fc7ea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
# a parallel doc generation script
cd "$(dirname "$(realpath "$0")")";

# exit on failure
set -e

gendoc() {
    elua gendoc.lua --pass $@
}

gendoc rm $@
gendoc ref $@

# limit jobs otherwise stuff starts complaining in eldbus etc
MAXJ=192

I=0
for cl in $(gendoc clist $@); do
    gendoc "$cl" $@ &
    I=$(($I + 1))
    if [ $I -gt $MAXJ ]; then
        I=0
        # wait for the batch to finish
        wait
    fi
done

gendoc types $@ &
gendoc vars $@ &

# wait for all remaining stuff to finish
wait

# final results
gendoc stats $@

exit 0