makefile 中的VPATH
变量用于指示搜索路径。但其中的“V”究竟代表什么?
make 变量 VPATH 的值指定了 make 应该搜索的目录列表。大多数情况下,目录应该包含不在当前目录中的必备文件;但是,make 使用 VPATH 作为规则的先决条件和目标的搜索列表。
VPATH 似乎是:虚拟路径
我找到了这个链接:gcc_make
它定义了这样的 VPATH:
>**Virtual Path - VPATH & vpath**
>You can use VPATH (uppercase) to specify the directory to search for dependencies and target files. For example,
># Search for dependencies and targets from "src" and "include" directories
># The directories are separated by space
VPATH = src 包含
>You can also use vpath (lowercase) to be more precise about the file type and its search directory. For example,
># Search for .c files in "src" directory; .h files in "include" directory
># The pattern matching character '%' matches filename without the extension
>vpath %.c src
>vpath %.h include
第二个链接确认:
VPATH 代表虚拟路径