title: Makefile compilation issue with javac
body: <p>I have a problem with a makefile. I have three classes. They do pretty simple stuff. One does an addition on a subtraction, and the last one will instantiate the two and simply print the resulted addition and subtraction.</p>
  
  <p>Now when I create my makefile, I compile my Plus.java and my Minus.java but don't know how to compile the main class because it depends on the previous two. I want to compile and run it from the makefile if it's possible.</p>
  
  <p>I get the above results when I try to run make:</p>
  
  <pre><code>javac -g Plus.class Minus.class
  javac: invalid flag: Plus.class
  Usage: javac &lt;options&gt; &lt;source files&gt;
  use -help for a list of possible options
  make: *** [Operation.class] Error 2
  </code></pre>
  
  <p>I don't know how to proceed; please forgive me if my question is to simple but I am new working with these stuff. I've searched many sites but with no answer. </p>
  
  <p>Here is my Makefile:</p>
  
  <pre><code>JCC = javac
  
  JCR = java
  
  JFLAGS = -g
  
  default: Operation.class
  
  Plus.class: Plus.java
      $(JCC) $(JFLAGS) Plus.java
  
  Minus.class: Minus.java
      $(JCC) $(JFLAGS) Minus.java
  
  Operation.class: Operation.class
      $(JCC) $(JFLAGS) Operation.class  
  
  run: Operation.class
      $(JCR) Operation.class
  
  clean:
      $(RM) *.class
  </code></pre>