@echo off
rem Modifier au besoin QTDIR

set VCID=10

set QTDIR=C:\Qt\4.8.4
set PATH=%QTDIR%\bin;%PATH%
set QMAKEPATH=%QTDIR%\qmake

if exist "C:\Program Files (x86)\" set "PROGRAMFILES=C:\Program Files (x86)" else set PROGRAMFILES=C:\Program Files
call "%PROGRAMFILES%\Microsoft Visual Studio %VCID%.0\VC\bin\vcvars32.bat"

qmake ..\WinCaml.pro
nmake -f Makefile.release
nmake -f Makefile.release clean

xcopy /q /s /y /i ..\..\caml\ocaml\windows WinCaml5\ocaml\windows\
move /y release\WinCaml.exe WinCaml5

copy a\unlock.exe WinCaml5
copy ..\..\sources\Win\WinCamlInit.bat WinCaml5
xcopy /q /s /y /i ..\..\caml\ocaml\htmlman WinCaml5\ocaml\htmlman\
xcopy /q /s /y /i ..\..\caml\"caml-light"  WinCaml5\"caml-light"\
del WinCaml5\"caml-light"\bin\lin*
del WinCaml5\caml-light"\bin\mac*
xcopy /q /s /y /i ..\..\caml\exemples WinCaml5\exemples\

copy %QTDIR%\bin\QtCore4.dll WinCaml5
copy %QTDIR%\bin\QtGui4.dll WinCaml5

rmdir debug
rmdir release
del Makefile*