Source

ojacare / camljava-0.3 / test_main_in_java / Makefile

Full commit
all: Main.class Test.class Testcb.class libOCaml.so
	LD_LIBRARY_PATH=.:`ocamlfind printconf destdir`/camljava CLASSPATH=`ocamlfind printconf destdir`/camljava/camljava.jar:. java Main Test Testcb

.SUFFIXES: .c .h .o .java .class .ml .cmo

.java.class:
	CLASSPATH=`ocamlfind printconf destdir`/camljava/camljava.jar:. javac $<

Main.h: Main.class
	javah -jni Main

JAVA=/usr/lib/jvm/java-6-openjdk-i386/

Main.o: Main.h Main.c
	gcc -c -I $(JAVA)/include -I `ocamlc -where` Main.c

libOCaml.so: Makefile cmo.o
	ld -shared cmo.o -L`ocamlc -where` -L`ocamlfind printconf destdir`/camljava -lcamljni_shared -lcamlrun -ldl -lm -lncurses -o $@ 

.ml.cmo:
	ocamlfind ocamlc -package camljava -c $< -o $@

cmo.o: hello.cmo jnitest.cmo
	ocamlc -output-obj -o $@ -I `ocamlfind printconf destdir`/camljava jni.cma hello.cmo jnitest.cmo 

clean:
	rm -f *.o *.so *.class Main.h *.cm*