#!/bin/sh

#Ajuster QMAKE
#QMAKE=qmake
QMAKE="$HOME"/Qt5.4.1/5.4/clang_64/bin/qmake
#QMAKE="$HOME"/Qt/5.3/clang_64/bin/qmake
#QMAKE="$HOME"/Qt5.2.0/5.2.0/clang_64/bin/qmake
#QMAKE="$HOME"/Qt5.1.1/5.1.1/clang_64/bin/qmake
#QMAKE="$HOME"/Qt5.0.2/5.0.2/clang_64/bin/qmake
#QMAKE="$HOME"/Qt5.0.1/5.0.1/clang_64/bin/qmake
#QMAKE="$HOME"/QtSDK/Desktop/Qt/4.8.1/gcc/bin/qmake

"$QMAKE" -spec macx-g++ ../WinCaml.pro
make
make clean
rm MakeFile
mv WinCaml WinCaml5/WinCaml.app/Contents/MacOS
test -d WinCaml5/WinCaml.app/Contents/MacOS/ocaml || mkdir WinCaml5/WinCaml.app/Contents/MacOS/ocaml
cp -Rf ../../caml/ocaml/mac WinCaml5/WinCaml.app/Contents/MacOS/ocaml
cp -Rf ../../caml/ocaml/htmlman WinCaml5/WinCaml.app/contents/MacOS/ocaml
cp -Rf ../../caml/caml-light  WinCaml5/WinCaml.app/contents/MacOS/
rm -f WinCaml5/WinCaml.app/contents/MacOS/caml-light/bin/caml*
rm -f WinCaml5/WinCaml.app/contents/MacOS/caml-light/bin/lin*
chmod +x WinCaml5/WinCaml.app/contents/MacOS/caml-light/bin/mactoplevel*
cp -Rf ../../caml/exemples WinCaml5
