vc6 编译 stlport 程序脚本

47 篇文章 7 订阅


@echo off


cl 2>NUL 1>NUL

if %ERRORLEVEL% EQU 0 goto MAINPROC


:SETUP_ENV

echo Enter Enviroment Setup

rem set VCVARS32="E:/GS/VC6/VC98/Bin/VCVARS32.BAT"

set VCVARS32="D:/GS/VC6/VC98/Bin/VCVARS32.BAT"


rem Setup VC6 Building Environment

if not exist %VCVARS32% goto ERROR_VC


call %VCVARS32% 1>NUL 2>NUL



:MAINPROC

set STLPORT="E:/reading/cpp/stlport"

if not exist %STLPORT% goto ERROR_VC


set STLPORT_INC="%STLPORT%/include/stlport"

set STLPORT_LIB="%STLPORT%/lib"


set CLOPT=/c /nologo /GX /MTd /I%STLPORT_INC%

set LDOPT=/nologo /LIBPATH:%STLPORT_LIB%


if %1==/P goto PREPROCESS

if %1==/C goto COMPILE

if %1==/L goto LINK


set SRC=%1

set OBJ=%SRC:cpp=obj%

set EXE=%SRC:cpp=exe%


echo ************************************************

echo Source    File   : %SRC%

echo Object    File   : %OBJ%

echo Executive File   : %EXE%

echo ************************************************

echo *****


cl %CLOPT% %SRC%


if %ERRORLEVEL% NEQ 0 goto ERROR_COMPILE

echo Compiling passed.


link %LDOPT% %OBJ%


if %ERRORLEVEL% NEQ 0 goto ERROR_LINK

echo Linking passed.


goto END


:PREPROCESS

echo Enter Preprocess===

cl /nologo /P /I%STLPORT_INC% %1

goto END


:COMPILE

echo Enter COMPILE===

cl %CLOPT% %2 %3 %4 %5 %6 %7 %8 %9


if %ERRORLEVEL% NEQ 0 goto ERROR_COMPILE

echo Compiling passed.

goto END


:LINK

echo Enter LINK===

link %LDOPT% %2 %3 %4 %5 %6 %7 %8 %9


if %ERRORLEVEL% NEQ 0 goto ERROR_LINK

echo Linking passed.

goto END


:ERROR_VC

echo There is not %VCVARS32%.

echo Fixed it and run again.

goto END


:ERROR_COMPILE

echo Compiling failed.

echo Fixed it and run again.

goto END


:ERROR_LINK

echo Linking failed.

echo Fixed it and run again.

goto END


:END

rem OK, quit now.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值