Mercurial > hg > kdocs
annotate make/make.sh @ 81:6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 23 Oct 2007 18:35:49 -0500 |
parents | 3232f421c770 |
children | 13a980b307f8 |
rev | line source |
---|---|
1
34a037d461f9
Some random infrastructure to build documentation from source.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 #!/bin/bash |
34a037d461f9
Some random infrastructure to build documentation from source.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
81
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
3 # Set environment variables and call do-*.sh in sequence |
29
c91c3395876f
Produce better menuconfig output, now in multiple files and with concise
Rob Landley <rob@landley.net>
parents:
28
diff
changeset
|
4 |
81
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
5 [ -z "$WEBDIR" ] && export WEBDIR=~/www/kdocs |
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
6 [ -z "$LNXDIR" ] && export LNXDIR=~/linux |
51
93c68f362860
New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
49
diff
changeset
|
7 |
81
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
8 # Update mercurial repository |
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
9 if [ "$1" != "--nonet" ] |
51
93c68f362860
New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
49
diff
changeset
|
10 then |
81
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
11 "$WEBDIR"/make/do-gethg.sh || exit 1 |
51
93c68f362860
New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
49
diff
changeset
|
12 fi |
93c68f362860
New script to download OLS files (and others), and split up volumes into
Rob Landley <rob@landley.net>
parents:
49
diff
changeset
|
13 |
81
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
14 echo -n "Grab version number..." |
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
15 export LNXTAG="$(hg tags | head -n 2 | tail -n 1 | awk '{print $1}')" |
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
16 echo $LNXTAG |
36
9a5ef2d1264e
Call indexsections.py and work around a bug in xmlto.
Rob Landley <rob@landley.net>
parents:
32
diff
changeset
|
17 |
81
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
18 echo "Update master index." |
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
19 "$WEBDIR"/make/do-master.sh || exit 1 |
36
9a5ef2d1264e
Call indexsections.py and work around a bug in xmlto.
Rob Landley <rob@landley.net>
parents:
32
diff
changeset
|
20 |
81
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
21 echo "Mirror resources" |
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
22 "$WEBDIR"/make/do-mirror.sh || exit 1 |
38
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
23 |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
24 echo Copy readme files from Linux kernel |
81
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
25 "$WEBDIR"/make/do-readme.sh || exit 1 |
32
6f30fdd28dab
Add a few google videos, and the README files from the kernel source.
Rob Landley <rob@landley.net>
parents:
29
diff
changeset
|
26 |
26
3c78854053e3
A script to convert menuconfig to html. Have make.sh call it for all $ARCH.
Rob Landley <rob@landley.net>
parents:
12
diff
changeset
|
27 echo Convert kconfig to html for all architectures |
81
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
28 "$WEBDIR"/make/do-menuconfig.sh || exit 1 |
26
3c78854053e3
A script to convert menuconfig to html. Have make.sh call it for all $ARCH.
Rob Landley <rob@landley.net>
parents:
12
diff
changeset
|
29 |
9
b1f967311862
Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents:
1
diff
changeset
|
30 echo Install updated Documentation |
29
c91c3395876f
Produce better menuconfig output, now in multiple files and with concise
Rob Landley <rob@landley.net>
parents:
28
diff
changeset
|
31 |
38
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
32 rm -rf $WEBDIR/Documentation/ |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
33 cp -a $LNXDIR/hg/Documentation $WEBDIR/Documentation |
56
7fa04e9d3e4b
Automatically run docdiridx.py on Documentation, and remove a debugging exit.
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
34 cd $WEBDIR |
72
3232f421c770
Exit if any of the patches fail to apply, show name of each patch as it's
Rob Landley <rob@landley.net>
parents:
59
diff
changeset
|
35 for i in make/patches/*.patch |
3232f421c770
Exit if any of the patches fail to apply, show name of each patch as it's
Rob Landley <rob@landley.net>
parents:
59
diff
changeset
|
36 do |
3232f421c770
Exit if any of the patches fail to apply, show name of each patch as it's
Rob Landley <rob@landley.net>
parents:
59
diff
changeset
|
37 echo $i |
3232f421c770
Exit if any of the patches fail to apply, show name of each patch as it's
Rob Landley <rob@landley.net>
parents:
59
diff
changeset
|
38 patch -p1 -i $i || exit 1 |
3232f421c770
Exit if any of the patches fail to apply, show name of each patch as it's
Rob Landley <rob@landley.net>
parents:
59
diff
changeset
|
39 done |
56
7fa04e9d3e4b
Automatically run docdiridx.py on Documentation, and remove a debugging exit.
Rob Landley <rob@landley.net>
parents:
51
diff
changeset
|
40 make/docdiridx.py |
1
34a037d461f9
Some random infrastructure to build documentation from source.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
41 |
58
8f5d75ee17f2
Add a --short option to make/make.sh
Rob Landley <rob@landley.net>
parents:
56
diff
changeset
|
42 [ "$1" == "--short" ] && exit 1 |
8f5d75ee17f2
Add a --short option to make/make.sh
Rob Landley <rob@landley.net>
parents:
56
diff
changeset
|
43 |
9
b1f967311862
Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents:
1
diff
changeset
|
44 echo Build htmldocs and xhtml-nochunks |
29
c91c3395876f
Produce better menuconfig output, now in multiple files and with concise
Rob Landley <rob@landley.net>
parents:
28
diff
changeset
|
45 |
38
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
46 rm -rf $LNXDIR/temp |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
47 cd $LNXDIR/hg |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
48 mkdir $LNXDIR/temp |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
49 make allnoconfig O=$LNXDIR/temp |
10
72ac28634233
Take advantage of my laptop's core 2 duo.
Rob Landley <rob@landley.net>
parents:
9
diff
changeset
|
50 |
72
3232f421c770
Exit if any of the patches fail to apply, show name of each patch as it's
Rob Landley <rob@landley.net>
parents:
59
diff
changeset
|
51 # Adjust to use the patched Documentation directory |
3232f421c770
Exit if any of the patches fail to apply, show name of each patch as it's
Rob Landley <rob@landley.net>
parents:
59
diff
changeset
|
52 ln -s $WEBDIR/Documentation $LNXDIR/temp |
3232f421c770
Exit if any of the patches fail to apply, show name of each patch as it's
Rob Landley <rob@landley.net>
parents:
59
diff
changeset
|
53 |
10
72ac28634233
Take advantage of my laptop's core 2 duo.
Rob Landley <rob@landley.net>
parents:
9
diff
changeset
|
54 # I have a dual processor laptop, so overlap work here. Generate the xml |
72ac28634233
Take advantage of my laptop's core 2 duo.
Rob Landley <rob@landley.net>
parents:
9
diff
changeset
|
55 # first, then have make htmldocs produce split-up versions in the background |
72ac28634233
Take advantage of my laptop's core 2 duo.
Rob Landley <rob@landley.net>
parents:
9
diff
changeset
|
56 # while a script produces nochunks versions in the foreground. |
38
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
57 cd $LNXDIR/temp |
10
72ac28634233
Take advantage of my laptop's core 2 duo.
Rob Landley <rob@landley.net>
parents:
9
diff
changeset
|
58 make -j 2 xmldocs |
81
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
59 [ "$1" != "--skimp" ] && make -j 2 htmldocs & |
9
b1f967311862
Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents:
1
diff
changeset
|
60 cd Documentation/DocBook |
b1f967311862
Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents:
1
diff
changeset
|
61 for i in *.xml |
12
b7f376e957ac
Fix two bugs, one of them apparently in bash.
Rob Landley <rob@landley.net>
parents:
11
diff
changeset
|
62 do |
b7f376e957ac
Fix two bugs, one of them apparently in bash.
Rob Landley <rob@landley.net>
parents:
11
diff
changeset
|
63 echo "Converting $i" |
b7f376e957ac
Fix two bugs, one of them apparently in bash.
Rob Landley <rob@landley.net>
parents:
11
diff
changeset
|
64 xmlto xhtml-nochunks $i -o xhtml-nochunks |
9
b1f967311862
Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents:
1
diff
changeset
|
65 done |
10
72ac28634233
Take advantage of my laptop's core 2 duo.
Rob Landley <rob@landley.net>
parents:
9
diff
changeset
|
66 # Wait for background task to finish before retrieving result |
81
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
67 [ "$1" != "--skimp" ] && while [ $(jobs | wc -l) -ne 0 ] |
11 | 68 do |
69 sleep 1 | |
12
b7f376e957ac
Fix two bugs, one of them apparently in bash.
Rob Landley <rob@landley.net>
parents:
11
diff
changeset
|
70 # Without this next line, bash never notices a change in the number of jobs. |
b7f376e957ac
Fix two bugs, one of them apparently in bash.
Rob Landley <rob@landley.net>
parents:
11
diff
changeset
|
71 # Bug noticed in Ubuntu 7.04 |
b7f376e957ac
Fix two bugs, one of them apparently in bash.
Rob Landley <rob@landley.net>
parents:
11
diff
changeset
|
72 jobs > /dev/null |
11 | 73 done |
9
b1f967311862
Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents:
1
diff
changeset
|
74 mv xhtml-nochunks/*.html . |
b1f967311862
Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents:
1
diff
changeset
|
75 rmdir xhtml-nochunks |
1
34a037d461f9
Some random infrastructure to build documentation from source.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
76 |
28
35b3feac366a
Generate a better index for htmldocs: show document titles and both versions.
Rob Landley <rob@landley.net>
parents:
27
diff
changeset
|
77 echo Install htmldocs and update index |
29
c91c3395876f
Produce better menuconfig output, now in multiple files and with concise
Rob Landley <rob@landley.net>
parents:
28
diff
changeset
|
78 |
72
3232f421c770
Exit if any of the patches fail to apply, show name of each patch as it's
Rob Landley <rob@landley.net>
parents:
59
diff
changeset
|
79 rm -f $WEBDIR/htmldocs |
3232f421c770
Exit if any of the patches fail to apply, show name of each patch as it's
Rob Landley <rob@landley.net>
parents:
59
diff
changeset
|
80 ln -s Documentation/DocBook $WEBDIR/htmldocs |
38
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
81 cd $WEBDIR/htmldocs |
36
9a5ef2d1264e
Call indexsections.py and work around a bug in xmlto.
Rob Landley <rob@landley.net>
parents:
32
diff
changeset
|
82 # Work around a bug in xmlto: it puts an incorrect code page into the converted |
9a5ef2d1264e
Call indexsections.py and work around a bug in xmlto.
Rob Landley <rob@landley.net>
parents:
32
diff
changeset
|
83 # html documents, which produces line noise in the output. |
9a5ef2d1264e
Call indexsections.py and work around a bug in xmlto.
Rob Landley <rob@landley.net>
parents:
32
diff
changeset
|
84 find . -name "*.html" | xargs sed -i -e 's/.*ISO-8859-1.*//' |
28
35b3feac366a
Generate a better index for htmldocs: show document titles and both versions.
Rob Landley <rob@landley.net>
parents:
27
diff
changeset
|
85 head -n 2 index.html > index2.html |
35b3feac366a
Generate a better index for htmldocs: show document titles and both versions.
Rob Landley <rob@landley.net>
parents:
27
diff
changeset
|
86 echo "<ul>" >> index2.html |
35b3feac366a
Generate a better index for htmldocs: show document titles and both versions.
Rob Landley <rob@landley.net>
parents:
27
diff
changeset
|
87 for i in $(ls -p | sed -n 's@/$@@p') |
35b3feac366a
Generate a better index for htmldocs: show document titles and both versions.
Rob Landley <rob@landley.net>
parents:
27
diff
changeset
|
88 do |
35b3feac366a
Generate a better index for htmldocs: show document titles and both versions.
Rob Landley <rob@landley.net>
parents:
27
diff
changeset
|
89 echo "<li>(<a href=\"$i\">chunks</a>) (<a href=\"${i}.html\">nochunks</a>) " >> index2.html |
35b3feac366a
Generate a better index for htmldocs: show document titles and both versions.
Rob Landley <rob@landley.net>
parents:
27
diff
changeset
|
90 sed -nr 's@.*<title>(.*)</title>.*@\1@p' ${i}.xml | head -n 1 >> index2.html |
35b3feac366a
Generate a better index for htmldocs: show document titles and both versions.
Rob Landley <rob@landley.net>
parents:
27
diff
changeset
|
91 echo "</li>" >> index2.html |
35b3feac366a
Generate a better index for htmldocs: show document titles and both versions.
Rob Landley <rob@landley.net>
parents:
27
diff
changeset
|
92 done |
35b3feac366a
Generate a better index for htmldocs: show document titles and both versions.
Rob Landley <rob@landley.net>
parents:
27
diff
changeset
|
93 echo "</ul>" >> index2.html |
35b3feac366a
Generate a better index for htmldocs: show document titles and both versions.
Rob Landley <rob@landley.net>
parents:
27
diff
changeset
|
94 mv index2.html index.html |
81
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
95 |
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
96 # Search for references to RFC documents |
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
97 "$WEBDIR"/make/findrfc.sh > "$WEBDIR"/rfc-linux.html || exit 1 |
6adf16f10d54
Split up make.sh so it's easier to call subsets of its functionality.
Rob Landley <rob@landley.net>
parents:
72
diff
changeset
|
98 |
12
b7f376e957ac
Fix two bugs, one of them apparently in bash.
Rob Landley <rob@landley.net>
parents:
11
diff
changeset
|
99 echo "Done with kdocs" |