build
author kleing
Fri May 23 17:18:10 2003 +0200 (2003-05-23)
changeset 14041 c2d981d222bf
parent 10555 2323ec838401
child 14056 f8ed8428b41c
permissions -rwxr-xr-x
make it possible to switch off proof objects
wenzelm@10555
     1
#!/usr/bin/env bash
wenzelm@2755
     2
#
wenzelm@2755
     3
# $Id$
wenzelm@9817
     4
# Author: Markus Wenzel, TU Muenchen
wenzelm@9817
     5
# License: GPL (GNU GENERAL PUBLIC LICENSE)
wenzelm@2755
     6
#
wenzelm@2902
     7
# build - compile the Isabelle system and object-logics
wenzelm@2755
     8
wenzelm@2755
     9
wenzelm@4457
    10
## global settings
wenzelm@4457
    11
wenzelm@4457
    12
ALL_LOGICS="CCL CTT Cube FOL FOLP HOL HOLCF LCF Pure Sequents ZF"
wenzelm@4457
    13
wenzelm@4457
    14
wenzelm@2789
    15
## settings
wenzelm@2789
    16
wenzelm@10511
    17
PRG="$(basename "$0")"
wenzelm@2755
    18
wenzelm@7889
    19
export THIS_IS_ISABELLE_BUILD=true
wenzelm@10511
    20
ISABELLE_HOME="$(dirname "$0")"
wenzelm@9789
    21
. "$ISABELLE_HOME/lib/scripts/getsettings" || \
wenzelm@2936
    22
  { echo "$PRG probably not called from its original place!"; exit 2; }
wenzelm@2755
    23
wenzelm@2789
    24
wenzelm@2879
    25
## diagnostics
wenzelm@2879
    26
wenzelm@2879
    27
function usage()
wenzelm@2879
    28
{
wenzelm@2879
    29
  echo
wenzelm@2879
    30
  echo "Usage: $PRG [OPTIONS] [LOGICS ...]"
wenzelm@2879
    31
  echo
wenzelm@2879
    32
  echo "  Options are:"
wenzelm@2879
    33
  echo "    -a           all logics"
wenzelm@2902
    34
  echo "    -b           batch mode"
wenzelm@6256
    35
  echo "    -i           make images"
wenzelm@7889
    36
  echo "    -m TARGET    make this target"
wenzelm@6256
    37
  echo "    -t           make test"
wenzelm@2879
    38
  echo
wenzelm@3184
    39
  echo "  Compile the named LOGICS (default $ISABELLE_LOGIC), or all object logics"
wenzelm@2879
    40
  echo "  in the distribution."
wenzelm@2879
    41
  echo
wenzelm@2879
    42
  exit 1
wenzelm@2879
    43
}
wenzelm@2879
    44
wenzelm@2879
    45
function fail()
wenzelm@2879
    46
{
wenzelm@2879
    47
  echo "$1" >&2
wenzelm@2879
    48
  exit 2
wenzelm@2879
    49
}
wenzelm@2879
    50
wenzelm@2879
    51
wenzelm@2879
    52
## process command line
wenzelm@2879
    53
wenzelm@2879
    54
# options
wenzelm@2879
    55
wenzelm@2879
    56
ALL=""
wenzelm@2902
    57
BATCH=""
wenzelm@7889
    58
TARGETS=""
kleing@14041
    59
MAKEFLAGS=""
wenzelm@2755
    60
kleing@14041
    61
while getopts "abim:p:t" OPT
wenzelm@2879
    62
do
wenzelm@2879
    63
  case "$OPT" in
wenzelm@2879
    64
    a)
wenzelm@2879
    65
      ALL=true
wenzelm@2879
    66
      ;;
wenzelm@2902
    67
    b)
wenzelm@2902
    68
      BATCH=true
wenzelm@2902
    69
      ;;
wenzelm@6256
    70
    i)
wenzelm@7889
    71
      TARGETS="$TARGETS images"
wenzelm@7889
    72
      ;;
wenzelm@7889
    73
    m)
wenzelm@7889
    74
      TARGETS="$TARGETS $OPTARG"
wenzelm@6256
    75
      ;;
wenzelm@2918
    76
    t)
wenzelm@7889
    77
      TARGETS="$TARGETS test"
wenzelm@2918
    78
      ;;
kleing@14041
    79
    p)
kleing@14041
    80
      MAKEFLAGS="$MAKEFLAGS HOL_PROOF_OBJECTS=-p $OPTARG"
kleing@14041
    81
      ;;
wenzelm@2879
    82
    \?)
wenzelm@2879
    83
      usage
wenzelm@2879
    84
      ;;
wenzelm@2879
    85
  esac
wenzelm@2879
    86
done
wenzelm@2879
    87
wenzelm@2879
    88
shift $(($OPTIND - 1))
wenzelm@2879
    89
wenzelm@2879
    90
wenzelm@2879
    91
# args
wenzelm@2879
    92
wenzelm@2879
    93
LOGICS="$@"
wenzelm@2879
    94
wenzelm@4457
    95
[ -n "$ALL" ] && LOGICS="$LOGICS $ALL_LOGICS"
wenzelm@4457
    96
