GNU make manual 翻译(九十二)
继续翻译
If several `vpath' patterns match the prerequisite file's name, then `make' processes each matching `vpath' directive one by one, searching all the directories mentioned in each directive. `make' handles multiple `vpath' directives in the order in which they appear in the makefile; multiple directives with the same pattern are independent of each other. Thus, vpath %.c foo vpath % blish vpath %.c bar will look for a file ending in `.c' in `foo', then `blish', then `bar', while vpath %.c foo:bar vpath % blish will look for a file ending in `.c' in `foo', then `bar', then `blish'.
如果有几个 vpath 模式匹配前提条件文件名,那么make 会一个接一个地处理每个 vpath 指令,搜索每一个指令中提到的目录。make 按照多个 vpath 指令在makefile 中出现的顺序处理 vpath 指令;拥有相同模式的 指令也彼此独立。
vpath %.c foo
vpath % blish
vpath %.c bar
将要寻找 foo目录中 以 .c 结尾的文件,然后是blish 目录, 然后是 bar目录。
而
vpath %.c foo:bar
vpath % blish
将寻找 foo,bar blish 目录中的 以.c 结尾的文件。
后文待续