forked from ocaml/ocaml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor_build.sh
66 lines (53 loc) · 2.28 KB
/
appveyor_build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
#**************************************************************************
#* *
#* OCaml *
#* *
#* Christophe Troestler *
#* *
#* Copyright 2015 Christophe Troestler *
#* *
#* All rights reserved. This file is distributed under the terms of *
#* the GNU Lesser General Public License version 2.1, with the *
#* special exception on linking described in the file LICENSE. *
#* *
#**************************************************************************
function run {
NAME=$1
shift
echo "-=-=- $NAME -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
$@
CODE=$?
if [ $CODE -ne 0 ]; then
echo "-=-=- $NAME failed! -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
exit $CODE
else
echo "-=-=- End of $NAME -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
fi
}
cd $APPVEYOR_BUILD_FOLDER
git worktree add ../build-mingw32 -b appveyor-build-mingw32
cd ../build-mingw32
git submodule update --init flexdll
cd $APPVEYOR_BUILD_FOLDER
cp config/m-nt.h config/m.h
cp config/s-nt.h config/s.h
cp config/Makefile.msvc64 config/Makefile
PREFIX="C:/Program Files/OCaml"
echo "Edit config/Makefile to set PREFIX=$PREFIX"
sed -i -e "s|PREFIX=.*|PREFIX=$PREFIX|" config/Makefile
#run "Content of config/Makefile" cat config/Makefile
run "make world" make world
run "make bootstrap" make bootstrap
run "make opt" make opt
run "make opt.opt" make opt.opt
cd ../build-mingw32
cp config/m-nt.h config/m.h
cp config/s-nt.h config/s.h
cp config/Makefile.mingw config/Makefile
PREFIX="C:/Program Files/OCaml-mingw32"
echo "Edit config/Makefile to set PREFIX=$PREFIX"
sed -i -e "s|PREFIX=.*|PREFIX=$PREFIX|" config/Makefile
#run "Content of config/Makefile" cat config/Makefile
run "make flexdll" make flexdll
run "make world.opt" make world.opt