4d030a50053748bc2ceede70ab5cf18aa2fdec2d
[ghc.git] / distrib / mkDocs / mkDocs
1 #!/bin/sh
2
3 set -e
4
5 die () {
6     echo "$1" >&2
7     exit 1
8 }
9
10 [ "$#" -eq 2 ] || die "Bad args. Usage: $0 <Linux bindist> <Windows bindist>"
11
12 LINUX_BINDIST=`realpath "$1"`
13 WINDOWS_BINDIST=`realpath "$2"`
14
15 mkdir docs
16 cd docs
17 tar -jxf "$LINUX_BINDIST"
18 mv ghc* linux
19 tar -jxf "$WINDOWS_BINDIST"
20 mv ghc* windows
21 cd linux
22 ./configure --prefix=`pwd`/inst
23 make install
24 cd inst/share/doc/ghc/html/libraries
25 mv ../../../../../../../windows/doc/html/libraries/Win32-* .
26 sh gen_contents_index
27 cd ..
28 for i in haddock libraries users_guide
29 do
30     tar -jcf ../../../../../../$i.html.tar.bz2 $i
31 done
32 cd ..
33 mv *.pdf *.ps ../../../../..
34