Admin/build
author wenzelm
Tue, 15 Sep 2009 23:57:07 +0200
changeset 32576 20b261654e33
parent 31831 92993da74973
child 34282 549969a7f582
permissions -rwxr-xr-x
double linking for improved performance of "prev"; misc tuning;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27628
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
     1
#!/usr/bin/env bash
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
     2
#
27629
ec92e8eb6a1e less verbosity;
wenzelm
parents: 27628
diff changeset
     3
# Administrative build for Isabelle source distribution.
27628
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
     4
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
     5
## global environment
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
     6
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
     7
#paranoia setting for sunbroy
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
     8
PATH="/usr/local/dist/DIR/j2sdk1.5.0/bin:$PATH"
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
     9
29153
789cd671636e updated scala path;
wenzelm
parents: 28956
diff changeset
    10
PATH="/home/scala/current/bin:$PATH"
31831
92993da74973 clarified "jars" target;
wenzelm
parents: 29186
diff changeset
    11
if [ -z "$SCALA_HOME" ]; then
92993da74973 clarified "jars" target;
wenzelm
parents: 29186
diff changeset
    12
  export SCALA_HOME="$(dirname "$(dirname "$(type -p scalac)")")"
92993da74973 clarified "jars" target;
wenzelm
parents: 29186
diff changeset
    13
fi
27628
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    14
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    15
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    16
## directory layout
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    17
28956
64754369cee3 eliminated traces of old Distribution directory;
wenzelm
parents: 28504
diff changeset
    18
ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd ..; pwd)"
64754369cee3 eliminated traces of old Distribution directory;
wenzelm
parents: 28504
diff changeset
    19
ISABELLE_TOOL="$ISABELLE_HOME/bin/isabelle"
27628
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    20
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    21
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    22
## diagnostics
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    23
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    24
PRG="$(basename "$0")"
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    25
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    26
function usage()
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    27
{
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    28
  cat <<EOF
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    29
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    30
Usage: $PRG [MODULES]
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    31
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    32
  Produce Isabelle distribution modules from current repository sources.
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    33
  The MODULES list may contain any of the following:
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    34
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    35
    all             all modules below
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    36
    browser         graph browser (requires jdk)
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    37
    doc             documentation (requires latex and rail)
31831
92993da74973 clarified "jars" target;
wenzelm
parents: 29186
diff changeset
    38
    jars            Scala/JVM components (requires scala)
27628
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    39
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    40
EOF
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    41
  exit 1
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    42
}
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    43
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    44
function fail()
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    45
{
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    46
  echo "$1" >&2
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    47
  exit 2
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    48
}
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    49
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    50
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    51
## process command line
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    52
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    53
[ "$#" -eq 0 ] && usage
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    54
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    55
MODULES="$@"; shift "$#"
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    56
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    57
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    58
## modules
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    59
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    60
function build_all ()
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    61
{
27649
cb26fe3ea037 tuned build order;
wenzelm
parents: 27629
diff changeset
    62
  build_doc
27628
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    63
  build_browser
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    64
  build_jars
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    65
}
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    66
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    67
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    68
function build_browser ()
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    69
{
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    70
  echo "###"
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    71
  echo "### Building graph browser ..."
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    72
  echo "###"
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    73
28956
64754369cee3 eliminated traces of old Distribution directory;
wenzelm
parents: 28504
diff changeset
    74
  cd "$ISABELLE_HOME/lib/browser"
27628
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    75
  make clean all || fail "Failed to build graph browser!"
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    76
}
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    77
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    78
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    79
function build_doc ()
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    80
{
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    81
  echo "###"
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    82
  echo "### Building documentation ..."
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    83
  echo "###"
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    84
28956
64754369cee3 eliminated traces of old Distribution directory;
wenzelm
parents: 28504
diff changeset
    85
  cd "$ISABELLE_HOME/doc-src"
27628
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    86
  for DOC in $(cat Dirs)
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    87
  do
27629
ec92e8eb6a1e less verbosity;
wenzelm
parents: 27628
diff changeset
    88
    pushd "$DOC" >/dev/null
27628
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    89
    make clean dvi || fail "DVI document for $DOC failed!"
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    90
    make clean pdf || fail "PDF document for $DOC failed!"
27629
ec92e8eb6a1e less verbosity;
wenzelm
parents: 27628
diff changeset
    91
    popd >/dev/null
27628
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    92
  done
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    93
}
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    94
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    95
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    96
function build_jars ()
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    97
{
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
    98
  echo "###"
31831
92993da74973 clarified "jars" target;
wenzelm
parents: 29186
diff changeset
    99
  echo "### Building Scala/JVM components ..."
27628
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
   100
  echo "###"
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
   101
31831
92993da74973 clarified "jars" target;
wenzelm
parents: 29186
diff changeset
   102
  [ -z "$SCALA_HOME" ] && fail "Scala unavailable: unknown SCALA_HOME"
27978
9fb6cfaa5da5 jars: removed obsolete Java process wrapper (cf. new Pure.jar);
wenzelm
parents: 27915
diff changeset
   103
28956
64754369cee3 eliminated traces of old Distribution directory;
wenzelm
parents: 28504
diff changeset
   104
  pushd "$ISABELLE_HOME/src/Pure" >/dev/null
31831
92993da74973 clarified "jars" target;
wenzelm
parents: 29186
diff changeset
   105
  "$ISABELLE_TOOL" make jars || fail "Failed to build isabelle-scala.jar"
27904
343696007eca jars: build Pure.jar;
wenzelm
parents: 27655
diff changeset
   106
  popd >/dev/null
27628
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
   107
}
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
   108
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
   109
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
   110
## main
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
   111
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
   112
for MODULE in $MODULES
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
   113
do
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
   114
  case $MODULE in
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
   115
    all) build_all;;
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
   116
    browser) build_browser;;
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
   117
    doc) build_doc;;
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
   118
    jars) build_jars;;
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
   119
    *) fail "Bad module $MODULE"
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
   120
  esac
901656b3205d Administrative build -- finish Isabelle source distribution.
wenzelm
parents:
diff changeset
   121
done