Makefile to compile both C and Java programs at the same time
- by user342745
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 switched one of them to java... is there a way to compile all 3 at once with the same makefile?
Here is my current Makefile:
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)