forked from GitHub/gf-core
a version of the Makefile for the Java binding which should work on Linux and Mac OS
This commit is contained in:
@@ -3,15 +3,18 @@ JAVA_SOURCES = $(wildcard org/grammaticalframework/pgf/*.java) \
|
||||
$(wildcard org/grammaticalframework/sg/*.java)
|
||||
|
||||
JNI_PATH = /usr/lib/jvm/default-java/include
|
||||
#JNI_PATH = /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/
|
||||
INSTALL_PATH = /usr/local/lib
|
||||
|
||||
LIBTOOL = $(if $(shell command -v glibtool 2>/dev/null), glibtool --tags=CC, libtool)
|
||||
|
||||
all: libjpgf.la jpgf.jar
|
||||
|
||||
libjpgf.la: $(patsubst %.c, %.lo, $(C_SOURCES))
|
||||
libtool --mode=link gcc -g -O -o libjpgf.la -shared $^ -rpath $(INSTALL_PATH) -lgu -lpgf -lsg
|
||||
$(LIBTOOL) --mode=link gcc -g -O -o libjpgf.la -shared $^ -rpath $(INSTALL_PATH) -lgu -lpgf -lsg
|
||||
|
||||
%.lo : %.c
|
||||
libtool --mode=compile gcc -g -O -c -I$(JNI_PATH) -std=c99 -shared $< -o $@
|
||||
$(LIBTOOL) --mode=compile gcc -g -O -c -I$(JNI_PATH) -std=c99 -shared $< -o $@
|
||||
|
||||
jpgf.jar: $(patsubst %.java, %.class, $(JAVA_SOURCES))
|
||||
jar -cf $@ org/grammaticalframework/pgf/*.class org/grammaticalframework/sg/*.class
|
||||
@@ -20,7 +23,7 @@ jpgf.jar: $(patsubst %.java, %.class, $(JAVA_SOURCES))
|
||||
javac $<
|
||||
|
||||
install: libjpgf.la jpgf.jar
|
||||
libtool --mode=install install -s libjpgf.la $(INSTALL_PATH)
|
||||
$(LIBTOOL) --mode=install install -s libjpgf.la $(INSTALL_PATH)
|
||||
|
||||
doc:
|
||||
javadoc org.grammaticalframework.pgf org.grammaticalframework.sg -d java-api
|
||||
|
||||
Reference in New Issue
Block a user