author  wenzelm 
Thu, 11 Aug 2011 12:53:41 +0200  
changeset 44152  a07748619f53 
parent 43521  d477b92109b8 
child 45091  bf56eb7af632 
permissions  rwxrxrx 
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  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 
## directory layout 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

6 

34282
549969a7f582
simplified build/bootstrap of Isabelle/Scala components  avoid make;
wenzelm
parents:
31831
diff
changeset

7 
if [ z "$ISABELLE_HOME" ]; then 
549969a7f582
simplified build/bootstrap of Isabelle/Scala components  avoid make;
wenzelm
parents:
31831
diff
changeset

8 
ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd P)"; cd ..; pwd)" 
549969a7f582
simplified build/bootstrap of Isabelle/Scala components  avoid make;
wenzelm
parents:
31831
diff
changeset

9 
ISABELLE_TOOL="$ISABELLE_HOME/bin/isabelle" 
549969a7f582
simplified build/bootstrap of Isabelle/Scala components  avoid make;
wenzelm
parents:
31831
diff
changeset

10 
fi 
27628
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

11 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

12 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

13 
## diagnostics 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

14 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

15 
PRG="$(basename "$0")" 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

16 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

17 
function usage() 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

18 
{ 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

19 
cat <<EOF 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

20 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

21 
Usage: $PRG [MODULES] 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

22 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

23 
Produce Isabelle distribution modules from current repository sources. 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

24 
The MODULES list may contain any of the following: 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

25 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

26 
all all modules below 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

27 
browser graph browser (requires jdk) 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

28 
doc documentation (requires latex and rail) 
34876  29 
jars Isabelle/Scala layer (requires Scala in \$SCALA_HOME) 
43280  30 
jars_fresh fresh build of jars 
27628
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

31 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

32 
EOF 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

33 
exit 1 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

34 
} 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

35 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

36 
function fail() 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

37 
{ 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

38 
echo "$1" >&2 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

39 
exit 2 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

40 
} 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

41 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

42 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

43 
## process command line 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

44 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

45 
[ "$#" eq 0 ] && usage 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

46 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

47 
MODULES="$@"; shift "$#" 
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 
## modules 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

51 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

52 
function build_all () 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

53 
{ 
27649  54 
build_doc 
27628
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

55 
build_browser 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

56 
build_jars 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

57 
} 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

58 

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_browser () 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

61 
{ 
34283
7911e83d06c0
simplified build/bootstrap of graph browser  avoid make;
wenzelm
parents:
34282
diff
changeset

62 
pushd "$ISABELLE_HOME/lib/browser" >/dev/null 
34297  63 
"$ISABELLE_TOOL" env ./build  exit $? 
34283
7911e83d06c0
simplified build/bootstrap of graph browser  avoid make;
wenzelm
parents:
34282
diff
changeset

64 
popd >/dev/null 
27628
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_doc () 
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 documentation ..." 
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  74 
cd "$ISABELLE_HOME/docsrc" 
27628
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

75 
for DOC in $(cat Dirs) 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

76 
do 
27629  77 
pushd "$DOC" >/dev/null 
27628
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

78 
make clean dvi  fail "DVI document for $DOC failed!" 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

79 
make clean pdf  fail "PDF document for $DOC failed!" 
27629  80 
popd >/dev/null 
27628
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

81 
done 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

82 
} 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

83 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

84 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

85 
function build_jars () 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

86 
{ 
43521
d477b92109b8
provide Isabelle/Scala environment as Java extension, instead of user classpath
wenzelm
parents:
43280
diff
changeset

87 
"$ISABELLE_HOME/lib/scripts/java_ext_dirs" >/dev/null 
28956  88 
pushd "$ISABELLE_HOME/src/Pure" >/dev/null 
43280  89 
"$ISABELLE_TOOL" env ./buildjars "$@"  exit $? 
27904  90 
popd >/dev/null 
27628
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

91 
} 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

92 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

93 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

94 
## main 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

95 

901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

96 
for MODULE in $MODULES 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

97 
do 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

98 
case $MODULE in 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

99 
all) build_all;; 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

100 
browser) build_browser;; 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

101 
doc) build_doc;; 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

102 
jars) build_jars;; 
43280  103 
jars_fresh) build_jars f;; 
27628
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

104 
*) fail "Bad module $MODULE" 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

105 
esac 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

106 
done 