| 1 |
@echo off |
| 2 |
set selfName=%0 |
| 3 |
|
| 4 |
:: Check that we have at least 3 arguments. |
| 5 |
set argC=0 |
| 6 |
for %%x in (%*) do Set /A argC+=1 |
| 7 |
if %argC% LSS 3 goto :print_help |
| 8 |
|
| 9 |
set AR_TOOL=%1 |
| 10 |
shift |
| 11 |
set OUTPUT_PATH=%1 |
| 12 |
shift |
| 13 |
|
| 14 |
set ARCHIVES= |
| 15 |
:loop |
| 16 |
if [%1]==[] goto :finished |
| 17 |
set ARCHIVES=%ARCHIVES% %1 |
| 18 |
shift |
| 19 |
goto :loop |
| 20 |
|
| 21 |
:finished |
| 22 |
|
| 23 |
%AR_TOOL% /nologo /out:%OUTPUT_PATH% %ARCHIVES% || goto :error |
| 24 |
|
| 25 |
exit /B %ERRORLEVEL% |
| 26 |
|
| 27 |
:print_help |
| 28 |
echo %selfName%. Combine multiple static libraries using an archiver tool. |
| 29 |
echo; |
| 30 |
echo Usage: |
| 31 |
echo %selfName% ^<path-to-ar^> ^<output-archive^> ^<archives^>... |
| 32 |
echo; |
| 33 |
echo Notes: |
| 34 |
echo ^<archives^> must be a list of absolute paths to static library archives. |
| 35 |
echo This script creates a temporary working directory inside the current directory. |
| 36 |
exit /B 1 |
| 37 |
|
| 38 |
:error |
| 39 |
exit /B %ERRORLEVEL% |