aboutsummaryrefslogtreecommitdiff
path: root/win32/_tcc.bat
blob: 65a7697cae5a5e806d32ed60d88d25555ee465dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
@echo off
setlocal enabledelayedexpansion

pushd %~dp0

path %~dp0;%path%

set EXT=.exe
echo %*|findstr /R /C:"\<-c\>" >nul &&set EXT=.o
echo %*|findstr /R /C:"\<-shared\>" >nul &&set EXT=.dll

::1st file found must be the main c file to get output file name
set OUTF=
call :FINDFN %*

if "%OUTF%"=="" goto :EXIT

call _parseLibs -vv -o "%OUTF%" %*

:EXIT
popd
pause
exit /b

:FINDFN
for %%i in (%*) do (
    if exist %%i set OUTF=%%~dpni%EXT%&goto :ENDFDF
)
:ENDFDF
exit /b