Use condition variables (SleepConditionVariableCS) instead of events for synchronization.
[tee-win32.git] / make.cmd
blobea20bf8c663a17be437253c7505dc435c7510d4a
1 @echo off
2 cd /d "%~dp0"
4 if "%MSVC_PATH%"=="" (
5 set "MSVC_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
8 set "SOLUTION_FILE=tee.sln"
10 if exist "%MSVC_PATH%\VC\Auxiliary\Build\vcvarsall.bat" (
11 call "%MSVC_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x86
12 ) else (
13 echo vcvarsall.bat not found. Please check your MSVC_PATH variable!
14 goto BuildError
17 REM ------------------------------------------------------------
18 REM CLEAN UP
19 REM ------------------------------------------------------------
21 if exist "%CD%\bin\" rmdir /S /Q "%CD%\bin"
22 if exist "%CD%\bin\" (
23 echo Failed to clean up intermediate files!
24 goto BuildError
27 if exist "%CD%\obj\" rmdir /S /Q "%CD%\obj"
28 if exist "%CD%\obj\" (
29 echo Failed to clean up intermediate files!
30 goto BuildError
33 REM ------------------------------------------------------------
34 REM BUILD EXECUTABLES
35 REM ------------------------------------------------------------
37 MSBuild.exe /property:Platform=x86 /property:Configuration=Release /target:rebuild "%CD%\%SOLUTION_FILE%"
38 if not "%ERRORLEVEL%"=="0" goto BuildError
40 MSBuild.exe /property:Platform=x64 /property:Configuration=Release /target:rebuild "%CD%\%SOLUTION_FILE%"
41 if not "%ERRORLEVEL%"=="0" goto BuildError
43 MSBuild.exe /property:Platform=a64 /property:Configuration=Release /target:rebuild "%CD%\%SOLUTION_FILE%"
44 if not "%ERRORLEVEL%"=="0" goto BuildError
46 REM ------------------------------------------------------------
47 REM COPY FILES
48 REM ------------------------------------------------------------
50 if not exist "%CD%\out\" mkdir "%CD%\out"
52 if exist "%CD%\out\tee-x86.exe" del /F "%CD%\out\tee-x86.exe"
53 if exist "%CD%\out\tee-x64.exe" del /F "%CD%\out\tee-x64.exe"
54 if exist "%CD%\out\tee-a64.exe" del /F "%CD%\out\tee-a64.exe"
56 copy /Y /B "%CD%\bin\Win32\Release\tee.exe" "%CD%\out\tee-x86.exe"
57 copy /Y /B "%CD%\bin\x64\.\Release\tee.exe" "%CD%\out\tee-x64.exe"
58 copy /Y /B "%CD%\bin\ARM64\Release\tee.exe" "%CD%\out\tee-a64.exe"
60 attrib +R "%CD%\out\tee-x86.exe"
61 attrib +R "%CD%\out\tee-x64.exe"
62 attrib +R "%CD%\out\tee-a64.exe"
64 REM ------------------------------------------------------------
65 REM COMPLETED
66 REM ------------------------------------------------------------
68 echo.
69 echo Build completed.
70 echo.
71 pause
72 goto:eof
74 REM ------------------------------------------------------------
75 REM BUILD ERROR
76 REM ------------------------------------------------------------
78 :BuildError
79 echo.
80 echo Build has failed !!!
81 echo.
82 pause