zoukankan      html  css  js  c++  java
  • makefile下$(wildcard $^),$^,$@,$?,$<,$(@D),$(@F)

    makefile下$(wildcard $^),$^,$@,$?,$<,$(@D),$(@F)代表的不同含义

    $(filter-out $(PHONY) $(wildcard $^),$^)
    常用用法为$(wildcard *.c)
    表示列举当前目录下的所有.c文件
    这里$^因为会包含依赖的文件名,如果包含的该文件存在,那么将返回其含路径的文件名
    所以$(wildcard $^)就是用来过滤$^包含的所有文件并且该文件确实在本地存在.

    自动化变量$?代表依赖文件列表中被改变过的所有文件。
    自动化变量$^代表所有通过目录搜索得到的依赖文件的完整路径名(目录 + 一般文件名)列表。
    自动化变量$@代表规则的目标。
    自动化变量$<代表规则中通过目录搜索得到的依赖文件列表的第一个依赖文件。
    自动化变量$(@D)
    The directory part of the file name of the target, with the trailing slash removed. If the value of ‘$@’ is dir/foo.o then ‘$(@D)’ is dir. This value is . if ‘$@’ does not contain a slash.
    自动化变量$(@F)
    The file-within-directory part of the file name of the target. If the value of ‘$@’ is dir/foo.o then ‘$(@F)’ is foo.o. ‘$(@F)’ is equivalent to ‘$(notdir $@)’.

    GNU make学习网址:

    http://www.gnu.org/software/make/manual/make.html

  • 相关阅读:
    解决ERROR C2011: 'FD_SET' : 'STRUCT' TYPE REDEFINITION问题
    github简单使用教程
    Win32 多线程的创建方法和基本使用
    day 05
    day04
    day03
    day02
    day 06
    day_05
    day 05
  • 原文地址:https://www.cnblogs.com/wind8961/p/5027927.html
Copyright © 2011-2022 走看看