GuoJuan78
驱动牛犊
驱动牛犊
  • 注册日期2005-01-03
  • 最后登录2010-05-17
  • 粉丝0
  • 关注0
  • 积分423分
  • 威望43点
  • 贡献值0点
  • 好评度42点
  • 原创分0分
  • 专家分0分
阅读:1949回复:4

请问大佬关于编译问题?

楼主#
更多 发布于:2005-04-01 06:30
我按书的工程配置文件的设定成功的对驱动程序进行了编译,连接。
但我实在想不通这几者之间的运行关系:
1. Build.exe
2. nmake.exe
3. SOURCES
4. makefile及对应的makefile.def
5. makefile.inc
6. DIRS
请大佬们说说它们之间的运行关系和运行次序.


还有在SOURCES中存在:
1. NTTARGETFILE0
2. NTTARGETFILE1
3. NTTARGETFILES
这三者的功能与区别又是什么?

不胜感激.


znsoft
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2023-10-25
  • 粉丝300
  • 关注6
  • 积分910分
  • 威望14796点
  • 贡献值7点
  • 好评度2410点
  • 原创分5分
  • 专家分100分
  • 社区居民
  • 最爱沙发
  • 社区明星
沙发#
发布于:2005-04-01 11:24
build是一个实用工具,调用nmake
soruces是build的工程文件。

makefile,makefile.def,makefile.inc都是MAKEFILE,只是用的地方不同,inc,def用于预定义一些东东。
DIRS? 一个宏吧..
http://www.zndev.com 免费源码交换网 ----------------------------- 软件创造价值,驱动提供力量! 淡泊以明志,宁静以致远。 ---------------------------------- 勤用搜索,多查资料,先搜再问。
bmyyyud
驱动老牛
驱动老牛
  • 注册日期2002-02-22
  • 最后登录2010-01-21
  • 粉丝0
  • 关注0
  • 积分1000分
  • 威望130点
  • 贡献值0点
  • 好评度106点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2005-04-01 16:44


还有在SOURCES中存在:
1. NTTARGETFILE0
2. NTTARGETFILE1
3. NTTARGETFILES
这三者的功能与区别又是什么?



 

DDK帮助中全部有解释
NTTARGETFILE0
You can define the NTTARGETFILE0 and/or NTTARGETFILES macros to cause makefile.def to include makefile.inc immediately after it specifies the top level targets (all, clean and loc) and their dependencies.

The makefile.def file expands NTTARGETFILE0 as the first dependent for the all target, and NTTARGETFILES as the last dependent for the all target. Use this macro to specify additional targets and dependencies that do not fit the general case covered by makefile.def.

NTTARGETFILE0=

The fact that NTTARGETFILE0 exists, even if it is defined and empty, causes the Build utility to open makefile.inc in the same subdirectory as the sources file.

If you set NTTARGETFILE0 to equal a file name, the Build utility will not only include makefile.inc, but will also build the executable that the macro defines. Thus, if you set:

NTTARGETFILE0=myfile.a

the Build utility builds myfile.a as part of pass zero.

If you do not set NTTARGETFILE0, the Build utility locates the specified subdirectory on pass zero, includes the makefile.inc in that subdirectory, and follows any default rules that this file contains.

See Also
NTTARGETFILE1

NTTARGETFILE1
The NTTARGETFILE1 macro is exactly like NTTARGETFILE0, except that it occurs later in the build process. NTTARGETFILE0 occurs on pass zero; NTTARGETFILE1 occurs on pass two.

Both of these macros cause the Build utility to change directories to a specified subdirectory and to run NMAKE on pass zero or pass two in a case where it ordinarily probably would not do so.

Built on Wednesday, July 24, 2002

NTTARGETFILES
If you have unique rules in your subdirectory, you can use the NTTARGETFILES macro to signal to the Build utility that you have a makefile.inc file in addition to the sources file in the subdirectory.

The makefile.inc file will provide additional information about the build process, including dependencies, command line rules, and other build rules.

See Also
NTTARGETFILE0, NTTARGETFILE1

滚滚长江东逝水 浪花淘尽英雄 是非成败转头空 青山依旧在 几度夕阳红 白发渔樵江渚上 惯看秋月春风 一壶浊酒喜相逢 古今多少事 尽付笑谈中
tiamo
VIP专家组
VIP专家组
  • 注册日期2002-02-26
  • 最后登录2018-01-09
  • 粉丝17
  • 关注4
  • 积分50分
  • 威望142点
  • 贡献值1点
  • 好评度40点
  • 原创分2分
  • 专家分15分
  • 原创先锋奖
  • 社区居民
地板#
发布于:2005-04-01 21:38
补充一下斑竹的

build只是一个cl的包装而已
编译的工作是由cl来完成的

dirs是用来递归编译的
如果一个目录下有一个dirs文件
那么这个文件里面所记录的子目录也会被build处理
bmyyyud
驱动老牛
驱动老牛
  • 注册日期2002-02-22
  • 最后登录2010-01-21
  • 粉丝0
  • 关注0
  • 积分1000分
  • 威望130点
  • 贡献值0点
  • 好评度106点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2005-04-02 11:47
补充一下斑竹的

build只是一个cl的包装而已
编译的工作是由cl来完成的

dirs是用来递归编译的
如果一个目录下有一个dirs文件
那么这个文件里面所记录的子目录也会被build处理

再补充一下
build只是一个cl和link的包装而已
编译的工作是由cl来完成的,连接由link完成

滚滚长江东逝水 浪花淘尽英雄 是非成败转头空 青山依旧在 几度夕阳红 白发渔樵江渚上 惯看秋月春风 一壶浊酒喜相逢 古今多少事 尽付笑谈中
游客

返回顶部