#!/bin/sh

#Ajuster QMAKE
QMAKE=qmake
#QMAKE=/opt/Qt5.4.1/5.4/Src/qtbase/bin/qmake
#QMAKE=/opt/Qt5.4.1/5.4/gcc_64/bin/qmake
#QMAKE=/opt/Qt/5.3/gcc_64/bin/qmake
#QMAKE=/opt/Qt5.2.0/5.2.0/gcc_64/bin/qmake
#QMAKE=/opt/Qt5.1.1/5.1.1/gcc_64/bin/qmake
#QMAKE=/opt/Qt5.0.2/5.0.2/gcc_64/bin/qmake
#QMAKE=/opt/Qt5.0.1/5.0.1/gcc_64/bin/qmake
#QMAKE=/opt/Qt5.0.0/5.0.0/gcc_64/bin/qmake

"$QMAKE" -spec linux-g++ ../WinCaml.pro
make
make clean
rm -f Makefile
test -d WinCaml5 || mkdir WinCaml5
test -d WinCaml5/ocaml || mkdir WinCaml5/ocaml
mv WinCaml WinCaml5
cp -Rf ../../caml/ocaml/linux WinCaml5/ocaml
cp -Rf ../../caml/ocaml/htmlman WinCaml5/ocaml
cp -Rf ../../caml/caml-light  WinCaml5
rm -f WinCaml5/caml-light/bin/caml*
rm -f WinCaml5/caml-light/bin/mac*
chmod +x WinCaml5/caml-light/bin/lin*
cp -Rf ../../caml/exemples WinCaml5
cp a/WinCamlIcon.png WinCaml5
test -d "$HOME"/WinCaml5 && rm -rf "$HOME"/WinCaml5
mv WinCaml5 "$HOME"
cp a/WinCaml.txt "$HOME"/WinCaml.desktop
echo Exec="$HOME"/WinCaml5/WinCaml %F >> "$HOME"/WinCaml.desktop
echo Icon="$HOME"/WinCaml5/WinCamlIcon.png >> "$HOME"/WinCaml.desktop
echo Path="$HOME"/WinCaml5 >> "$HOME"/WinCaml.desktop

