推荐链接:
学不好英语,不是你的错。因为学习内容太枯燥乏味! 为什么不试试《看电影学英语》?
VC6.0其实已经不再使用makefile文件进行编译了,但是它仍然可以导出makefile文件,后缀名为*.mak,方法是在工程菜单下的导出makefile文件,你也可以将*.mak文件更名为makefile这样就可以只使用nmake进行编译而不用再在后面带参数([/f makefile] )。
剩下的工作就是进入该工程文件所在的路径,然后执行makefile命令,然后再将生成文件copy到bin目录下就ok了。
1.如果要编译Release版本
nmake /f "*****.mak" CFG="****** - Win32 (x86) Release"
2.如果要编译Debug版本
nmake /f "*****.mak" CFG="****** - Win32 (x86) Debug" 或 nmake /f "*****.mak"
因为makefile文件里有如下逻辑:
!IF "$(CFG)" == ""
CFG=****** - Win32 Debug
!MESSAGE No configuration specified. Defaulting to ****** - Win32 Debug.
!ENDIF
要注意头(库)文件路径要在工程----设定中加入,不然会无法编译通过。
nmake参数:
Usage: NMAKE @commandfile
NMAKE [options] [/f makefile] [/x stderrfile] [macrodefs] [targets]
Options:
/A Build all evaluated targets
/B Build if time stamps are equal
/C Suppress output messages
/D Display build information
/E Override env-var macros
/HELP Display brief usage message
/I Ignore exit codes from commands
/K Build unrelated targets on error
/N Display commands but do not execute
/NOLOGO Suppress copyright message
/P Display NMAKE information
/Q Check time stamps but do not build
/R Ignore predefined rules/macros
/S Suppress executed-commands display
/T Change time stamps but do not build
/U Dump inline files
/Y Disable batch-mode
/? Display brief usage message