[ -z "$LOGICS" ] && LOGICS="$ISABELLE_LOGIC"
wenzelm@4457
    97
wenzelm@2879
    98
wenzelm@2879
    99
## main
wenzelm@2879
   100
wenzelm@2879
   101
# tell the user about current values
wenzelm@2879
   102
wenzelm@2902
   103
if [ -z "$BATCH" ]; then
wenzelm@2902
   104
  echo
wenzelm@2902
   105
  echo "                *****************************"
wenzelm@2902
   106
  echo "                * Welcome to Isabelle build *"
wenzelm@2902
   107
  echo "                *****************************"
wenzelm@2902
   108
  echo
wenzelm@2902
   109
  echo "Please check $ISABELLE_HOME/etc/settings"
wenzelm@9789
   110
  [ -f "$ISABELLE_HOME_USER/etc/settings" ] && echo "AND $ISABELLE_HOME_USER/etc/settings"
wenzelm@5386
   111
  echo "to make sure that Isabelle's ML system settings and compilation options"
wenzelm@5386
   112
  echo "are appropriate."
wenzelm@2902
   113
  echo
wenzelm@5386
   114
  echo "The current values are:"
wenzelm@2902
   115
  echo
wenzelm@2902
   116
  echo "  ML_SYSTEM=$ML_SYSTEM"
wenzelm@2902
   117
  echo "  ML_HOME=$ML_HOME"
wenzelm@2902
   118
  echo "  ML_OPTIONS=$ML_OPTIONS"
wenzelm@7277
   119
  echo "  ML_PLATFORM=$ML_PLATFORM"
wenzelm@5386
   120
  echo
wenzelm@5386
   121
  echo "  ISABELLE_USEDIR_OPTIONS=$ISABELLE_USEDIR_OPTIONS"
wenzelm@2902
   122
fi
wenzelm@2789
   123
wenzelm@2789
   124
wenzelm@2879
   125
# check logics
wenzelm@2755
   126
wenzelm@2902
   127
if [ -z "$BATCH" ]; then
wenzelm@2902
   128
  echo
wenzelm@2902
   129
  echo
wenzelm@9817
   130
  echo "Press RETURN to compilation of"
wenzelm@2902
   131
  echo
wenzelm@2902
   132
fi
wenzelm@2879
   133
wenzelm@4457
   134
wenzelm@4457
   135
MAKE_LOGICS=""
wenzelm@2879
   136
wenzelm@4457
   137
for L in $LOGICS
wenzelm@4457
   138
do
wenzelm@9789
   139
  DIR="$ISABELLE_HOME/src/$L"
wenzelm@9789
   140
  if [ -f "$DIR/IsaMakefile" ]; then
wenzelm@4457
   141
    MAKE_LOGICS="$MAKE_LOGICS $L"
wenzelm@4457
   142
  else
wenzelm@4457
   143
    echo "No such logic: $L"
wenzelm@4457
   144
  fi
wenzelm@4457
   145
done
wenzelm@4457
   146
wenzelm@2879
   147
wenzelm@2902
   148
if [ -z "$BATCH" ]; then
wenzelm@9789
   149
  echo " $MAKE_LOGICS"
wenzelm@9817
   150
  [ -n "$TARGETS" ] && echo "  (targets:$TARGETS)"
wenzelm@2902
   151
  echo
wenzelm@2902
   152
  read
wenzelm@2902
   153
else
wenzelm@2902
   154
  echo
wenzelm@9789
   155
  echo "Isabelle build: $MAKE_LOGICS"
wenzelm@9817
   156
  [ -n "$TARGETS" ] && echo "(targets:$TARGETS)"
wenzelm@2914
   157
  echo
wenzelm@2902
   158
  echo "ML_SYSTEM=$ML_SYSTEM"
wenzelm@2902
   159
  echo "ML_HOME=$ML_HOME"
wenzelm@2902
   160
  echo "ML_OPTIONS=$ML_OPTIONS"
wenzelm@7311
   161
  echo "ML_PLATFORM=$ML_PLATFORM"
wenzelm@2902
   162
  echo
wenzelm@5393
   163
  echo "ISABELLE_USEDIR_OPTIONS=$ISABELLE_USEDIR_OPTIONS"
wenzelm@5393
   164
  echo
wenzelm@2902
   165
fi
wenzelm@2755
   166
wenzelm@2755
   167
wenzelm@2879
   168
# build it
wenzelm@2879
   169
wenzelm@4457
   170
SECONDS=0
wenzelm@10511
   171
echo "Started at $(date) ($ML_IDENTIFIER on $(hostname))"
wenzelm@2914
   172
wenzelm@4457
   173
for L in $MAKE_LOGICS
wenzelm@2755
   174
do
kleing@14041
   175
  ( cd "$ISABELLE_HOME/src/$L"; "$ISATOOL" make "$MAKEFLAGS" $TARGETS )
wenzelm@2755
   176
done
wenzelm@2902
   177
wenzelm@2914
   178
echo -n "Finished at "; date
wenzelm@4457
   179
wenzelm@9789
   180
ELAPSED=$("$ISABELLE_HOME/lib/scripts/showtime" "$SECONDS")
wenzelm@4457
   181
echo "$ELAPSED total elapsed time"