免费注册 查看新帖 |

Chinaunix

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

[其他] Makefile中的$(Q) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-08-26 16:45 |只看该作者 |倒序浏览
linux 内核中arch/arm/boot/dts/Makefile中有如下片段:

# *.dtb used to be generated in the directory above. Clean out the
# old build results so people don't accidentally use them.
dtbs: $(addprefix $(obj)/, $(dtb-y))
    $(Q)rm -f $(obj)/../*.dtb

请问这里的$(Q)是什么作用?

论坛徽章:
20
程序设计版块每日发帖之星
日期:2015-08-17 06:20:00程序设计版块每日发帖之星
日期:2016-07-16 06:20:00程序设计版块每日发帖之星
日期:2016-07-18 06:20:00每日论坛发贴之星
日期:2016-07-18 06:20:00黑曼巴
日期:2016-12-26 16:00:3215-16赛季CBA联赛之江苏
日期:2017-06-26 11:05:5615-16赛季CBA联赛之上海
日期:2017-07-21 18:12:5015-16赛季CBA联赛之青岛
日期:2017-09-04 17:32:0515-16赛季CBA联赛之吉林
日期:2018-03-26 10:02:16程序设计版块每日发帖之星
日期:2016-07-15 06:20:0015-16赛季CBA联赛之江苏
日期:2016-07-07 18:37:512015亚冠之萨济拖拉机
日期:2015-08-17 12:21:08
2 [报告]
发表于 2015-08-26 20:37 |只看该作者
在源码树下的Makefile里有定义
  1. # ---------------------------------------------------------------------------
  2. #
  3. # Normally, we echo the whole command before executing it. By making
  4. # that echo $($(quiet)$(cmd)), we now have the possibility to set
  5. # $(quiet) to choose other forms of output instead, e.g.
  6. #
  7. #         quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@
  8. #         cmd_cc_o_c       = $(CC) $(c_flags) -c -o $@ $<
  9. #
  10. # If $(quiet) is empty, the whole command will be printed.
  11. # If it is set to "quiet_", only the short version will be printed.
  12. # If it is set to "silent_", nothing will be printed at all, since
  13. # the variable $(silent_cmd_cc_o_c) doesn't exist.
  14. #
  15. # A simple variant is to prefix commands with $(Q) - that's useful
  16. # for commands that shall be hidden in non-verbose mode.
  17. #
  18. #       $(Q)ln $@ :<
  19. #
  20. # If KBUILD_VERBOSE equals 0 then the above command will be hidden.
  21. # If KBUILD_VERBOSE equals 1 then the above command is displayed.

  22. ifeq ($(KBUILD_VERBOSE),1)
  23.   quiet =
  24.   Q =
  25. else
  26.   quiet=quiet_
  27.   Q = @
  28. endif
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP