I have the following Main class in java where I pass arguments from the command-line:
public class Main {
public static void main (String [] args) {
Conversion c = new Conversion();
c.convertHPP(args[0], args[1]);
c.convertCPP(args[0], args[1]);
}
}
I have a Makefile and with the option make run-java
I run the program:
JFLAGS = -g
JC = javac
.SUFFIXES: .java .class
.java.class:
$(JC) $(JFLAGS) $*.java
CLASSES = \
Main.java \
Conversion.java \
Book.java
make-java: classes
classes: $(CLASSES:.java=.class)
run-java:
java Main
clean:
$(RM) *.class
What I want to do is to pass the command-line arguments (argv) which are the name of the files to convert, from the makefile to the main. I want to do something like this in the terminal:
make java-run arg1 arg2
How can I change my Makefile so that the run-java:
can allow me to pass arguments and to send it to the main?
Thanks !