没有制定目标makefile的规则 [英] No rule to make target makefile
本文介绍了没有制定目标makefile的规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:
Java/Linux的生成文件
JFLAGS = -g
JC = javac
.SUFFIXES: .java .class
.java.class: $(JC) $(JFLAGS) $*.java
CLASSES = pprint.java ARPModule.java EthernetModule.java IPModule.java FrameModule.java
default: classes
classes: $(CLASSES:.java=.class)
clean: $(RM) *.class
继续收到此错误:
没有规则来创建目标类"所需的目标"pprint.class".停止.
No rule to make target `pprint.class', needed by `classes'. Stop.
我尝试清除所有空间并放上制表符,但没有成功.
I tried clearing all my spaces and putting tabs but no go.
推荐答案
您需要将 .java.class
规则的命令放在单独的行上:
You need to put the commands for the .java.class
rule on a separate line:
.java.class:
$(JC) $(JFLAGS) $*.java
或者,如果您对垂直空间不满意,可以将它们放在分号后放在同一行:
Or, if you are desparate for vertical space, you can put them on the same line after a semi-colon:
.java.class: ; $(JC) $(JFLAGS) $*.java
这篇关于没有制定目标makefile的规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文