#!/bin/sh

#Ajuster QTDIR et le fichier ../WinCaml.pro

#export QTDIR="$HOME/qt-everywhere-opensource-src-5.5.1/qtbase"
export QTDIR="$HOME/qt-everywhere-opensource-src-5.8.0/qtbase"
#export QTDIR="$HOME/Qt5.8.0/5.8/clang_64"
PATH="$QTDIR/bin:$PATH"

cd "$(dirname "$0")"

qmake -spec macx-clang ../WinCaml.pro
make
make clean
rm MakeFile

mv WinCaml WinCaml6/WinCaml.app/Contents/MacOS
test -d WinCaml6/ocaml || mkdir WinCaml6/ocaml
cp -Rf ../../caml/ocaml/mac WinCaml6/ocaml
cp -Rf ../../caml/doc WinCaml6/
cp -Rf ../../caml/caml-light  WinCaml6/
#rm -f WinCaml6/caml-light/bin/camltoplevel*
#rm -f WinCaml6/caml-light/bin/lintoplevel*
chmod +x WinCaml6/caml-light/bin/mactoplevel*
cp -Rf ../../caml/exemples WinCaml6
