如何理解 makefile 和 python
我试图了解 makefile 如何将一些 .ui 文件编译为 .py (PyQt -> Python)。这是我正在使用的自动生成的 makefile:
# Makefile for a PyQGIS plugin
UI_FILES = Ui_UrbanAnalysis.py
RESOURCE_FILES = resources.py
default: compile
compile: $(UI_FILES) $(RESOURCE_FILES)
%.py : %.qrc
pyrcc4 -o $@ $<
%.py : %.ui
pyuic4 -o $@ $<
当我键入:
$ make
我收到以下消息:
make: *** No rule to make target `compile', needed by `default'. Stop.
我做错了什么?
谢谢。
I'm trying to understand how a makefile works for compiling some .ui files to .py (PyQt -> Python). This is the makefile that I am using that was autogenerated:
# Makefile for a PyQGIS plugin
UI_FILES = Ui_UrbanAnalysis.py
RESOURCE_FILES = resources.py
default: compile
compile: $(UI_FILES) $(RESOURCE_FILES)
%.py : %.qrc
pyrcc4 -o $@ lt;
%.py : %.ui
pyuic4 -o $@ lt;
When I type:
$ make
I get the following message:
make: *** No rule to make target `compile', needed by `default'. Stop.
What am I doing incorrectly?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
并不是说我知道您想要实现的构建步骤,但是这两行:
看起来像目标行,因此它们可能应该是:
因为 make 可能正在尝试解释
compile:... 行作为不会执行任何操作的操作,并且意味着没有
compile
目标。另一件事,您可能想用来
告诉 make 这些是抽象目标并且不代表文件。就像良好的实践一样。
Not that I know the build steps you are trying to achieve, but both of these lines:
look like target lines, so they should probably be:
As it was make is probably trying to interpret the
compile:...
line as an action which won't do anything and means that there is nocompile
target.One more thing, you might want to use
to tell make that these are abstract targets and do not represent files. Just as a matter of good practice.