-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakedox
executable file
·100 lines (84 loc) · 2.07 KB
/
makedox
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/env bash
usage()
{
echo "Usage: $0 [ <branch> | -v <quda-version> ]"
}
if [ $# -eq 0 ]; then
snapshot=true
branch=main
elif [ $# -eq 1 ]; then
snapshot=true
branch=$1
elif [ $# -eq 2 ]; then
if [ $1 != "-v" ]; then
usage
exit 1
fi
snapshot=false
ver=$2
else
usage
exit 1
fi
if [ $snapshot == "true" ]; then
date=`date '+%Y-%m-%d'`
workdir="quda_${branch}_$date"
outdir="snapshot"
url="https://github.com/lattice/quda/tarball/$branch"
else
workdir="quda_v$ver"
outdir="v$ver"
url="http://lattice.github.io/downloads/quda/quda-$ver.tar.gz"
fi
echo "Creating directory $workdir ..."
if [ -e $workdir ]; then
echo "Error: File or directory $workdir already exists."
exit 1
fi
mkdir $workdir
cd $workdir
# Some versions of wget are finnicky about using the filename reported by
# the server after a redirect.
wopt=
if wget --help | grep 'trust-server-names'; then
wopt="$wopt --trust-server-names"
fi
if wget --help | grep 'content-disposition'; then
wopt="$wopt --content-disposition"
fi
echo "Retrieving tar file ..."
wget --no-check-certificate $wopt $url || exit
tarfile=`find . -name *.tar.gz -print`
tarfile=${tarfile/#.\/}
tardir=${tarfile/%.tar.gz}
if [ "X$tardir" == "X" ]; then
echo "Error: tarball not found."
exit 1
fi
echo "Untarring ..."
tar xzf $tarfile
if [ ! -d $tardir ]; then
echo "Error: Untarred directory not found."
exit 1
fi
mv $tardir quda
echo "Fixing up source ..."
cat ../mainpage.h >> quda/include/quda.h || exit
if [ $snapshot == true ]; then
tag=${tardir/lattice-quda-}
tag="snapshot of branch $branch: `date` ($tag)"
else
tag="v$ver"
fi
echo "Generating doxygen configuration file ..."
sed "s/_PROJECT_NUMBER_/\"$tag\"/; s/_HTML_OUTPUT_/\"$outdir\"/" \
../quda.Doxyfile.in > quda.Doxyfile
echo "Running doxygen ..."
if ! doxygen quda.Doxyfile > doxygen.out 2>&1; then
echo "Error: doxygen failed. See $workdir/doxygen.out"
exit
fi
echo "Success! HTML is in $workdir/$outdir/"
echo
echo "URL: file://$PWD/$outdir/index.html"
echo