首页 / JAVA / 为Java / Linux制作文件
为Java / Linux制作文件
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了为Java / Linux制作文件,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2147字,纯文字阅读大概需要4分钟。
内容图文
一旦我对makefile做了一些更改,我运行它之后有以下makefile,现在当我运行它时,我得到一个“make:没有什么可以为`default’做.”我该怎么强迫它重建?我执行“make”并“make clean”,当我输入“make”时,我仍然会收到错误消息.
另外,如何将src目录中的log4.properties文件复制到目标目录(在make文件和命令行中:javac -classpath src:lib / log4j-1.2.16.jar src / * .java -d bin)?
# # define compiler and compiler flag variables # JFLAGS = -g -cp .:src:lib/log4j-1.2.16.jar JC = javac # # Clear any default targets for building .class files from .java files; we # will provide our own target entry to do this in this makefile. # make has a set of default targets for different suffixes (like .c.o) # Currently, clearing the default for .java.class is not necessary since # make does not have a definition for this target, but later versions of # make may, so it doesn't hurt to make sure that we clear any default # definitions for these # .SUFFIXES: .java .class # # Here is our target entry for creating .class files from .java files # This is a target entry that uses the suffix rule syntax: # DSTS: # rule # 'TS' is the suffix of the target file, 'DS' is the suffix of the dependency # file, and 'rule' is the rule for building a target # '$*' is a built-in macro that gets the basename of the current target # Remember that there must be a before the command line ('rule') # .java.class: $(JC) $(JFLAGS) $*.java # # CLASSES is a macro consisting of 4 words (one for each java source file) # CLASSES = src/MatrixDriver.java src/ConcreteMatrix.java src/Matrix.java src/Submatrix.java # # the default make target entry # default: classes # # This target entry uses Suffix Replacement within a macro: # $(name:string1=string2) # In the words in the macro named 'name' replace 'string1' with 'string2' # Below we are replacing the suffix .java of all words in the macro CLASSES # with the .class suffix # classes: $(CLASSES:.java=.class) # # RM is a predefined macro in make (RM = rm -f) # clean: FORCE $(RM) *.class FORCE:
解决方法:
问题是这个:
.java.class:
$(JC) $(JFLAGS) $*.java
不会做你认为它做的事情.也许你的意思是这样的?
%.class: %.java
$(JC) $(JFLAGS) $^
内容总结
以上是互联网集市为您收集整理的为Java / Linux制作文件全部内容,希望文章能够帮你解决为Java / Linux制作文件所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。