I need to compile my program and then execute it 3 times with another .txt file as the first command line argument every time, and all this needs to be done with a single make command. The corresponding terminal commands for what I want to do the Makefile are as follows:
javac MainDriver.java FSA.java State.java Transition.java
java MainDriver test1.txt
java MainDriver test2.txt
java MainDriver test3.txt
Here I have:
JC = javac
JCR = java
.SUFFIXES: .java .class
.java.class:
$(JC) $*.java
CLASSES = \
MainDriver.java \
FSA.java \
State.java \
Transition.java
default: classes
classes: $(CLASSES:.java=.class)
clean:
$(RM) *.class *~
source
share