echo =========================================
set INCLUDE=..\ACDV\include\;C:\Ultimate Toolbox\Lib\Jpeg\Jpegsrc6;C:\Ultimate Toolbox\include;C:\Ultimate Toolbox\Lib\Jpeg;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include;c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include;c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\\include; 
set LIB=.\libs\32;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\lib;c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib;c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\\lib 
set PATH=c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin;c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools;c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\bin;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\tools;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\ide;C:\Program Files (x86)\HTML Help Workshop;c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\\bin;C:\Windows\Microsoft.NET\Framework\v4.0.30319\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\;C:\Windows\SysWow64;;C:\Program Files (x86)\Far;C:\Program Files (x86)\MiKTeX 2.5\miktex\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files\Adobe\AGL;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;c:\exec;C:\Program Files (x86)\QuickTime\QTSystem\; 
mkdir .\rez
cd .\MkLib
delete lib.out 

"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe" /c /ZI /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D _USRDLL /D _WINDLL /Gm /EHsc /RTC1 /MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Yc"StdAfx.h" /Fp"Debug\MkLib.pch" /Fo"Debug\\" /Fd"Debug\vc100.pdb" /Gd /TP /analyze- /errorReport:prompt stdafx.cpp

echo ====== Compile main file ======= >lib.out
"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe" /c /ZI /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D _USRDLL /D _WINDLL /Gm /EHsc /RTC1 /MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Yu"StdAfx.h" /Fp"Debug\MkLib.pch" /Fo"Debug\\" /Fd"Debug\vc100.pdb" /Gd /TP /analyze- /errorReport:prompt AddFuns.cpp lib.cpp MkLib.cpp >>lib.out
if errorlevel 1 goto lerr
"c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe" /D _DEBUG /l"0x0409" /IDebug\ /nologo /fo"Debug\MkLib.res" MkLib.rc 
if errorlevel 1 goto lerr
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe" /nologo /fo"Debug\MkLib.dll.embed.manifest.res" Debug\MkLib_manifest.rc 
if errorlevel 1 goto lerr
echo ====== Link ======= >>lib.out
"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\link.exe" /ERRORREPORT:PROMPT /OUT:".\rez\Otek.dll" /INCREMENTAL /NOLOGO /DEF:".\MkLib.def" /MANIFEST /ManifestFile:"Debug\MkLib.dll.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:".\rez\MkLib.pdb" /SUBSYSTEM:WINDOWS /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\rez\Otek.lib" /MACHINE:X86 /DLL Debug\MkLib.res .\debug\AddFuns.obj .\debug\lib.obj .\debug\MkLib.obj .\debug\stdafx.obj  >>lib.out
if errorlevel 1 goto lerr

goto le
:lerr
echo ERROR!!!
echo ERROR!!! >>lib.out
exit

:le
echo SUCCESS
echo SUCCESS >>lib.out
