Source

ojacare / camljava-0.3 / test_simple_call_from_java_to_ocaml / Makefile

all: Test.class libOCaml.so
	LD_LIBRARY_PATH=. java Test

Test.class: Test.java
	javac Test.java

Test.h: Test.class
	javah -jni Test

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

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

libOCaml.so: OCaml.o Makefile hello.o
	gcc -shared  OCaml.o hello.o -L`ocamlc -where` -lcamlrun -ldl -lm -lncurses -o $@ 

hello.o: hello.ml
	ocamlc -output-obj $< -o $@

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