cutter/prepare_r2.bat

46 lines
1.5 KiB
Batchfile
Raw Normal View History

2018-01-03 18:46:30 +00:00
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
2018-01-03 18:46:30 +00:00
FOR %%i IN (python.exe) DO (IF NOT DEFINED PYTHON SET PYTHON=%%~dp$PATH:i)
2018-01-03 18:46:30 +00:00
IF NOT DEFINED PYTHON SET PYTHON=C:\Program Files\Python36
IF NOT DEFINED NINJA_URL SET NINJA_URL=https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip
IF NOT DEFINED VSVARSALLPATH SET VSVARSALLPATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
IF "%1" == "32" (
CALL "%VSVARSALLPATH%" x86
) ELSE IF "%1" == "64" (
CALL "%VSVARSALLPATH%" x64
) ELSE (
ECHO Usage: %0 {32^|64}
EXIT /B 1
)
SET BITS=%1
SET "PATH=%CD%;%PYTHON%;%PATH%"
2018-01-03 18:46:30 +00:00
git submodule update --init
ECHO Downloading meson and ninja
python -m pip install meson
IF !ERRORLEVEL! NEQ 0 EXIT /B 1
2018-01-03 18:46:30 +00:00
IF NOT EXIST ninja.exe (
powershell -Command wget %NINJA_URL% -OutFile ninja.zip && powershell -Command Expand-Archive .\ninja.zip -DestinationPath .\ && DEL ninja.zip
IF !ERRORLEVEL! NEQ 0 EXIT /B 1
2018-01-03 18:46:30 +00:00
)
ECHO Building radare2 (%BITS%)
2018-01-03 18:46:30 +00:00
CD radare2
git clean -xfd
RMDIR /S /Q ..\dist%BITS%
python sys\meson.py --release --install=..\dist%BITS% --shared --copylib
2018-01-03 18:46:30 +00:00
IF !ERRORLEVEL! NEQ 0 EXIT /B 1
2018-01-23 18:43:49 +00:00
COPY /Y build\r_userconf.h ..\dist%BITS%\include\libr\
COPY /Y build\r_version.h ..\dist%BITS%\include\libr\
COPY /Y build\shlr\liblibr2sdb.a ..\dist%BITS%\r_sdb.lib
2018-01-03 18:46:30 +00:00
CD ..
2018-01-23 18:43:49 +00:00
COPY /Y dist%BITS%\*.lib cutter_win32\radare2\lib%BITS%\
ECHO Copying relevant files in cutter_win32
XCOPY /S /Y dist%BITS%\include\libr cutter_win32\radare2\include\libr\