Ticket #29647: patch-Makefile.diff

File patch-Makefile.diff, 1.2 KB (added by humem (humem), 13 years ago)
  • Makefile

    old new  
    1 TARGET=MeCab
    2 JAVAC=javac
    3 JAVA=java
    4 JAR=jar
    5 CXX=c++
    6 INCLUDE=/usr/local/jdk/include
     1JAVA_BASE=/System/Library/Frameworks/JavaVM.framework
     2JAVA_HOME=$(JAVA_BASE)/Home
     3
     4TARGET=mecab
     5JAVAC=$(JAVA_HOME)/bin/javac -encoding UTF-8
     6JAVA=$(JAVA_HOME)/bin/java -Dfile.encoding=UTF-8
     7JAR=$(JAVA_HOME)/bin/jar
     8CXX=g++
     9INCLUDE=$(JAVA_BASE)/Headers
    710
    811PACKAGE=org/chasen/mecab
    912
    1013LIBS=`mecab-config --libs`
    11 INC=`mecab-config --cflags` -I$(INCLUDE) -I$(INCLUDE)/linux
     14INC=`mecab-config --cflags` -I$(INCLUDE)
    1215
    1316all:
    14         $(CXX) -O3 -c -fpic $(TARGET)_wrap.cxx $(INC)
    15         $(CXX) -shared  $(TARGET)_wrap.o -o lib$(TARGET).so $(LIBS)
     17        $(CXX) $(CXXFLAGS) -c -fPIC $(TARGET)_wrap.cxx $(INC)
     18        $(CXX) $(CXXFLAGS) -dynamiclib $(TARGET)_wrap.o -o lib$(TARGET)-java.dylib $(LIBS)
    1619        $(JAVAC) $(PACKAGE)/*.java
    1720        $(JAVAC) test.java
    1821        $(JAR) cfv $(TARGET).jar $(PACKAGE)/*.class
    1922
    2023test:
    21         env LD_LIBRARY_PATH=. $(JAVA) test
     24        $(JAVA) test
    2225
    2326clean:
    24         rm -fr *.jar *.o *.so *.class $(PACKAGE)/*.class
    25        
     27        rm -fr *.jar *.o *.dylib *.class $(PACKAGE)/*.class
     28
    2629cleanall:
    2730        rm -fr $(TARGET).java *.cxx