2016-09-06 15:31:41 -04:00
|
|
|
:: Usage:
|
2018-05-07 00:42:52 -04:00
|
|
|
:: call build-libs.bat [make tasks]
|
2016-09-06 15:31:41 -04:00
|
|
|
|
|
|
|
@echo off
|
|
|
|
|
|
|
|
setlocal
|
|
|
|
|
|
|
|
:: Parameter
|
|
|
|
set MakeParam="DOWNLOAD_PATH=../download"
|
|
|
|
|
|
|
|
set MakeTask=
|
|
|
|
:param_loop
|
|
|
|
if "%~1" NEQ "" (
|
|
|
|
set MakeTask=%MakeTask% %1
|
|
|
|
shift /1
|
|
|
|
goto param_loop
|
|
|
|
)
|
|
|
|
|
|
|
|
:: Initialize environment
|
|
|
|
call "%~dp0..\env.bat"
|
|
|
|
if errorlevel 1 goto error_env
|
|
|
|
call "%EnvPath%\env-msys.bat"
|
|
|
|
if errorlevel 1 goto error_env
|
|
|
|
|
|
|
|
:: Check MSYS environment
|
2017-03-02 00:52:18 -05:00
|
|
|
if not exist "%EnvMSYSSH%" %cecho% error "Please install MSYS first." & exit /B 1
|
2016-09-06 15:31:41 -04:00
|
|
|
|
|
|
|
:: Initialize environment
|
|
|
|
call "%~dp0env.bat"
|
|
|
|
if errorlevel 1 goto error_env
|
|
|
|
|
2018-05-07 00:42:52 -04:00
|
|
|
:: Add tools path to PATH environment
|
|
|
|
set PATH=%EnvToolsPath%;%PATH%
|
|
|
|
|
2016-11-03 03:32:15 -04:00
|
|
|
call "%ToolsPath%\msys-path.bat" "%~dp0" MSYSCurPath
|
2016-09-06 15:31:41 -04:00
|
|
|
call "%ToolsPath%\msys-path.bat" "%BuildLibsPath%" MSYSBuildLibsPath
|
|
|
|
|
|
|
|
if not exist "%BuildLibsPath%" mkdir "%BuildLibsPath%"
|
|
|
|
|
2017-03-02 00:52:18 -05:00
|
|
|
%EnvMSYSCmd% "cd "%MSYSBuildLibsPath%" && make -f %MSYSCurPath%/makefile %MakeParam% %MakeTask%"
|
2016-09-06 15:31:41 -04:00
|
|
|
|
|
|
|
exit /B %ERRORLEVEL%
|
|
|
|
|
|
|
|
:error_env
|
|
|
|
echo Failed to initialize environment.
|
|
|
|
endlocal
|
|
|
|
exit /B 1
|