我想了解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.我做错了什么?
谢谢。
发布于 2010-09-06 18:20:54
虽然我不知道您想要实现的构建步骤,但这两行代码都是:
default: compile
compile: $(UI_FILES) $(RESOURCE_FILES)看起来像目标行,所以它们可能应该是:
default: compile
compile: $(UI_FILES) $(RESOURCE_FILES)事实上,make可能试图将compile:...行解释为一个不会做任何事情的操作,这意味着没有compile目标。
还有一件事,您可能希望使用
PHONY: default compile告诉make这些是抽象的目标,并不代表文件。只是作为一种良好的实践。
https://stackoverflow.com/questions/3650625
复制相似问题