stunnel4/src/makew32.bat

58 lines
1.8 KiB
Batchfile
Raw Normal View History

2017-03-28 09:58:13 +02:00
@echo off
TITLE W32 STUNNEL
2017-11-15 15:03:25 +01:00
:: In a multi-target compilation environment, it is better to open
:: a new cmd.exe window in order to avoid PATH pollution
:: (for example with some previous WCE compilation attempts)
2017-03-28 09:58:13 +02:00
set NEWTGTCPU=W32
2017-11-15 15:03:25 +01:00
rem Adjust the MS VC environment variables
2017-03-28 09:58:13 +02:00
rem ---------------------
2017-11-15 15:03:25 +01:00
rem Detect the latest Visual Studio
rem Visual Studio 2008
if DEFINED VS90COMNTOOLS if exist "%VS90COMNTOOLS%..\..\vc\vcvarsall.bat" set vsTools=%VS90COMNTOOLS%
rem Visual Studio 2010
if DEFINED VS100COMNTOOLS if exist "%VS100COMNTOOLS%..\..\vc\vcvarsall.bat" set vsTools=%VS100COMNTOOLS%
rem Visual Studio 2012
if DEFINED VS110COMNTOOLS if exist "%VS110COMNTOOLS%..\..\vc\vcvarsall.bat" set vsTools=%VS110COMNTOOLS%
rem Visual Studio 2013
if DEFINED VS120COMNTOOLS if exist "%VS120COMNTOOLS%..\..\vc\vcvarsall.bat" set vsTools=%VS120COMNTOOLS%
rem Visual Studio 2015
if DEFINED VS140COMNTOOLS if exist "%VS140COMNTOOLS%..\..\vc\vcvarsall.bat" set vsTools=%VS140COMNTOOLS%
::rem Initialize the Visual Studio tools
::call "%vsTools%..\..\vc\vcvarsall.bat"
rem Check the MSenv variables against our reference values
2017-03-28 09:58:13 +02:00
set isenvok=0
if NOT DEFINED TARGETCPU set TARGETCPU=XXXXX
if "%NEWTGTCPU%"=="%TARGETCPU%" set /A "isenvok+=1"
if %isenvok%==1 echo W32 ENVIRONMENT OK
if %isenvok%==1 goto envisok
2017-11-15 15:03:25 +01:00
:: Useless with separated target folders
2017-03-28 09:58:13 +02:00
::echo W32 TARGET CPU changed, destroying every obj files
::del .\*.obj
2017-11-15 15:03:25 +01:00
:: if env is NOT ok, adjust the MS VC environment variables
2017-03-28 09:58:13 +02:00
:: (this is to avoid repetitive pollution of PATH)
echo W32 ENVIRONMENT ADJUSTED
2017-11-15 15:03:25 +01:00
:: Reset of INCLUDE is needed because of accumulation of includes in vcvars32
2017-03-28 09:58:13 +02:00
set INCLUDE=
2017-11-15 15:03:25 +01:00
call "%vsTools%..\..\vc\bin\vcvars32.bat"
2017-03-28 09:58:13 +02:00
set TARGETCPU=%NEWTGTCPU%
:envisok
2017-11-15 15:03:25 +01:00
rem Make everything
2017-03-28 09:58:13 +02:00
rem ---------------
nmake.exe -f vc.mak %1 %2 %3 %4 %5 %6 %7 %8 %9