author  huffman 
Wed, 04 Mar 2009 17:12:23 0800  
changeset 30273  ecd6f0ca62ea 
parent 29186  3d25e96ceb98 
child 31831  92993da74973 
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 
## 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  10 
PATH="/home/scala/current/bin:$PATH" 
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 
## directory layout 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

14 

28956  15 
ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd P)"; cd ..; pwd)" 
16 
ISABELLE_TOOL="$ISABELLE_HOME/bin/isabelle" 

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

17 

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

18 

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

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

20 

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

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

22 

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

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

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

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

26 

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

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

28 

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

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

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

31 

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

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

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

34 
doc documentation (requires latex and rail) 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

35 
jars JVM components (requires jdk and scala) 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

36 

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

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

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

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

40 

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

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

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

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

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

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

46 

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

47 

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

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

49 

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

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

51 

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

52 
MODULES="$@"; shift "$#" 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

53 

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

56 

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

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

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

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

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

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

63 

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

64 

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

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

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

67 
echo "###" 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

68 
echo "### Building graph browser ..." 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

69 
echo "###" 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

70 

28956  71 
cd "$ISABELLE_HOME/lib/browser" 
27628
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

72 
make clean all  fail "Failed to build graph browser!" 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

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

74 

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

75 

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

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

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

78 
echo "###" 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

79 
echo "### Building documentation ..." 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

80 
echo "###" 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

81 

28956  82 
cd "$ISABELLE_HOME/docsrc" 
27628
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

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

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

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

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

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

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

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

95 
echo "###" 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

96 
echo "### Building JVM components ..." 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

97 
echo "###" 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

98 

27978
9fb6cfaa5da5
jars: removed obsolete Java process wrapper (cf. new Pure.jar);
wenzelm
parents:
27915
diff
changeset

99 
type p scalac >/dev/null  fail "Scala compiler unavailable" 
9fb6cfaa5da5
jars: removed obsolete Java process wrapper (cf. new Pure.jar);
wenzelm
parents:
27915
diff
changeset

100 

28956  101 
pushd "$ISABELLE_HOME/src/Pure" >/dev/null 
28500  102 
"$ISABELLE_TOOL" make jar  fail "Failed to build Pure.jar!" 
27904  103 
popd >/dev/null 
27628
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

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

105 

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

106 

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

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

108 

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

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

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

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

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

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

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

115 
jars) build_jars;; 
901656b3205d
Administrative build  finish Isabelle source distribution.
wenzelm
parents:
diff
changeset

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

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

118 
done 