build
author wenzelm
Wed Jul 09 16:52:51 1997 +0200 (1997-07-09)
changeset 3508 089806e6133b
parent 3255 7678f3d93053
child 4457 6e6d99e06d0c
permissions -rwxr-xr-x
removed init_database;
     1 #!/bin/bash
     2 #
     3 # $Id$
     4 #
     5 # build - compile the Isabelle system and object-logics
     6 
     7 
     8 ## settings
     9 
    10 PRG=$(basename $0)
    11 
    12 ISABELLE_HOME=$(dirname $0)
    13 . $ISABELLE_HOME/lib/scripts/getsettings || \
    14   { echo "$PRG probably not called from its original place!"; exit 2; }
    15 
    16 
    17 ## diagnostics
    18 
    19 function usage()
    20 {
    21   echo
    22   echo "Usage: $PRG [OPTIONS] [LOGICS ...]"
    23   echo
    24   echo "  Options are:"
    25   echo "    -a           all logics"
    26   echo "    -b           batch mode"
    27   echo "    -t           run tests"
    28   echo
    29   echo "  Compile the named LOGICS (default $ISABELLE_LOGIC), or all object logics"
    30   echo "  in the distribution."
    31   echo
    32   exit 1
    33 }
    34 
    35 function fail()
    36 {
    37   echo "$1" >&2
    38   exit 2
    39 }
    40 
    41 
    42 ## process command line
    43 
    44 # options
    45 
    46 ALL=""
    47 BATCH=""
    48 TEST=""
    49 
    50 while getopts "abt" OPT
    51 do
    52   case "$OPT" in
    53     a)
    54       ALL=true
    55       ;;
    56     b)
    57       BATCH=true
    58       ;;
    59     t)
    60       TEST=test
    61       ;;
    62     \?)
    63       usage
    64       ;;
    65   esac
    66 done
    67 
    68 shift $(($OPTIND - 1))
    69 
    70 
    71 # args
    72 
    73 LOGICS="$@"
    74 
    75 
    76 ## main
    77 
    78 # tell the user about current values
    79 
    80 if [ -z "$BATCH" ]; then
    81   echo
    82   echo "                *****************************"
    83   echo "                * Welcome to Isabelle build *"
    84   echo "                *****************************"
    85   echo
    86   echo "Please check $ISABELLE_HOME/etc/settings"
    87   [ -f $ISABELLE_HOME_USER/etc/settings ] && echo "AND $ISABELLE_HOME_USER/etc/settings"
    88   echo "to make sure that Isabelle's ML system settings are appropriate."
    89   echo
    90   echo "Your current values are:"
    91   echo
    92   echo "  ML_SYSTEM=$ML_SYSTEM"
    93   echo "  ML_HOME=$ML_HOME"
    94   echo "  ML_OPTIONS=$ML_OPTIONS"
    95 fi
    96 
    97 
    98 # check logics
    99 
   100 if [ -z "$BATCH" ]; then
   101   echo
   102   echo
   103   echo "Press RETURN to start compilation (including parents) of:"
   104   echo
   105 fi
   106 
   107 [ -z "$LOGICS" ] && LOGICS=$ISABELLE_LOGIC
   108 
   109 if [ -n "$ALL" ]; then
   110   LOGICS=""
   111   for DIR in $ISABELLE_HOME/src/*
   112   do
   113     if [ -f $DIR/IsaMakefile ]; then
   114       L=$(basename $DIR)
   115       LOGICS="$LOGICS $L"
   116     fi
   117   done
   118 else
   119   for L in $LOGICS
   120   do
   121     DIR=$ISABELLE_HOME/src/$L
   122     [ ! -f $DIR/IsaMakefile ] && fail "No such logic: $L"
   123   done
   124 fi
   125 
   126 if [ -z "$BATCH" ]; then
   127   echo " " $LOGICS
   128   echo
   129   read
   130 else
   131   echo
   132   echo "Isabelle build:" $LOGICS
   133   echo
   134   echo "ML_SYSTEM=$ML_SYSTEM"
   135   echo "ML_HOME=$ML_HOME"
   136   echo "ML_OPTIONS=$ML_OPTIONS"
   137   echo
   138 fi
   139 
   140 
   141 # build it
   142 
   143 echo
   144 echo -n "Started at "; date
   145 echo
   146 
   147 export THIS_IS_ISABELLE_BUILD=true
   148 
   149 for L in $LOGICS
   150 do
   151   ( cd $ISABELLE_HOME/src/$L; $ISATOOL make $TEST )
   152 done
   153 
   154 echo
   155 echo -n "Finished at "; date
   156 echo