Module of module types for OrderedType,ComparableType,Printable,Serializable,Discrete...
[ocaml.git] / build / partial-install.sh
blobf0226e6d901b6425a1c910990d27cb0562149e01
1 #!/bin/sh
2 # $Id$
4 ######################################
5 ######### Copied from build/install.sh
6 ######################################
8 set -e
10 cd `dirname $0`/..
12 . config/config.sh
14 not_installed=$PWD/_build/not_installed
16 rm -f "$not_installed"
17 touch "$not_installed"
19 wontinstall() {
20 echo "$1" >> "$not_installed"
21 echo " don't install $1"
24 installbin() {
25 if [ -f "$1" ]; then
26 echo " install binary $2"
27 cp -f "$1" "$2"
28 [ -x "$2" ] || chmod +x "$2"
29 else
30 wontinstall "$1"
34 installbestbin() {
35 if [ -f "$1" ]; then
36 echo " install binary $3 (with `basename $1`)"
37 cp -f "$1" "$3"
38 else
39 if [ -f "$2" ]; then
40 echo " install binary $3 (with `basename $2`)"
41 cp -f "$2" "$3"
42 else
43 echo "None of $1, $2 exists"
44 exit 3
47 [ -x "$3" ] || chmod +x "$3"
50 installlib() {
51 if [ -f "$1" ]; then
52 dest="$2/`basename $1`"
53 echo " install library $dest"
54 cp -f "$1" "$2"
55 if [ "$RANLIB" != "" ]; then
56 "$RANLIB" "$dest"
58 else
59 wontinstall "$1"
63 installdir() {
64 args=""
65 while [ $# -gt 1 ]; do
66 if [ -f "$1" ]; then
67 args="$args $1"
68 else
69 wontinstall "$1"
71 shift
72 done
73 last="$1"
74 for file in $args; do
75 echo " install $last/`basename $file`"
76 cp -f "$file" "$last"
77 done
80 installlibdir() {
81 args=""
82 while [ $# -gt 1 ]; do
83 args="$args $1"
84 shift
85 done
86 last="$1"
87 for file in $args; do
88 installlib "$file" "$last"
89 done
92 mkdir -p $BINDIR
93 mkdir -p $LIBDIR
94 mkdir -p $LIBDIR/camlp4
95 mkdir -p $LIBDIR/ocamlbuild
96 mkdir -p $STUBLIBDIR
97 mkdir -p $MANDIR/man1
98 mkdir -p $MANDIR/man3
99 mkdir -p $MANDIR/man$MANEXT
101 cd _build
103 echo "Installing camlp4..."
104 installbin camlp4/camlp4prof.byte$EXE $BINDIR/camlp4prof$EXE
105 installbin camlp4/mkcamlp4.byte$EXE $BINDIR/mkcamlp4$EXE
106 installbin camlp4/camlp4.byte$EXE $BINDIR/camlp4$EXE
107 installbin camlp4/camlp4boot.byte$EXE $BINDIR/camlp4boot$EXE
108 installbin camlp4/camlp4o.byte$EXE $BINDIR/camlp4o$EXE
109 installbin camlp4/camlp4of.byte$EXE $BINDIR/camlp4of$EXE
110 installbin camlp4/camlp4oof.byte$EXE $BINDIR/camlp4oof$EXE
111 installbin camlp4/camlp4orf.byte$EXE $BINDIR/camlp4orf$EXE
112 installbin camlp4/camlp4r.byte$EXE $BINDIR/camlp4r$EXE
113 installbin camlp4/camlp4rf.byte$EXE $BINDIR/camlp4rf$EXE
114 installbin camlp4/camlp4o.native$EXE $BINDIR/camlp4o.opt$EXE
115 installbin camlp4/camlp4of.native$EXE $BINDIR/camlp4of.opt$EXE
116 installbin camlp4/camlp4oof.native$EXE $BINDIR/camlp4oof.opt$EXE
117 installbin camlp4/camlp4orf.native$EXE $BINDIR/camlp4orf.opt$EXE
118 installbin camlp4/camlp4r.native$EXE $BINDIR/camlp4r.opt$EXE
119 installbin camlp4/camlp4rf.native$EXE $BINDIR/camlp4rf.opt$EXE
121 cd camlp4
122 CAMLP4DIR=$LIBDIR/camlp4
123 for dir in Camlp4Parsers Camlp4Printers Camlp4Filters Camlp4Top; do
124 echo "Installing $dir..."
125 mkdir -p $CAMLP4DIR/$dir
126 installdir \
127 $dir/*.cm* \
128 $dir/*.$O \
129 $CAMLP4DIR/$dir
130 done
131 installdir \
132 camlp4lib.cma camlp4lib.cmxa Camlp4.cmi \
133 camlp4fulllib.cma camlp4fulllib.cmxa \
134 camlp4o.cma camlp4of.cma camlp4oof.cma \
135 camlp4orf.cma camlp4r.cma camlp4rf.cma \
136 Camlp4Bin.cm[iox] Camlp4Bin.$O Camlp4Top.cm[io] \
137 Camlp4_config.cmi camlp4prof.cm[iox] camlp4prof.$O Camlp4_import.cmi \
138 $CAMLP4DIR
139 installlibdir camlp4lib.$A camlp4fulllib.$A $CAMLP4DIR
140 cd ..
142 echo "Installing ocamlbuild..."
143 cd ocamlbuild
144 installbin ocamlbuild.byte$EXE $BINDIR/ocamlbuild.byte$EXE
145 installbin ocamlbuild.native$EXE $BINDIR/ocamlbuild.native$EXE
146 installbestbin ocamlbuild.native$EXE ocamlbuild.byte$EXE $BINDIR/ocamlbuild$EXE
148 installlibdir \
149 ocamlbuildlib.$A \
150 $LIBDIR/ocamlbuild
152 installdir \
153 ocamlbuildlib.cmxa \
154 ocamlbuildlib.cma \
155 ocamlbuild_plugin.cmi \
156 ocamlbuild_pack.cmi \
157 ocamlbuild_unix_plugin.cmi \
158 ocamlbuild_unix_plugin.cmo \
159 ocamlbuild_unix_plugin.cmx \
160 ocamlbuild_unix_plugin.$O \
161 ocamlbuild_executor.cmi \
162 ocamlbuild_executor.cmo \
163 ocamlbuild_executor.cmx \
164 ocamlbuild_executor.$O \
165 ocamlbuild.cmo \
166 ocamlbuild.cmx \
167 ocamlbuild.$O \
168 $LIBDIR/ocamlbuild
169 cd ..
171 installdir \
172 ../ocamlbuild/man/ocamlbuild.1 \
173 $MANDIR/man1