title: Makefile to compile both C and Java programs at the same time
body: <p>I have three programs that need to be compiled at the same time, 2 written in C and 1 in java.  I had all three working with the Makefile when they were in C, but then rewrote one of them in java... is there a way to compile all 3 at once with the same makefile?</p>
  
  <p>Here is my current Makefile:</p>
  
  <pre><code>CC=gcc 
  JC=javac 
  JFLAGS= -g
  CFLAGS= -Wall -g -std=c99
  LDFLAGS= -lm
  .SUFFIXES: .java .class
  .java.class:
   $(JC) $(JFLAGS) $*.java
  
  CLASSES = kasiski.java kentry.java
  
  ALL= ic ftable kasiski
  
  all: $(ALL)
  
  ic: ic.o
  
  kasiski: $(CLASSES:.java=.class)
  
  ftable: ftable.o
  
  ic.o: ic.c ic.h
  
  ftable.o: ftable.c ftable.h
  
  .PHONY: clean
  
  clean:
   rm -rf core* *.class *.o *.gch $(ALL)
  </code></pre>