title: makefile for java
body: <p>i don't understand what i did wrong with my makefile :</p>
  
  <pre>
  JAVA_SRCS:=$(wildcard tasks/src/*.java)
  JAVA_CLASSES=$(subst /src/,/build/,$(JAVA_SRCS:.java=.class))
  JFLAGS=-cp jar/octobot.jar -d tasks/build
  JC=javac
  
  .SUFFIXES: .java .class
  
  .java.class:
   $(JC) $(JFLAGS) $*.java
  
  default: build
  
  build: $(JAVA_CLASSES)
  
  clean:
   $(RM) tasks/build/*.class
  </pre>
  
  <p>I got this error :</p>
  
  <pre>
  make: *** No rule to make target `tasks/build/ClickTask.class', needed by `classes'.  Stop.
  zsh: exit 2     make
  </pre>
  
  <p>But strangely, when i re-write the rule <em>build</em> like this :</p>
  
  <pre>
  build: $(JAVA_SRCS:.java=.class)
  </pre>
  
  <p>no error, the rule is launched but does it every time (and it's not correct)</p>