projects: drop unused logic from generate.bat

Follow-up to 5a0644fae8 #8442

Closes #18397
This commit is contained in:
Viktor Szakats 2025-08-25 18:50:33 +02:00
parent ca6d6dcb20
commit cda243d053
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
2 changed files with 46 additions and 81 deletions

View file

@ -30,7 +30,7 @@ my @tabs = (
"^m4/zz40-xc-ovr.m4",
"Makefile\\.(am|example)\$",
"/mkfile",
"\\.(bat|sln|vc)\$",
"\\.(sln|vc)\$",
"^tests/data/test",
);

View file

@ -44,9 +44,7 @@ rem ***************************************************************************
:parseArgs
if "%~1" == "" goto start
if /i "%~1" == "pre" (
set VERSION=PRE
) else if /i "%~1" == "vc10" (
if /i "%~1" == "vc10" (
set VERSION=VC10
) else if /i "%~1" == "vc11" (
set VERSION=VC11
@ -71,7 +69,6 @@ rem ***************************************************************************
shift & goto parseArgs
:start
if "%VERSION%" == "PRE" goto success
if "%VERSION%" == "VC10" goto vc10
if "%VERSION%" == "VC11" goto vc11
if "%VERSION%" == "VC12" goto vc12
@ -81,8 +78,8 @@ rem ***************************************************************************
if "%MODE%" == "GENERATE" (
echo Generating VC10 project files
call :generate vcxproj Windows\VC10\src\curl.tmpl Windows\VC10\src\curl.vcxproj
call :generate vcxproj Windows\VC10\lib\libcurl.tmpl Windows\VC10\lib\libcurl.vcxproj
call :generate Windows\VC10\src\curl.tmpl Windows\VC10\src\curl.vcxproj
call :generate Windows\VC10\lib\libcurl.tmpl Windows\VC10\lib\libcurl.vcxproj
) else (
echo Removing VC10 project files
call :clean Windows\VC10\src\curl.vcxproj
@ -96,8 +93,8 @@ rem ***************************************************************************
if "%MODE%" == "GENERATE" (
echo Generating VC11 project files
call :generate vcxproj Windows\VC11\src\curl.tmpl Windows\VC11\src\curl.vcxproj
call :generate vcxproj Windows\VC11\lib\libcurl.tmpl Windows\VC11\lib\libcurl.vcxproj
call :generate Windows\VC11\src\curl.tmpl Windows\VC11\src\curl.vcxproj
call :generate Windows\VC11\lib\libcurl.tmpl Windows\VC11\lib\libcurl.vcxproj
) else (
echo Removing VC11 project files
call :clean Windows\VC11\src\curl.vcxproj
@ -111,8 +108,8 @@ rem ***************************************************************************
if "%MODE%" == "GENERATE" (
echo Generating VC12 project files
call :generate vcxproj Windows\VC12\src\curl.tmpl Windows\VC12\src\curl.vcxproj
call :generate vcxproj Windows\VC12\lib\libcurl.tmpl Windows\VC12\lib\libcurl.vcxproj
call :generate Windows\VC12\src\curl.tmpl Windows\VC12\src\curl.vcxproj
call :generate Windows\VC12\lib\libcurl.tmpl Windows\VC12\lib\libcurl.vcxproj
) else (
echo Removing VC12 project files
call :clean Windows\VC12\src\curl.vcxproj
@ -123,67 +120,66 @@ rem ***************************************************************************
rem Main generate function.
rem
rem %1 - Project Type (vcxproj for VC10, VC11, VC12, VC14, VC14.10, VC14.20 and VC14.30)
rem %2 - Input template file
rem %3 - Output project file
rem %1 - Input template file
rem %2 - Output project file
rem
:generate
if not exist %2 (
if not exist %1 (
echo.
echo Error: Cannot open %2
echo Error: Cannot open %1
exit /B
)
if exist %3 (
del %3
if exist %2 (
del %2
)
echo * %CD%\%3
for /f "usebackq delims=" %%i in (`"findstr /n ^^ %2"`) do (
echo * %CD%\%2
for /f "usebackq delims=" %%i in (`"findstr /n ^^ %1"`) do (
set "var=%%i"
setlocal enabledelayedexpansion
set "var=!var:*:=!"
if "!var!" == "CURL_SRC_C_FILES" (
for /f "delims=" %%c in ('dir /b ..\src\*.c') do (
if /i "%%c" NEQ "curlinfo.c" call :element %1 src "%%c" %3
if /i "%%c" NEQ "curlinfo.c" call :element src "%%c" %2
)
) else if "!var!" == "CURL_SRC_H_FILES" (
for /f "delims=" %%h in ('dir /b ..\src\*.h') do call :element %1 src "%%h" %3
for /f "delims=" %%h in ('dir /b ..\src\*.h') do call :element src "%%h" %2
) else if "!var!" == "CURL_SRC_RC_FILES" (
for /f "delims=" %%r in ('dir /b ..\src\*.rc') do call :element %1 src "%%r" %3
for /f "delims=" %%r in ('dir /b ..\src\*.rc') do call :element src "%%r" %2
) else if "!var!" == "CURL_SRC_X_H_FILES" (
call :element %1 lib "config-win32.h" %3
call :element %1 lib "curl_setup.h" %3
call :element lib "config-win32.h" %2
call :element lib "curl_setup.h" %2
) else if "!var!" == "CURL_LIB_C_FILES" (
for /f "delims=" %%c in ('dir /b ..\lib\*.c') do call :element %1 lib "%%c" %3
for /f "delims=" %%c in ('dir /b ..\lib\*.c') do call :element lib "%%c" %2
) else if "!var!" == "CURL_LIB_H_FILES" (
for /f "delims=" %%h in ('dir /b ..\include\curl\*.h') do call :element %1 include\curl "%%h" %3
for /f "delims=" %%h in ('dir /b ..\lib\*.h') do call :element %1 lib "%%h" %3
for /f "delims=" %%h in ('dir /b ..\include\curl\*.h') do call :element include\curl "%%h" %2
for /f "delims=" %%h in ('dir /b ..\lib\*.h') do call :element lib "%%h" %2
) else if "!var!" == "CURL_LIB_RC_FILES" (
for /f "delims=" %%r in ('dir /b ..\lib\*.rc') do call :element %1 lib "%%r" %3
for /f "delims=" %%r in ('dir /b ..\lib\*.rc') do call :element lib "%%r" %2
) else if "!var!" == "CURL_LIB_CURLX_C_FILES" (
for /f "delims=" %%c in ('dir /b ..\lib\curlx\*.c') do call :element %1 lib\curlx "%%c" %3
for /f "delims=" %%c in ('dir /b ..\lib\curlx\*.c') do call :element lib\curlx "%%c" %2
) else if "!var!" == "CURL_LIB_CURLX_H_FILES" (
for /f "delims=" %%h in ('dir /b ..\lib\curlx\*.h') do call :element %1 lib\curlx "%%h" %3
for /f "delims=" %%h in ('dir /b ..\lib\curlx\*.h') do call :element lib\curlx "%%h" %2
) else if "!var!" == "CURL_LIB_VAUTH_C_FILES" (
for /f "delims=" %%c in ('dir /b ..\lib\vauth\*.c') do call :element %1 lib\vauth "%%c" %3
for /f "delims=" %%c in ('dir /b ..\lib\vauth\*.c') do call :element lib\vauth "%%c" %2
) else if "!var!" == "CURL_LIB_VAUTH_H_FILES" (
for /f "delims=" %%h in ('dir /b ..\lib\vauth\*.h') do call :element %1 lib\vauth "%%h" %3
for /f "delims=" %%h in ('dir /b ..\lib\vauth\*.h') do call :element lib\vauth "%%h" %2
) else if "!var!" == "CURL_LIB_VQUIC_C_FILES" (
for /f "delims=" %%c in ('dir /b ..\lib\vquic\*.c') do call :element %1 lib\vquic "%%c" %3
for /f "delims=" %%c in ('dir /b ..\lib\vquic\*.c') do call :element lib\vquic "%%c" %2
) else if "!var!" == "CURL_LIB_VQUIC_H_FILES" (
for /f "delims=" %%h in ('dir /b ..\lib\vquic\*.h') do call :element %1 lib\vquic "%%h" %3
for /f "delims=" %%h in ('dir /b ..\lib\vquic\*.h') do call :element lib\vquic "%%h" %2
) else if "!var!" == "CURL_LIB_VSSH_C_FILES" (
for /f "delims=" %%c in ('dir /b ..\lib\vssh\*.c') do call :element %1 lib\vssh "%%c" %3
for /f "delims=" %%c in ('dir /b ..\lib\vssh\*.c') do call :element lib\vssh "%%c" %2
) else if "!var!" == "CURL_LIB_VSSH_H_FILES" (
for /f "delims=" %%h in ('dir /b ..\lib\vssh\*.h') do call :element %1 lib\vssh "%%h" %3
for /f "delims=" %%h in ('dir /b ..\lib\vssh\*.h') do call :element lib\vssh "%%h" %2
) else if "!var!" == "CURL_LIB_VTLS_C_FILES" (
for /f "delims=" %%c in ('dir /b ..\lib\vtls\*.c') do call :element %1 lib\vtls "%%c" %3
for /f "delims=" %%c in ('dir /b ..\lib\vtls\*.c') do call :element lib\vtls "%%c" %2
) else if "!var!" == "CURL_LIB_VTLS_H_FILES" (
for /f "delims=" %%h in ('dir /b ..\lib\vtls\*.h') do call :element %1 lib\vtls "%%h" %3
for /f "delims=" %%h in ('dir /b ..\lib\vtls\*.h') do call :element lib\vtls "%%h" %2
) else (
echo.!var!>> %3
echo.!var!>> %2
)
endlocal
@ -192,51 +188,21 @@ rem
rem Generates a single file xml element.
rem
rem %1 - Project Type (vcxproj for VC10, VC11, VC12, VC14, VC14.10, VC14.20 and VC14.30)
rem %2 - Directory (src, lib, lib\vauth, lib\vquic, lib\vssh, lib\vtls)
rem %3 - Source filename
rem %4 - Output project file
rem %1 - Directory (src, lib, lib\vauth, lib\vquic, lib\vssh, lib\vtls)
rem %2 - Source filename
rem %3 - Output project file
rem
:element
set "SPACES= "
if "%2" == "lib\vauth" (
set "TABS= "
) else if "%2" == "lib\vquic" (
set "TABS= "
) else if "%2" == "lib\vssh" (
set "TABS= "
) else if "%2" == "lib\vtls" (
set "TABS= "
) else if "%2" == "lib\curlx" (
set "TABS= "
) else (
set "TABS= "
)
call :extension %3 ext
call :extension %2 ext
if "%1" == "dsp" (
echo # Begin Source File>> %4
echo.>> %4
echo SOURCE=..\..\..\..\%2\%~3>> %4
echo # End Source File>> %4
) else if "%1" == "vcproj1" (
echo %TABS%^<File>> %4
echo %TABS% RelativePath="..\..\..\..\%2\%~3"^>>> %4
echo %TABS%^</File^>>> %4
) else if "%1" == "vcproj2" (
echo %TABS%^<File>> %4
echo %TABS% RelativePath="..\..\..\..\%2\%~3">> %4
echo %TABS%^>>> %4
echo %TABS%^</File^>>> %4
) else if "%1" == "vcxproj" (
if "%ext%" == "c" (
echo %SPACES%^<ClCompile Include=^"..\..\..\..\%2\%~3^" /^>>> %4
) else if "%ext%" == "h" (
echo %SPACES%^<ClInclude Include=^"..\..\..\..\%2\%~3^" /^>>> %4
) else if "%ext%" == "rc" (
echo %SPACES%^<ResourceCompile Include=^"..\..\..\..\%2\%~3^" /^>>> %4
)
if "%ext%" == "c" (
echo %SPACES%^<ClCompile Include=^"..\..\..\..\%1\%~2^" /^>>> %3
) else if "%ext%" == "h" (
echo %SPACES%^<ClInclude Include=^"..\..\..\..\%1\%~2^" /^>>> %3
) else if "%ext%" == "rc" (
echo %SPACES%^<ResourceCompile Include=^"..\..\..\..\%1\%~2^" /^>>> %3
)
exit /B
@ -284,7 +250,6 @@ rem
echo.
echo What to generate:
echo.
echo pre - Prerequisites only
echo vc10 - Use Visual Studio 2010
echo vc11 - Use Visual Studio 2012
echo vc12 - Use Visual Studio 2013