Posted on 2004年4月22日 18:07
1、蚂蚁假设你已经清楚编译链接的定义,知道nmake的基本概念如潜规则(infered rule)是什么。
2、这只是个简陋的例子,蚂蚁继续研究中。
3、下一步,增加版本rc文件。
目录SpikeCmdBuild
文件
Spike Name:
SpikeCmdBuild
Summary:
This is a spike, which exercise command line build using nmake. The word
spike comes from Extreme Programming(XP).
Phase:
Spike
File list:
SpikeCmdBuild.cpp - Source file of this spike.
build.cmd - Batch file building the spike.
clean.cmd - Batch file cleaning build files.
run.cmd - Batch file running program.
setenv.cmd - Batch file setting build enviroment.
setvc2003.cmd - Batch file setting VC2003 build enviroment.
setvc6.cmd - Batch file setting VC6 build enviroment.
makefile - Make file used by nmake.
ReadMe.txt - Txt file for summary reading(this file).
#include <stdio.h>
void main()
{
printf("Spike Command Line Build Project.\n");
}
@ECHO OFF
CALL SETENV
nmake
IF %ERRORLEVEL% LEQ 1 GOTO END
PAUSE
:END
DEL *.obj
DEL *.exe
@ECHO OFF
ECHO ---------------------------------------------------------------------------
IF EXIST SpikeCmdBuild.exe GOTO RUN
ECHO SpikeCmdBuild.exe does not exist, run build.cmd to build it.
GOTO END
:RUN
SpikeCmdBuild.exe
:END
ECHO ---------------------------------------------------------------------------
PAUSE
CALL setvc6
REM Replace the vcvars32 path with your own
CALL "C:\Program Files\Microsoft Visual Studio\VC98\Bin\vcvars32"
EXE=SpikeCmdBuild.exe
all: $(EXE)