格式化目标和依赖项名称
您可以在此处看到第一个问题,它已解决,谢谢Eldar Abusalimov。现在我需要为 uic.exe 调用放置正确的目标和依赖项。 代码的开头是:
ui_files := $(wildcard $(SUBDIRS:%=%/*.ui))
ui_headers := $(foreach ui_files,$(ui_files),$(dir $(ui_files))ui_$(notdir $(ui_files:.ui=.h)))
ui_cpp := $(patsubst %.h, %.cpp, $(ui_headers))
首先,我需要做的是生成标头,这是我试图通过此代码执行的操作:
<directory/ui_<ui_file_name>.h>: <ui_file_path>
$(QT_BIN)/uic -o $@ $<
其次,我生成 cpps :
<directory/ui_<ui_file_name>.cpp>: <ui_file_path> <header_file_path>
$(QT_BIN)/uic -i <header_file_path> -o <target> <ui_file_path>
请帮助我,通过 make 语法填充此非 make 语法或给我适当的方法。
谢谢。
You can see the first problem here, it was solved, thx Eldar Abusalimov. Now I need to put right targets and dependencies for uic.exe call.
The beginning of the code is:
ui_files := $(wildcard $(SUBDIRS:%=%/*.ui))
ui_headers := $(foreach ui_files,$(ui_files),$(dir $(ui_files))ui_$(notdir $(ui_files:.ui=.h)))
ui_cpp := $(patsubst %.h, %.cpp, $(ui_headers))
First, I need to do is to generate headers what I was trying to do by this code:
<directory/ui_<ui_file_name>.h>: <ui_file_path>
$(QT_BIN)/uic -o $@ lt;
Second, I generate cpps :
<directory/ui_<ui_file_name>.cpp>: <ui_file_path> <header_file_path>
$(QT_BIN)/uic -i <header_file_path> -o <target> <ui_file_path>
Help me please, to fill this not-make syntax by make syntax or give me an appropriate method.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想它应该是这样的(但是,我不确定 Make 将如何处理文件的目录部分):
两个规则都是 静态模式规则。
UPD。
静态模式规则在这里并不好,因为模式应用于整个文件名(带有路径)。相反,应该使用常规的模式规则:
如何模式匹配一章解释了它是如何工作的:
I guess it should be something like this (however, I'm not sure, how Make will deal with directory part of the files):
Both rules are static pattern rules.
UPD.
Static pattern rule are not good here, because the pattern is applied to the whole file name (with a path). Instead, one should use regular pattern rules:
How Patterns Match chapter explains how does it work: