| 1 |
REM -- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 2 |
REM -- SPDX-License-Identifier: Apache-2.0 OR ISC |
| 3 |
@echo off |
| 4 |
set "ScriptDir=%~dp0" |
| 5 |
set "ScriptDir=%ScriptDir:~0,-1%" |
| 6 |
:loop |
| 7 |
set "arg1=%~1" |
| 8 |
if "%arg1%"=="-o" goto end |
| 9 |
if "%arg1%"=="" goto failure |
| 10 |
shift |
| 11 |
goto loop |
| 12 |
:end |
| 13 |
shift |
| 14 |
set "path=%~1" |
| 15 |
for %%f in ("%path%") do set "filename=%%~nxf" |
| 16 |
REM Extract the base filename before the first dot, similar to the shell script |
| 17 |
for /f "tokens=1 delims=." %%a in ("%filename%") do set "basename=%%a" |
| 18 |
copy "%ScriptDir%\prebuilt-nasm\%basename%.obj" "%path%" |
| 19 |
exit 0 |
| 20 |
|
| 21 |
:failure |
| 22 |
echo PATH: %path% 1>&2 |
| 23 |
echo FILENAME: %filename% 1>&2 |
| 24 |
echo ScriptDir: %ScriptDir% 1>&2 |
| 25 |
exit 1 |