Source

ojacare / camljava-0.3 / test_main_in_java / Makefile

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

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

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 hello.o
	ld -shared  hello.o -L`ocamlc -where` -L`ocamlfind printconf destdir`/camljava -lcamljni_shared -lcamlrun -ldl -lm -lncurses -o $@ 

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

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