Implement the bridge to call Tatoo from java. Very slow at the moment.
[tatoo.git] / src / bindings / java / Makefile
1 CXX = g++
2 ASMRUN = asmrun_shared
3
4 all: libtatoo-java.so
5 #       cp $< ../../bin
6
7
8 %.class: %.java
9         javac -cp . $<
10
11 fxslt_memory_Tree.stamp: fxslt/memory/TatooEngine.class fxslt/memory/MutableNodeList.class
12         javah -jni fxslt.memory.TatooEngine
13         touch fxslt_memory_Tree.stamp
14
15 fxslt_memory_TatooEngine.h: fxslt/memory/TatooEngine.class fxslt/memory/MutableNodeList.class
16
17 TatooEngine.o: TatooEngine.cc fxslt_memory_Tree.stamp tatoo.h
18         $(CXX) -I `ocamlc -where` -DNDEBUG=1 -I $(JAVA_HOME)/include -I $(JAVA_HOME)/include/linux -fPIC \
19             -DPIC -std=c++0x -c -O3 -o $@ $< -Wall -Wextra -Wno-unused-parameter -g3
20
21 libtatoo-java.so: TatooEngine.o tatoo-java.o
22         $(CXX) -shared -o $@ -O3 tatoo-java.o TatooEngine.o  `ocamlc -where`/libasmrun.a `ocamlc -where`/libunix.a `ocamlc -where`/libbigarray.a -Wl,-soname,libtatoo-java.so
23 tatoo_driver.depx tatoo_driver.cmx: tatoo_driver.ml
24         ../../../remake $@
25
26 tatoo-java.o: tatoo_driver.cmx tatoo_driver.depx 
27         ocamlfind ocamlopt -output-obj -o $@  -I ../.. -cc g++ -linkall -linkpkg -package bigarray,ulex,unix $(shell cat tatoo_driver.depx | sed -e 's:src:../..:g' | sed -e 's:depx:cmx:g' ) $<
28
29 test: TatooTest.class libtatoo-java.so
30         java -cp . -Xss80m  -Djava.library.path=. TatooTest ../../../tests/xmark_0.50.xml '/descendant::keyword[ancestor::listitem]/*'
31
32 clean:
33         rm -f $(GEN_HEADERS) fxslt/memory/*.class
34         rm -f *.cm* *.depx *.o TatooTest.class *.so