Added JavaScript port of the NuHash algorithm.
[nuhash.git] / make.cmd
bloba8ef0ec16bef7ff084a2c31d332e65d81a2a5f45
1 @echo off
2 cd /d "%~dp0"
4 if "%MSVC_PATH%"=="" (
5 set "MSVC_PATH=C:\Program Files\Microsoft Visual Studio\2022\Community"
8 if exist "%MSVC_PATH%\VC\Auxiliary\Build\vcvarsall.bat" (
9 call "%MSVC_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x86
10 ) else (
11 echo vcvarsall.bat not found. Please check your MSVC_PATH variable!
12 goto BuildError
15 if "%PANDODC_PATH%"=="" (
16 set "PANDODC_PATH=C:\Program Files\Pandoc"
19 if not exist "%PANDODC_PATH%\pandoc.exe" (
20 echo pandoc.exe not found. Please check your PANDODC_PATH variable!
21 goto BuildError
24 REM ------------------------------------------------------------
25 REM CLEAN UP
26 REM ------------------------------------------------------------
28 if exist "%CD%\bin\" rmdir /S /Q "%CD%\bin"
29 if exist "%CD%\bin\" (
30 echo Failed to clean up intermediate files!
31 goto BuildError
34 if exist "%CD%\obj\" rmdir /S /Q "%CD%\obj"
35 if exist "%CD%\obj\" (
36 echo Failed to clean up intermediate files!
37 goto BuildError
40 REM ------------------------------------------------------------
41 REM BUILD EXECUTABLES
42 REM ------------------------------------------------------------
44 MSBuild.exe /property:Platform=x86 /property:Configuration=Release /target:rebuild "%CD%\nuhash.sln"
45 if not "%ERRORLEVEL%"=="0" goto BuildError
47 MSBuild.exe /property:Platform=x64 /property:Configuration=Release /target:rebuild "%CD%\nuhash.sln"
48 if not "%ERRORLEVEL%"=="0" goto BuildError
50 MSBuild.exe /property:Platform=ARM64 /property:Configuration=Release /target:rebuild "%CD%\nuhash.sln"
51 if not "%ERRORLEVEL%"=="0" goto BuildError
53 REM ------------------------------------------------------------
54 REM GENERATE DOCUMENTS
55 REM ------------------------------------------------------------
57 if not exist "%CD%\out\" mkdir "%CD%\out"
59 "%PANDODC_PATH%\pandoc.exe" --standalone --embed-resources --css etc\style\gh-pandoc.min.css --metadata title="NuHash README" -o "%~dp0\out\README.html" "%~dp0\README.md"
61 REM ------------------------------------------------------------
62 REM COPY FILES
63 REM ------------------------------------------------------------
65 if exist "%CD%\out\nuhash-x86.exe" del /F "%CD%\out\nuhash-x86.exe"
66 if exist "%CD%\out\nuhash-x64.exe" del /F "%CD%\out\nuhash-x64.exe"
67 if exist "%CD%\out\nuhash-a64.exe" del /F "%CD%\out\nuhash-a64.exe"
69 copy /Y /B "%CD%\bin\Win32\Release\nuhash.exe" "%CD%\out\nuhash-x86.exe"
70 copy /Y /B "%CD%\bin\x64\Release\nuhash.exe" "%CD%\out\nuhash-x64.exe"
71 copy /Y /B "%CD%\bin\ARM64\Release\nuhash.exe" "%CD%\out\nuhash-a64.exe"
73 attrib +R "%CD%\out\nuhash-x86.exe"
74 attrib +R "%CD%\out\nuhash-x64.exe"
75 attrib +R "%CD%\out\nuhash-a64.exe"
77 REM ------------------------------------------------------------
78 REM COMPLETED
79 REM ------------------------------------------------------------
81 echo.
82 echo Build completed.
83 echo.
84 pause
85 goto:eof
87 REM ------------------------------------------------------------
88 REM BUILD ERROR
89 REM ------------------------------------------------------------
91 :BuildError
92 echo.
93 echo Build has failed !!!
94 echo.
95 pause