forked from GitHub/gf-core
the Eclipse project for the Java binding is now replaced with a simple Makefile
This commit is contained in:
30
src/runtime/java/Makefile
Normal file
30
src/runtime/java/Makefile
Normal file
@@ -0,0 +1,30 @@
|
||||
C_SOURCES = jpgf.c jsg.c
|
||||
JAVA_SOURCES = $(wildcard org/grammaticalframework/pgf/*.java) \
|
||||
$(wildcard org/grammaticalframework/sg/*.java)
|
||||
|
||||
JNI_PATH = /usr/lib/jvm/default-java/include
|
||||
INSTALL_PATH = /usr/local/lib
|
||||
|
||||
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
|
||||
|
||||
%.lo : %.c
|
||||
libtool --mode=compile gcc -g -O -c -I$(JNI_PATH) -std=c99 -shared $< -o $@
|
||||
|
||||
jpgf.jar: $(patsubst %.java, %.class, $(JAVA_SOURCES))
|
||||
jar -cf $@ $^
|
||||
|
||||
%.class : %.java
|
||||
javac $<
|
||||
|
||||
install: libjpgf.la jpgf.jar
|
||||
libtool --mode=install install -s libjpgf.la $(INSTALL_PATH)
|
||||
|
||||
clean:
|
||||
rm -f *.lo
|
||||
rm -f *.la
|
||||
rm -f -r .libs
|
||||
rm -f *.jar
|
||||
rm -f org/grammaticalframework/*/*.class
|
||||
Reference in New Issue
Block a user