Admin/makebin
changeset 12827 05c13f5a515d
parent 12721 226fc0e2e7e3
child 12830 c037ff3e5ddf
     1.1 --- a/Admin/makebin	Mon Jan 21 14:48:11 2002 +0100
     1.2 +++ b/Admin/makebin	Mon Jan 21 15:28:34 2002 +0100
     1.3 @@ -7,7 +7,6 @@
     1.4  
     1.5  ## global settings
     1.6  
     1.7 -FAKE_BUILD=""
     1.8  DISTBASE=~/tmp/isadist
     1.9  TMP="/var/tmp/isabelle-makebin$$"
    1.10  
    1.11 @@ -24,9 +23,13 @@
    1.12  function usage()
    1.13  {
    1.14    echo
    1.15 -  echo "Usage: $PRG ARCHIVE"
    1.16 +  echo "Usage: $PRG [OPTIONS] ARCHIVE"
    1.17    echo
    1.18 -  echo "  Make Isabelle logic images for current platform."
    1.19 +  echo "  Options are:"
    1.20 +  echo "    -l           include library"
    1.21 +  echo "    -t           test run -- no build phase"
    1.22 +  echo
    1.23 +  echo "  Precompile Isabelle for the current platform."
    1.24    echo
    1.25    exit 1
    1.26  }
    1.27 @@ -40,6 +43,31 @@
    1.28  
    1.29  ## process command line
    1.30  
    1.31 +# options
    1.32 +
    1.33 +DO_LIBRARY=""
    1.34 +TEST_RUN=""
    1.35 +
    1.36 +while getopts "lt" OPT
    1.37 +do
    1.38 +  case "$OPT" in
    1.39 +    l)
    1.40 +      DO_LIBRARY=true
    1.41 +      ;;
    1.42 +    t)
    1.43 +      TEST_RUN=true
    1.44 +      ;;
    1.45 +    \?)
    1.46 +      usage
    1.47 +      ;;
    1.48 +  esac
    1.49 +done
    1.50 +
    1.51 +shift $(($OPTIND - 1))
    1.52 +
    1.53 +
    1.54 +# args
    1.55 +
    1.56  [ "$#" -gt 1 ] && usage
    1.57  
    1.58  ARCHIVE="$1"; shift
    1.59 @@ -74,14 +102,19 @@
    1.60  COMPILER=$(./bin/isatool getenv -b ML_IDENTIFIER)
    1.61  PLATFORM=$(./bin/isatool getenv -b ML_PLATFORM)
    1.62  
    1.63 -if [ -n "$FAKE_BUILD" ]; then
    1.64 -  mkdir -p "heaps/$COMPILER"
    1.65 +if [ -n "$TEST_RUN" ]; then
    1.66 +  mkdir -p "heaps/$COMPILER/log"
    1.67    touch "heaps/$COMPILER/HOL"
    1.68 +  touch "heaps/$COMPILER/log/HOL.gz"
    1.69    touch "heaps/$COMPILER/HOL-Real"
    1.70 +  touch "heaps/$COMPILER/log/HOL-Real.gz"
    1.71    touch "heaps/$COMPILER/ZF"
    1.72 +  touch "heaps/$COMPILER/log/ZF.gz"
    1.73 +  mkdir browser_info
    1.74  else
    1.75    ./build -b -m HOL-Real HOL
    1.76    ./build -b ZF
    1.77 +  [ -n "$DO_LIBRARY" ] && ./build -bait
    1.78    rm -f "heaps/$COMPILER/Pure" "heaps/$COMPILER/FOL"
    1.79  fi
    1.80  
    1.81 @@ -98,8 +131,13 @@
    1.82    "$TAR" cf "${IMG}_$PLATFORM.tar" \
    1.83      "$ISABELLE_NAME/heaps/$COMPILER/$IMG" \
    1.84      "$ISABELLE_NAME/heaps/$COMPILER/log/$IMG.gz"
    1.85 -  gzip "${IMG}_$PLATFORM.tar"
    1.86 +  gzip -f "${IMG}_$PLATFORM.tar"
    1.87    cp -f "${IMG}_$PLATFORM.tar.gz" "$ARCHIVE_DIR"
    1.88 +
    1.89 +  if [ -n "$DO_LIBRARY" ]; then
    1.90 +    "$TAR" cf "${ISABELLE_NAME}_library.tar" $ISABELLE_NAME/browser_info && \
    1.91 +      gzip -f "${ISABELLE_NAME}_library.tar"
    1.92 +  fi
    1.93  done
    1.94  
    1.95