-
Notifications
You must be signed in to change notification settings - Fork 51
/
do_generate
executable file
·45 lines (39 loc) · 1.05 KB
/
do_generate
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
39
40
41
42
43
44
45
#!/usr/bin/env bash
#
# Copyright © 2014 Jesse 'Jeaye' Wilkerson
# See licensing in LICENSE file, or at:
# http://www.opensource.org/licenses/MIT
#
# File: do_generate
# Author: Jesse 'Jeaye' Wilkerson
# XXX: Do not call this script directly: use `make generate`
set -o nounset
function check_existence
{
printf "Checking for $1... "
which $1 > /dev/null 2>&1
exists=$?
if [ "$exists" -eq "0" ];
then
echo "found" 1>&2
else
echo "not found; make sure it's in PATH" 1>&2
echo "Error: manual generation will not work"
exit 1
fi
}
check_existence "elinks"
check_existence "gzip"
echo "Generating from $reference to $tmp_man"
echo " Removing previous files"
rm -f $tmp_man/*.3
echo " Parsing documentation on $threads threads"
find $reference -print0 | xargs -0 -n 1 -P $threads -I % \
./bin/stdman -d $tmp_man % > /dev/null 2>&1
echo " Removing unwanted pages"
for file in $(find $tmp_man -name '*.3' | grep -v "std::") ; do
rm -f $file;
done
echo " Creating links for common typedefs"
./do_link $tmp_man
echo "Done generating"