混合编译

构建VC6与VC7项目的批处理脚本

5256394_201101051534420417
build.bat

@echo off

echo. 
echo 编译vc7模块 
call build7.bat 
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

echo. 
echo 编译vc6模块 
call build6.bat 
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

echo. 
echo Succeeded! 
exit 0

:ERROR 
echo. 
echo Failed! 
exit 1


build7.bat

@echo off 
setlocal 
@rem Root of Visual Studio common files.

@if "%VSINSTALLDIR%"=="" goto Usage 
@if "%VCINSTALLDIR%"=="" set VCINSTALLDIR=%VSINSTALLDIR%

@rem 
@rem Root of Visual Studio ide installed files. 
@rem 
@set DevEnvDir=%VSINSTALLDIR%

@rem 
@rem Root of Visual C++ installed files. 
@rem 
@set MSVCDir=%VCINSTALLDIR%VC7

@rem 
@echo Setting environment for using Microsoft Visual Studio .NET 2003 tools. 
@echo (If you have another version of Visual Studio or Visual C++ installed and wish 
@echo to use its tools from the command line, run vcvars32.bat for that version.) 
@rem

@REM %VCINSTALLDIR%Common7Tools dir is added only for real setup.

@set PATH=%DevEnvDir%;%MSVCDir%BIN;%VCINSTALLDIR%Common7Tools;%VCINSTALLDIR%Common7Toolsbinprerelease;%VCINSTALLDIR%Common7Toolsbin;%FrameworkSDKDir%bin;%FrameworkDir%%FrameworkVersion%;%PATH%; 
@set INCLUDE=%MSVCDir%ATLMFCINCLUDE;%MSVCDir%INCLUDE;%MSVCDir%PlatformSDKincludeprerelease;%MSVCDir%PlatformSDKinclude;%FrameworkSDKDir%include;%INCLUDE% 
@set LIB=%MSVCDir%ATLMFCLIB;%MSVCDir%LIB;%MSVCDir%PlatformSDKlibprerelease;%MSVCDir%PlatformSDKlib;%FrameworkSDKDir%lib;%LIB%

@goto end

:Usage

@echo. VSINSTALLDIR variable is not set. 
@echo. 
@echo SYNTAX: %0

@goto end

:end

@echo off

echo start build 
echo.

@rem

echo. 
echo Building "API Unicode Release MinDependency|win32" ... ... 
devenv top.sln /rebuild release /project APIAPI.vcproj /projectconfig "Unicode Release MinDependency|win32" 
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

echo. 
echo Building "seg release|win32" ... ... 
devenv top.sln /rebuild release /project segseg.vcproj /projectconfig "release|win32" 
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

@rem

echo. 
echo Succeeded! 
GOTO END

:ERROR 
echo. 
ECHO Failed! 
GOTO END

:END 
endlocal


build6.bat

@echo off 
setlocal 
rem 
rem VcOsDir is used to help create either a Windows 95 or Windows NT specific path. 
rem 
set VcOsDir=WIN95 
if "%OS%" == "Windows_NT" set VcOsDir=WINNT

rem 
echo Setting environment for using Microsoft Visual C++ tools. 
rem

if "%OS%" == "Windows_NT" set PATH=%MSDevDir%BIN;%MSVCDir%BIN;%VSCommonDir%TOOLS%VcOsDir%;%VSCommonDir%TOOLS;%PATH% 
if "%OS%" == "" set PATH="%MSDevDir%BIN";"%MSVCDir%BIN";"%VSCommonDir%TOOLS%VcOsDir%";"%VSCommonDir%TOOLS";"%windir%SYSTEM";"%PATH%" 
set INCLUDE=%MSVCDir%ATLINCLUDE;%MSVCDir%INCLUDE;%MSVCDir%MFCINCLUDE;%INCLUDE% 
set LIB=%MSVCDir%LIB;%MSVCDir%MFCLIB;%LIB%

set VcOsDir= 
set VSCommonDir=

@echo off

echo start build 
echo.

echo. 
echo Building "Adapter - Win32 Release" ... ... 
msdev AdapterAdapter.dsp /MAKE "Adapter - Win32 Release" /REBUILD /NORECURSE 
echo. 
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

echo. 
echo Building "Ext - Win32 Release MinDependency" ... ... 
msdev ExtExt.dsp /MAKE "Ext - Win32 Release MinDependency" /REBUILD /NORECURSE 
echo. 
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

echo. 
echo Succeeded! 
GOTO END

:ERROR 
echo. 
ECHO Failed! 
GOTO END

:END 
endlocal

转载于:https://my.oschina.net/tadcat/blog/147884

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值