"Fossies" - the Fresh Open Source Software Archive

Member "hevea-2.35/ocb.sh" (16 Jan 2021, 610 Bytes) of package /linux/www/hevea-2.35.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh -e
    2 CHECK=yes
    3 export CHECK
    4 . ./config.sh
    5 
    6 OCBOCAMLFLAGS=''
    7 for i in $OCAMLFLAGS
    8 do
    9   OCBOCAMLFLAGS="$OCBOCAMLFLAGS -cflag $i"
   10 done
   11 
   12 ocb() {
   13     ocamlbuild $OCBFLAGS $OCBOCAMLFLAGS $*
   14 }
   15 
   16 toopt () {
   17   for f in $*
   18   do
   19     mv $f `basename $f .native`.opt
   20   done
   21 }
   22 
   23 rule() {
   24   case $1 in
   25     clean)
   26       ocb -clean
   27       ;;
   28     byte)
   29       ocb $PGM
   30       ;;
   31     opt)
   32       ocb $PGMNATIVE && toopt $PGMNATIVE
   33       ;;
   34     both)
   35       ocb $PGM $PGMNATIVE && toopt $PGMNATIVE
   36       ;;
   37     *)      echo "Unknown action $1";;
   38   esac;
   39 }
   40 
   41 if [ $# -eq 0 ]
   42 then
   43   rule opt
   44 else
   45   for i
   46   do
   47     rule $i
   48   done
   49 fi