免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 19156 | 回复: 7
打印 上一主题 下一主题

求问 gcc的标记 -MMD -MP -MF"xx.d" -MT"xx.d" 都是什么意思 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-05-08 10:34 |只看该作者 |倒序浏览
求问:
gcc的标记 -MMD -MP -MF"xx.d" -MT"xx.d" 都是什么意思?
有啥作用?

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
2 [报告]
发表于 2007-05-08 10:41 |只看该作者
info gcc

论坛徽章:
0
3 [报告]
发表于 2007-05-08 10:48 |只看该作者
原帖由 flw 于 2007-5-8 10:41 发表
info gcc

我用windows没有linux,没办法info,
能怎么帮我info一下
最好info出中文就好了

论坛徽章:
0
4 [报告]
发表于 2007-05-08 10:50 |只看该作者
那就上gnu的网站上搞个manual

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
5 [报告]
发表于 2007-05-08 10:58 |只看该作者
原帖由 rrrrrrrr8 于 2007-5-8 10:48 发表

我用windows没有linux,没办法info,
能怎么帮我info一下
最好info出中文就好了

那就 google info gcc

论坛徽章:
0
6 [报告]
发表于 2007-05-08 10:59 |只看该作者
`-MF FILE'
     When used with `-M' or `-MM', specifies a file to write the
     dependencies to.  If no `-MF' switch is given the preprocessor
     sends the rules to the same place it would have sent preprocessed
     output.

     When used with the driver options `-MD' or `-MMD', `-MF' overrides
     the default dependency output file.

`-MD'
     `-MD' is equivalent to `-M -MF FILE', except that `-E' is not
     implied.  The driver determines FILE based on whether an `-o'
     option is given.  If it is, the driver uses its argument but with
     a suffix of `.d', otherwise it take the basename of the input file
     and applies a `.d' suffix.

     If `-MD' is used in conjunction with `-E', any `-o' switch is
     understood to specify the dependency output file (but *note -MF:
     dashMF.), but if used without `-E', each `-o' is understood to
     specify a target object file.

     Since `-E' is not implied, `-MD' can be used to generate a
     dependency output file as a side-effect of the compilation process.

`-MMD'
     Like `-MD' except mention only user header files, not system
     header files.



`-MP'
     This option instructs CPP to add a phony target for each dependency
     other than the main file, causing each to depend on nothing.  These
     dummy rules work around errors `make' gives if you remove header
     files without updating the `Makefile' to match.

     This is typical output:

          test.o: test.c test.h

          test.h:

`-MT TARGET'
     Change the target of the rule emitted by dependency generation.  By
     default CPP takes the name of the main input file, including any
     path, deletes any file suffix such as `.c', and appends the
     platform's usual object suffix.  The result is the target.

     An `-MT' option will set the target to be exactly the string you
     specify.  If you want multiple targets, you can specify them as a
     single argument to `-MT', or use multiple `-MT' options.

     For example, `-MT '$(objpfx)foo.o'' might give

          $(objpfx)foo.o: foo.c

===================================
以上来自cpp.info > invocation节

论坛徽章:
0
7 [报告]
发表于 2007-05-08 11:22 |只看该作者
有劳albcamus 多谢!
看来跟我猜测的差不多都辅助生成依赖头的.d文件的选项.
有人和道.d的规则怎么自动用在makefile中就好了.
要不对我也没什么用处.

论坛徽章:
0
8 [报告]
发表于 2011-05-20 13:46 |只看该作者
帮我扫盲了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP