1ifeq ($(JAVA_HOME),) 2 $(warning No JAVA_HOME found, JNI building will fail. Please set JAVA_HOME when using JNI) 3 exit 1 4endif 5 6VWLIBS := -L../vowpalwabbit -l vw -l allreduce 7STDLIBS = $(BOOST_LIBRARY) $(LIBS) 8JAVA_INCLUDE = -I $(JAVA_HOME)/include 9 10ifeq ($(UNAME), Linux) 11 JAVA_INCLUDE += -I $(JAVA_HOME)/include/linux 12endif 13ifeq ($(UNAME), FreeBSD) 14 JAVA_INCLUDE += -I $(JAVA_HOME)/include/linux 15endif 16ifeq "CYGWIN" "$(findstring CYGWIN,$(UNAME))" 17 JAVA_INCLUDE += -I $(JAVA_HOME)/include/linux 18endif 19ifeq ($(UNAME), Darwin) 20 JAVA_INCLUDE += -I $(JAVA_HOME)/include/darwin 21endif 22 23all: 24 cd ..; $(MAKE) 25 26test: 27 cd ..; $(MAKE) test 28 29things: target/vw_jni.lib 30 31target/vw_jni.lib: src/main/c++/vw_VWScorer.cc ../vowpalwabbit/main.o ../vowpalwabbit/libvw.a ../vowpalwabbit/liballreduce.a 32 mkdir -p target; 33 $(CXX) -shared $(FLAGS) -o $@ $< $(VWLIBS) $(STDLIBS) $(JAVA_INCLUDE) 34 35clean: 36 rm -f target/vw_jni.lib