source: projects/ckbs/trunk/build_doc.sh @ 95

Last change on this file since 95 was 84, checked in by bradbell, 11 years ago

[ckbs/trunk] Another attempt to fix build.sh.

build_doc.sh: wc -w (on some systems) puts spaces around it's output number.

  • Property svn:executable set to *
File size: 1.9 KB
Line 
1#! /bin/sh
2# -------------------------------------------------------------------
3# ckbs: Constrained Kalman-Bucy Smoother Program: Copyright (C) 2006
4# Authors: Bradlely Bell:        bradbell at washington dot edu
5#          Gianluigi Pillonetto: giapi at dei dot unipd dot it
6# License: GNU General Public License Version 2
7# -------------------------------------------------------------------
8#
9count=`ls | grep omhelp- | wc -w | sed -e 's| ||g'`
10if [ "$count" = 1 ]
11then
12        dir=`ls | grep omhelp-`
13else
14        dir="do_not_use_current_omhelp_directory"
15fi
16if [ -e $dir/src/omhelp ]
17then
18        echo "using existing $dir/src/omhelp"
19else
20        if [ ! -e OMhelp.unix.tar.gz ]
21        then
22                check=`which wget | sed -e 's|.*/||'`
23                if [ "$check" != "wget" ]
24                then
25                        echo "build_doc.sh: cannot find wget command"
26                        exit 1
27                fi
28                web_page="http://www.seanet.com/~bradbell"
29                echo "wget $web_page/OMhelp.unix.tar.gz"
30                wget "$web_page/OMhelp.unix.tar.gz"
31        fi
32        if [ -e "omhelp-*" ]
33        then
34                echo "rm -rf omhelp-*"
35                rm -rf omhelp-*
36        fi
37        echo "tar -xvzf OMhelp.unix.tar.gz"
38        tar -xvzf OMhelp.unix.tar.gz
39        #
40        echo "cd omhelp-*"
41        cd omhelp-*
42        #
43        echo "./configure --prefix=$HOME"
44        ./configure --prefix=$HOME
45        #
46        echo "make"
47        make
48        #
49        echo "cd .."
50        cd ..
51fi
52count=`ls | grep omhelp- | wc -w | sed -e 's| ||g'`
53if [ "$count" != 1 ]
54then
55        echo "build_doc.sh: unknown error, giving up"
56        exit 1
57fi
58dir=`ls | grep omhelp-`
59if [ ! -e doc ]
60then
61        echo "mkdir doc"
62        mkdir doc
63fi
64#
65echo "cd doc"
66cd doc
67#
68# build the documentation
69cmd="../$dir/src/omhelp"
70log="../omhelp.log"
71for arg1 in "" -xml
72do
73        for arg2 in -noframe -printable
74        do
75                echo "omhelp ckbs.omh $arg1 $arg2 -debug >& omhelp.log"
76                if ! $cmd ../ckbs.omh $arg1 $arg2 -debug >& ../omhelp.log
77                then
78                        echo "build_doc.sh: omhelp error, see omhelp.log"
79                        exit 1
80                fi
81                if grep "^OMhelp Warning:" ../omhelp.log
82                then
83                        echo "build_doc.sh: omhelp warning, see omhelp.log"
84                        exit 1
85                fi
86        done
87done
Note: See TracBrowser for help on using the repository browser.