-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmake.cmd
96 lines (72 loc) · 2.91 KB
/
make.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@echo off
cd /d "%~dp0"
if "%MSVC_PATH%"=="" (
set "MSVC_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
)
if "%PANDOC_EXE%"=="" (
set "PANDOC_EXE=C:\Program Files\Pandoc\pandoc.exe"
)
set "SOLUTION_FILE=tee.sln"
if exist "%MSVC_PATH%\VC\Auxiliary\Build\vcvarsall.bat" (
call "%MSVC_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x86
) else (
echo vcvarsall.bat not found. Please check your MSVC_PATH variable!
goto BuildError
)
REM ------------------------------------------------------------
REM CLEAN UP
REM ------------------------------------------------------------
if exist "%CD%\bin\" rmdir /S /Q "%CD%\bin"
if exist "%CD%\bin\" (
echo Failed to clean up intermediate files!
goto BuildError
)
if exist "%CD%\obj\" rmdir /S /Q "%CD%\obj"
if exist "%CD%\obj\" (
echo Failed to clean up intermediate files!
goto BuildError
)
REM ------------------------------------------------------------
REM BUILD EXECUTABLES
REM ------------------------------------------------------------
MSBuild.exe /property:Platform=x86 /property:Configuration=Release /target:rebuild "%CD%\%SOLUTION_FILE%"
if not "%ERRORLEVEL%"=="0" goto BuildError
MSBuild.exe /property:Platform=x64 /property:Configuration=Release /target:rebuild "%CD%\%SOLUTION_FILE%"
if not "%ERRORLEVEL%"=="0" goto BuildError
MSBuild.exe /property:Platform=a64 /property:Configuration=Release /target:rebuild "%CD%\%SOLUTION_FILE%"
if not "%ERRORLEVEL%"=="0" goto BuildError
REM ------------------------------------------------------------
REM COPY FILES
REM ------------------------------------------------------------
if not exist "%CD%\out\" mkdir "%CD%\out"
if exist "%CD%\out\tee-x86.exe" del /F "%CD%\out\tee-x86.exe"
if exist "%CD%\out\tee-x64.exe" del /F "%CD%\out\tee-x64.exe"
if exist "%CD%\out\tee-a64.exe" del /F "%CD%\out\tee-a64.exe"
copy /Y /B "%CD%\bin\Win32\Release\tee.exe" "%CD%\out\tee-x86.exe"
copy /Y /B "%CD%\bin\x64\.\Release\tee.exe" "%CD%\out\tee-x64.exe"
copy /Y /B "%CD%\bin\ARM64\Release\tee.exe" "%CD%\out\tee-a64.exe"
attrib +R "%CD%\out\tee-x86.exe"
attrib +R "%CD%\out\tee-x64.exe"
attrib +R "%CD%\out\tee-a64.exe"
REM ------------------------------------------------------------
REM CREATE DOCS
REM ------------------------------------------------------------
if exist "%CD%\out\README.html" del /F "%CD%\out\README.html"
"%PANDOC_EXE%" -f markdown -t html5 --metadata pagetitle="tee for Windows" --embed-resources --standalone --css "%CD%\etc\style\github-markdown.css" -o "%CD%\out\README.html" "%CD%\README.md"
attrib +R "%CD%\out\README.html"
REM ------------------------------------------------------------
REM COMPLETED
REM ------------------------------------------------------------
echo.
echo Build completed.
echo.
pause
goto:eof
REM ------------------------------------------------------------
REM BUILD ERROR
REM ------------------------------------------------------------
:BuildError
echo.
echo Build has failed !!!
echo.
pause