#!/bin/sh

#Ajuster QTDIR et le fichier ../WinCaml.pro
 
#QTDIR=/opt/Qt5.4.1/5.4/Src/qtbase
#QTDIR=/opt/Qt5.4.1/5.4/gcc_64
#QTDIR="$HOME/qt-everywhere-opensource-src-5.8.0/qtbase"
QTDIR="$HOME/Qt5.9.1/5.9.1/gcc_64"
#QTDIR="$HOME/qt-everywhere-opensource-src-5.9.1/qtbase"
export PATH="$QTDIR/bin:$PATH"
export QTDIR

cd "$(dirname "$0")"

qmake -spec linux-g++ ../WinCaml.pro
make
make clean
rm -f Makefile

test -d WinCaml6 || mkdir WinCaml6
test -d WinCaml6/ocaml || mkdir WinCaml6/ocaml
mv WinCaml WinCaml6
cp -Rf ../../caml/ocaml/linux WinCaml6/ocaml
cp -Rf ../../caml/doc WinCaml6
cp -Rf ../../caml/caml-light  WinCaml6
#rm -f WinCaml6/caml-light/bin/caml*
#rm -f WinCaml6/caml-light/bin/mac*
chmod +x WinCaml6/caml-light/bin/lin*
cp -Rf ../../caml/exemples WinCaml6
cp a/WinCamlIcon.png WinCaml6
test -d "$HOME"/WinCaml6 && rm -rf "$HOME"/WinCaml6
mv WinCaml6 "$HOME"
cp a/WinCaml.txt "$HOME"/WinCaml.desktop
echo Exec="$HOME"/WinCaml6/WinCaml %F >> "$HOME"/WinCaml.desktop
echo Icon="$HOME"/WinCaml6/WinCamlIcon.png >> "$HOME"/WinCaml.desktop
echo Path="$HOME"/WinCaml6 >> "$HOME"/WinCaml.desktop

