Mercurial > hg > kdocs
annotate make/make.sh @ 47:0df6348fc276
Teach indexsections to output index and contents in one pass, and put index
in an arbitrary location within the file (governed by <put_index_here> tag).
Update master.idx to use this, move introductory material to the top,
and reshuffle sections. Teach make.sh new calling convention for master.idx.
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 25 Sep 2007 23:35:21 -0500 |
parents | 17389c66eb02 |
children | aa424ac2ce30 |
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 |
38
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
3 [ -z "$WEBDIR" ] && WEBDIR=~/www/kdocs |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
4 [ -z "$LNXDIR" ] && LNXDIR=~/linux |
29
c91c3395876f
Produce better menuconfig output, now in multiple files and with concise
Rob Landley <rob@landley.net>
parents:
28
diff
changeset
|
5 |
38
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
6 echo $WEBDIR |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
7 |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
8 echo "Update master index." |
29
c91c3395876f
Produce better menuconfig output, now in multiple files and with concise
Rob Landley <rob@landley.net>
parents:
28
diff
changeset
|
9 |
47
0df6348fc276
Teach indexsections to output index and contents in one pass, and put index
Rob Landley <rob@landley.net>
parents:
40
diff
changeset
|
10 $WEBDIR/make/indexsections.py $WEBDIR/master.idx > $WEBDIR/master.html || 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
|
11 |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
12 echo "Update Linux kernel from kernel.org" |
36
9a5ef2d1264e
Call indexsections.py and work around a bug in xmlto.
Rob Landley <rob@landley.net>
parents:
32
diff
changeset
|
13 |
38
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
14 if [ ! -d "$LNXDIR" ] |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
15 then |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
16 # Clone repository if we haven't got one yet. |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
17 mkdir -p "$LNXDIR"/hg && |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
18 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
|
19 hg clone http://kernel.org/hg/linux-2.6 hg |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
20 else |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
21 # Update kernel mercurial repository. |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
22 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
|
23 hg pull -u |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
24 fi |
36
9a5ef2d1264e
Call indexsections.py and work around a bug in xmlto.
Rob Landley <rob@landley.net>
parents:
32
diff
changeset
|
25 |
38
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
26 [ $? -ne 0 ] && exit 1 |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
27 |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
28 echo -n "Grab version number..." |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
29 |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
30 LNXTAG="$(hg tags | head -n 2 | tail -n 1 | awk '{print $1}')" |
1
34a037d461f9
Some random infrastructure to build documentation from source.
Rob Landley <rob@landley.net>
parents:
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 echo $LNXTAG |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
33 |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
34 echo Copy readme files from Linux kernel |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
35 |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
36 rm -rf $WEBDIR/readme |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
37 mkdir $WEBDIR/readme |
32
6f30fdd28dab
Add a few google videos, and the README files from the kernel source.
Rob Landley <rob@landley.net>
parents:
29
diff
changeset
|
38 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
|
39 do |
6f30fdd28dab
Add a few google videos, and the README files from the kernel source.
Rob Landley <rob@landley.net>
parents:
29
diff
changeset
|
40 OUT=$(echo $i | sed -e 's@\./@@' -e 's@/@-@g') |
38
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
41 cp $i $WEBDIR/readme/$OUT |
32
6f30fdd28dab
Add a few google videos, and the README files from the kernel source.
Rob Landley <rob@landley.net>
parents:
29
diff
changeset
|
42 done |
38
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
43 make help > $WEBDIR/makehelp.txt |
32
6f30fdd28dab
Add a few google videos, and the README files from the kernel source.
Rob Landley <rob@landley.net>
parents:
29
diff
changeset
|
44 |
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
|
45 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
|
46 |
38
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
47 echo $WEBDIR/menuconfig/ |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
48 rm -rf $WEBDIR/menuconfig/ |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
49 mkdir -p $WEBDIR/menuconfig |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
50 echo "<html><title>Menuconfig docs for Linux $LNXTAG</title><body><ul>" > $WEBDIR/menuconfig/index.html |
27
ba26365cf74f
Generate menuconfig/index.html.
Rob Landley <rob@landley.net>
parents:
26
diff
changeset
|
51 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
|
52 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
|
53 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
|
54 ARCH=$(echo $i | sed -r 's@.*/(.*)/.*@\1@') |
38
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
55 echo "<li><a href=${ARCH}.html>${ARCH}</a></li>" >> $WEBDIR/menuconfig/index.html |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
56 $WEBDIR/make/menuconfig2html.py $i $WEBDIR/menuconfig "$LNXTAG" > $WEBDIR/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
|
57 done |
38
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
58 echo "</ul></body></html>" >> $WEBDIR/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
|
59 |
9
b1f967311862
Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents:
1
diff
changeset
|
60 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
|
61 |
38
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
62 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
|
63 cp -a $LNXDIR/hg/Documentation $WEBDIR/Documentation |
1
34a037d461f9
Some random infrastructure to build documentation from source.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
64 |
9
b1f967311862
Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents:
1
diff
changeset
|
65 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
|
66 |
38
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
67 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
|
68 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
|
69 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
|
70 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
|
71 |
72ac28634233
Take advantage of my laptop's core 2 duo.
Rob Landley <rob@landley.net>
parents:
9
diff
changeset
|
72 # 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
|
73 # 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
|
74 # 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
|
75 cd $LNXDIR/temp |
10
72ac28634233
Take advantage of my laptop's core 2 duo.
Rob Landley <rob@landley.net>
parents:
9
diff
changeset
|
76 make -j 2 xmldocs |
72ac28634233
Take advantage of my laptop's core 2 duo.
Rob Landley <rob@landley.net>
parents:
9
diff
changeset
|
77 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
|
78 cd Documentation/DocBook |
b1f967311862
Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents:
1
diff
changeset
|
79 for i in *.xml |
12
b7f376e957ac
Fix two bugs, one of them apparently in bash.
Rob Landley <rob@landley.net>
parents:
11
diff
changeset
|
80 do |
b7f376e957ac
Fix two bugs, one of them apparently in bash.
Rob Landley <rob@landley.net>
parents:
11
diff
changeset
|
81 echo "Converting $i" |
b7f376e957ac
Fix two bugs, one of them apparently in bash.
Rob Landley <rob@landley.net>
parents:
11
diff
changeset
|
82 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
|
83 done |
10
72ac28634233
Take advantage of my laptop's core 2 duo.
Rob Landley <rob@landley.net>
parents:
9
diff
changeset
|
84 # Wait for background task to finish before retrieving result |
11 | 85 while [ $(jobs | wc -l) -ne 0 ] |
86 do | |
87 sleep 1 | |
12
b7f376e957ac
Fix two bugs, one of them apparently in bash.
Rob Landley <rob@landley.net>
parents:
11
diff
changeset
|
88 # 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
|
89 # 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
|
90 jobs > /dev/null |
11 | 91 done |
9
b1f967311862
Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents:
1
diff
changeset
|
92 mv xhtml-nochunks/*.html . |
b1f967311862
Update the build infrastructure. Documentation is still just copied, but
Rob Landley <rob@landley.net>
parents:
1
diff
changeset
|
93 rmdir xhtml-nochunks |
1
34a037d461f9
Some random infrastructure to build documentation from source.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
94 |
28
35b3feac366a
Generate a better index for htmldocs: show document titles and both versions.
Rob Landley <rob@landley.net>
parents:
27
diff
changeset
|
95 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
|
96 |
38
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
97 rm -rf $WEBDIR/htmldocs |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
98 cp -a $LNXDIR/temp/Documentation/DocBook $WEBDIR/htmldocs |
841aab0fd204
Add version info to menuconfig html, and genericize make with environment vars
Rob Landley <rob@landley.net>
parents:
36
diff
changeset
|
99 cd $WEBDIR/htmldocs |
36
9a5ef2d1264e
Call indexsections.py and work around a bug in xmlto.
Rob Landley <rob@landley.net>
parents:
32
diff
changeset
|
100 # 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
|
101 # 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
|
102 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
|
103 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
|
104 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
|
105 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
|
106 do |
35b3feac366a
Generate a better index for htmldocs: show document titles and both versions.
Rob Landley <rob@landley.net>
parents:
27
diff
changeset
|
107 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
|
108 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
|
109 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
|
110 done |
35b3feac366a
Generate a better index for htmldocs: show document titles and both versions.
Rob Landley <rob@landley.net>
parents:
27
diff
changeset
|
111 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
|
112 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
|
113 echo "Done with kdocs" |