Add the possibility to use noname functions by ordinal
[tinycc.git] / win32 / _tcc.bat
blob65a7697cae5a5e806d32ed60d88d25555ee465dd
1 @echo off
2 setlocal enabledelayedexpansion
4 pushd %~dp0
6 path %~dp0;%path%
8 set EXT=.exe
9 echo %*|findstr /R /C:"\<-c\>" >nul &&set EXT=.o
10 echo %*|findstr /R /C:"\<-shared\>" >nul &&set EXT=.dll
12 ::1st file found must be the main c file to get output file name
13 set OUTF=
14 call :FINDFN %*
16 if "%OUTF%"=="" goto :EXIT
18 call _parseLibs -vv -o "%OUTF%" %*
20 :EXIT
21 popd
22 pause
23 exit /b
25 :FINDFN
26 for %%i in (%*) do (
27     if exist %%i set OUTF=%%~dpni%EXT%&goto :ENDFDF
29 :ENDFDF
30 exit /b