make中vpath匹配后如何获取绝对路径?
我有一个 makefile,它根据某些属性设置 vpath 并将源文件列表生成到一个变量中。我需要运行 makefile 而无需编译任何内容(编译实际上是由不同的 makefile 处理的),并且只需查看文件名根据 vpath 设置与哪些实际文件匹配。
I have a makefile that depending on some properties sets vpath and generates a list of source files into one variable. I need to run the makefile without compiling anything (the compilation is actually handled by a different makefile) and just see to which real files the filenames get matched depending on the vpath settings.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
选项 1:让 make 进行路径搜索:
选项 2:使用 $(通配符) 模拟路径搜索:
无论哪种方式,“make whichfiles”都会打印匹配文件的列表。
如果找不到某些文件,选项 1 将失败,并显示“无规则可制定”,报告找不到第一个文件。选项 2 将为每个丢失的文件打印“not-found:”。
Option 1: Let make do its path search:
Option 2: Simulate the path search using $(wildcard):
Either way, "make whichfiles" will print the list of matched files.
If some of the files can't be found, option 1 will fail with "no rule to make" reporting the first file that could not be found. Option 2 will print "not-found:" for each missing file.