TARGET=MeCab
JAVAC=/usr/java/jdk1.5.0_03/bin/javac
JAVA=/usr/java/jdk1.5.0_03/bin/java
JAR=/usr/java/jdk1.5.0_03/bin/jar
CXX=c++
PACKAGE=org/chasen/mecab

LIBS=`mecab-config --libs`
INC=`mecab-config --cflags` -I/usr/java/jdk1.5.0_03/include -I/usr/java/jdk1.5.0_03/include/linux

all:
	$(CXX) -O3 -c -fpic $(TARGET)_wrap.cxx  $(INC)
	$(CXX) -shared  $(TARGET)_wrap.o -o lib$(TARGET).so $(LIBS)
	$(JAVAC) $(PACKAGE)/*.java
	$(JAVAC) test.java
	$(JAR) cfv $(TARGET).jar $(PACKAGE)/*.class

test:
	env LD_LIBRARY_PATH=. $(JAVA) test -d ../../mecab-ipadic

clean:
	rm -fr *.jar *.o *.so *.class $(PACKAGE)/*.class
	
cleanall:
	rm -fr $(TARGET).java *.cxx
