I have a newbie question for writing makefile for java on Linux
I have a project with:
A.java
B.java
C.java
A depends on B.java and C.java, they must be in the same folder
It is assumed that when I enter the folder, I can run the make command to generate the classes.
How to set classpath as current ABC file folder?
This question may be easy for you, but I spend hours on Google and still can't get it to work ...
Thanks again.
Details of my make file:
JFLAGS = -g
JC = javac
CLASSPATH = .
.SUFFIXES: .java .class
.java.class:
$(JC) $(JFLAGS) $*.java
Heap.class: FibonacciHeap.java \
FileOperation.java \
MinLeftistTree.java \
RandomPermutation.java \
Heap.java
default: classes
classes: $(CLASSES:.java=.class)
clean:
$(RM) *.class
Heap.java should be compiled after executing other java files ...
I google a lot and don’t quite understand the grammar for the make command ....
Excuse me for my problem with the newbie ...
source
share