annotate make/make.sh @ 36:9a5ef2d1264e

Call indexsections.py and work around a bug in xmlto.
author Rob Landley <rob@landley.net>
date Mon, 10 Sep 2007 05:41:08 -0500
parents 6f30fdd28dab
children 841aab0fd204
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
29
c91c3395876f Produce better menuconfig output, now in multiple files and with concise
Rob Landley <rob@landley.net>
parents: 28
diff changeset
3
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
4 # mkdir -p ~/linux
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
5 # cd ~/linux
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
6 # hg clone http://kernel.org/hg/linux-2.6 hg
29
c91c3395876f Produce better menuconfig output, now in multiple files and with concise
Rob Landley <rob@landley.net>
parents: 28
diff changeset
7
36
9a5ef2d1264e Call indexsections.py and work around a bug in xmlto.
Rob Landley <rob@landley.net>
parents: 32
diff changeset
8 echo Update master index.
9a5ef2d1264e Call indexsections.py and work around a bug in xmlto.
Rob Landley <rob@landley.net>
parents: 32
diff changeset
9 ~/www/kdocs/make/indexsections.py -i ~/www/kdocs/master.idx > ~/www/kdocs/master.html || exit 1
9a5ef2d1264e Call indexsections.py and work around a bug in xmlto.
Rob Landley <rob@landley.net>
parents: 32
diff changeset
10 ~/www/kdocs/make/indexsections.py ~/www/kdocs/master.idx >> ~/www/kdocs/master.html || exit 1
9a5ef2d1264e Call indexsections.py and work around a bug in xmlto.
Rob Landley <rob@landley.net>
parents: 32
diff changeset
11
9a5ef2d1264e Call indexsections.py and work around a bug in xmlto.
Rob Landley <rob@landley.net>
parents: 32
diff changeset
12 echo Update linux kernel from kernel.org Mercurial repository
9a5ef2d1264e Call indexsections.py and work around a bug in xmlto.
Rob Landley <rob@landley.net>
parents: 32
diff changeset
13
9a5ef2d1264e Call indexsections.py and work around a bug in xmlto.
Rob Landley <rob@landley.net>
parents: 32
diff changeset
14 # Update kernel mercurial repository.
9a5ef2d1264e Call indexsections.py and work around a bug in xmlto.
Rob Landley <rob@landley.net>
parents: 32
diff changeset
15
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
16 cd ~/linux/hg
9
b1f967311862 Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents: 1
diff changeset
17 hg pull -u
1
34a037d461f9 Some random infrastructure to build documentation from source.
Rob Landley <rob@landley.net>
parents:
diff changeset
18
32
6f30fdd28dab Add a few google videos, and the README files from the kernel source.
Rob Landley <rob@landley.net>
parents: 29
diff changeset
19 echo Copying readme files
6f30fdd28dab Add a few google videos, and the README files from the kernel source.
Rob Landley <rob@landley.net>
parents: 29
diff changeset
20 rm -rf ~/www/kdocs/readme
6f30fdd28dab Add a few google videos, and the README files from the kernel source.
Rob Landley <rob@landley.net>
parents: 29
diff changeset
21 mkdir ~/www/kdocs/readme
6f30fdd28dab Add a few google videos, and the README files from the kernel source.
Rob Landley <rob@landley.net>
parents: 29
diff changeset
22 for i in $(find . -name "*[Rr][Ee][Aa][Dd][Mm][Ee]*" | grep -v "Documentation/")
6f30fdd28dab Add a few google videos, and the README files from the kernel source.
Rob Landley <rob@landley.net>
parents: 29
diff changeset
23 do
6f30fdd28dab Add a few google videos, and the README files from the kernel source.
Rob Landley <rob@landley.net>
parents: 29
diff changeset
24 OUT=$(echo $i | sed -e 's@\./@@' -e 's@/@-@g')
6f30fdd28dab Add a few google videos, and the README files from the kernel source.
Rob Landley <rob@landley.net>
parents: 29
diff changeset
25 cp $i ~/www/kdocs/readme/$OUT
6f30fdd28dab Add a few google videos, and the README files from the kernel source.
Rob Landley <rob@landley.net>
parents: 29
diff changeset
26 done
6f30fdd28dab Add a few google videos, and the README files from the kernel source.
Rob Landley <rob@landley.net>
parents: 29
diff changeset
27 make help > ~/www/kdocs/makehelp.txt
6f30fdd28dab Add a few google videos, and the README files from the kernel source.
Rob Landley <rob@landley.net>
parents: 29
diff changeset
28
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 echo Convert kconfig to html for all architectures
29
c91c3395876f Produce better menuconfig output, now in multiple files and with concise
Rob Landley <rob@landley.net>
parents: 28
diff changeset
30
c91c3395876f Produce better menuconfig output, now in multiple files and with concise
Rob Landley <rob@landley.net>
parents: 28
diff changeset
31 rm -rf ~/www/kdocs/menuconfig/
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
32 mkdir -p ~/www/kdocs/menuconfig
27
ba26365cf74f Generate menuconfig/index.html.
Rob Landley <rob@landley.net>
parents: 26
diff changeset
33 echo "<html>Menuconfig docs for kernel $(make kernelversion)</html><body><ul>" > ~/www/kdocs/menuconfig/index.html
ba26365cf74f Generate menuconfig/index.html.
Rob Landley <rob@landley.net>
parents: 26
diff changeset
34 for i in $(find arch -maxdepth 2 -name Kconfig | sort)
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
35 do
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
36 echo Converting "$i"
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
37 ARCH=$(echo $i | sed -r 's@.*/(.*)/.*@\1@')
27
ba26365cf74f Generate menuconfig/index.html.
Rob Landley <rob@landley.net>
parents: 26
diff changeset
38 echo "<li><a href=${ARCH}.html>${ARCH}</a></li>" >> ~/www/kdocs/menuconfig/index.html
29
c91c3395876f Produce better menuconfig output, now in multiple files and with concise
Rob Landley <rob@landley.net>
parents: 28
diff changeset
39 echo ~/www/kdocs/make/menuconfig2html.py $i ~/www/kdocs/menuconfig # $ARCH.html
c91c3395876f Produce better menuconfig output, now in multiple files and with concise
Rob Landley <rob@landley.net>
parents: 28
diff changeset
40
c91c3395876f Produce better menuconfig output, now in multiple files and with concise
Rob Landley <rob@landley.net>
parents: 28
diff changeset
41 ~/www/kdocs/make/menuconfig2html.py $i ~/www/kdocs/menuconfig > ~/www/kdocs/menuconfig/$ARCH.html
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
42 done
27
ba26365cf74f Generate menuconfig/index.html.
Rob Landley <rob@landley.net>
parents: 26
diff changeset
43 echo "</ul></body></html>" >> ~/www/kdocs/menuconfig/index.html
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
44
9
b1f967311862 Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents: 1
diff changeset
45 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
46
9
b1f967311862 Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents: 1
diff changeset
47 rm -rf ~/www/kdocs/Documentation/
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
48 cp -a ~/linux/hg/Documentation ~/www/kdocs/Documentation
1
34a037d461f9 Some random infrastructure to build documentation from source.
Rob Landley <rob@landley.net>
parents:
diff changeset
49
9
b1f967311862 Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents: 1
diff changeset
50 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
51
9
b1f967311862 Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents: 1
diff changeset
52 rm -rf ~/linux/temp
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
53 cd ~/linux/hg
9
b1f967311862 Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents: 1
diff changeset
54 mkdir ~/linux/temp
b1f967311862 Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents: 1
diff changeset
55 make allnoconfig O=~/linux/temp
10
72ac28634233 Take advantage of my laptop's core 2 duo.
Rob Landley <rob@landley.net>
parents: 9
diff changeset
56
72ac28634233 Take advantage of my laptop's core 2 duo.
Rob Landley <rob@landley.net>
parents: 9
diff changeset
57 # 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
58 # 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
59 # while a script produces nochunks versions in the foreground.
9
b1f967311862 Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents: 1
diff changeset
60 cd ~/linux/temp
10
72ac28634233 Take advantage of my laptop's core 2 duo.
Rob Landley <rob@landley.net>
parents: 9
diff changeset
61 make -j 2 xmldocs
72ac28634233 Take advantage of my laptop's core 2 duo.
Rob Landley <rob@landley.net>
parents: 9
diff changeset
62 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
63 cd Documentation/DocBook
b1f967311862 Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents: 1
diff changeset
64 for i in *.xml
12
b7f376e957ac Fix two bugs, one of them apparently in bash.
Rob Landley <rob@landley.net>
parents: 11
diff changeset
65 do
b7f376e957ac Fix two bugs, one of them apparently in bash.
Rob Landley <rob@landley.net>
parents: 11
diff changeset
66 echo "Converting $i"
b7f376e957ac Fix two bugs, one of them apparently in bash.
Rob Landley <rob@landley.net>
parents: 11
diff changeset
67 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
68 done
10
72ac28634233 Take advantage of my laptop's core 2 duo.
Rob Landley <rob@landley.net>
parents: 9
diff changeset
69 # Wait for background task to finish before retrieving result
11
af7d7a237911 Untangle while loop slightly.
Rob Landley <rob@landley.net>
parents: 10
diff changeset
70 while [ $(jobs | wc -l) -ne 0 ]
af7d7a237911 Untangle while loop slightly.
Rob Landley <rob@landley.net>
parents: 10
diff changeset
71 do
af7d7a237911 Untangle while loop slightly.
Rob Landley <rob@landley.net>
parents: 10
diff changeset
72 sleep 1
12
b7f376e957ac Fix two bugs, one of them apparently in bash.
Rob Landley <rob@landley.net>
parents: 11
diff changeset
73 # 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
74 # 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
75 jobs > /dev/null
11
af7d7a237911 Untangle while loop slightly.
Rob Landley <rob@landley.net>
parents: 10
diff changeset
76 done
9
b1f967311862 Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents: 1
diff changeset
77 mv xhtml-nochunks/*.html .
b1f967311862 Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents: 1
diff changeset
78 rmdir xhtml-nochunks
1
34a037d461f9 Some random infrastructure to build documentation from source.
Rob Landley <rob@landley.net>
parents:
diff changeset
79
28
35b3feac366a Generate a better index for htmldocs: show document titles and both versions.
Rob Landley <rob@landley.net>
parents: 27
diff changeset
80 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
81
9
b1f967311862 Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents: 1
diff changeset
82 rm -rf ~/www/kdocs/htmldocs
b1f967311862 Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents: 1
diff changeset
83 cp -a ~/linux/temp/Documentation/DocBook ~/www/kdocs/htmldocs
28
35b3feac366a Generate a better index for htmldocs: show document titles and both versions.
Rob Landley <rob@landley.net>
parents: 27
diff changeset
84 cd ~/www/kdocs/htmldocs
36
9a5ef2d1264e Call indexsections.py and work around a bug in xmlto.
Rob Landley <rob@landley.net>
parents: 32
diff changeset
85 # 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
86 # 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
87 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
88 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
89 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
90 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
91 do
35b3feac366a Generate a better index for htmldocs: show document titles and both versions.
Rob Landley <rob@landley.net>
parents: 27
diff changeset
92 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
93 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
94 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
95 done
35b3feac366a Generate a better index for htmldocs: show document titles and both versions.
Rob Landley <rob@landley.net>
parents: 27
diff changeset
96 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
97 mv index2.html index.html
12
b7f376e957ac Fix two bugs, one of them apparently in bash.
Rob Landley <rob@landley.net>
parents: 11
diff changeset
98 echo "Done with kdocs"