2014-04-28 11:57:09 +01:00
|
|
|
PACKAGE=swig
|
|
|
|
DOC=swig
|
|
|
|
PKGCFLAGS=
|
|
|
|
SWIG=@SWIG@
|
|
|
|
JAVAC=@JAVAC@
|
|
|
|
JAR=@JAR@
|
|
|
|
include ../Makefile.defs
|
2014-04-29 11:49:09 +01:00
|
|
|
DEFS=@DEFS@ -D_YAP_NOT_INSTALLED_=1 -DDESTDIR=\"$(DESTDIR)\"
|
|
|
|
YAP_EXTRAS=@YAP_EXTRAS@
|
2014-05-28 00:07:50 +01:00
|
|
|
srcdir=@srcdir@
|
2014-04-29 11:49:09 +01:00
|
|
|
CPPFLAGS=@CPPFLAGS@ -I../.. -I$(srcdir)/../../H -I$(srcdir)/../../include -I$(srcdir)/../../os -I$(srcdir)/../../OPTYap -I$(srcdir)/../../BEAM -I$(srcdir)/../../CXX
|
|
|
|
CXXFLAGS= @SHLIB_CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) $(CPPFLAGS)
|
2014-04-28 11:57:09 +01:00
|
|
|
|
2014-06-04 22:08:37 +01:00
|
|
|
PROGRAMS= $(srcdir)/python/demo.py \
|
2014-04-28 11:57:09 +01:00
|
|
|
|
|
|
|
SWIG_FILES= \
|
2014-04-29 11:49:09 +01:00
|
|
|
$(srcdir)/yap.i
|
2014-04-28 11:57:09 +01:00
|
|
|
|
|
|
|
all: python java R
|
|
|
|
|
|
|
|
python: $(SWIG_FILES) python/_yap.so python/yap.py
|
2014-06-04 22:08:37 +01:00
|
|
|
cp $(srcdir)/python/demo.py python
|
2014-04-28 11:57:09 +01:00
|
|
|
|
2014-04-29 11:49:09 +01:00
|
|
|
python/_yap.so: python/yap_wrap.o
|
|
|
|
$(CXX) -shared $(LDSOFLAGS) -o python/_yap.so python/yap_wrap.o ../../yapi.o $(LIBS) @PYTHON_LIBS@ -L ../.. -lYap -lpthread
|
2014-04-28 11:57:09 +01:00
|
|
|
|
|
|
|
python/yap_wrap.c: $(srcdir)/yap.i
|
2014-06-04 22:08:37 +01:00
|
|
|
mkdir -p python
|
2014-04-29 11:49:09 +01:00
|
|
|
$(SWIG) -c++ -python -outdir python -o $@ $(DEFS) $(CPPFLAGS) -Wall $<
|
2014-04-28 11:57:09 +01:00
|
|
|
|
|
|
|
python/yap_wrap.o: python/yap_wrap.c
|
2014-04-29 11:49:09 +01:00
|
|
|
$(CXX) -c $(CXXFLAGS) @PYTHON_INCLUDES@ $< -o $@
|
2014-04-28 11:57:09 +01:00
|
|
|
|
2014-05-07 09:35:19 +01:00
|
|
|
java: jni/libyap.@SO@ java/yap.java
|
2014-04-28 11:57:09 +01:00
|
|
|
cd java ; $(JAVAC) *.java; $(JAR) cvf yap.jar *.class
|
|
|
|
|
2014-05-07 09:35:19 +01:00
|
|
|
jni/libyap.@SO@: jni/yap_wrap.o
|
|
|
|
$(CXX) -shared $(LDSOFLAGS) -L ../.. -lYap -o $@ ../../yapi.o $< $(LIBS) @JPLLDFLAGS@ -L ../.. -lYap -lpthread
|
2014-04-28 11:57:09 +01:00
|
|
|
|
2014-05-28 00:07:50 +01:00
|
|
|
jni/yap_wrap.cpp: $(srcdir)/yap.i
|
2014-05-07 09:35:19 +01:00
|
|
|
$(SWIG) -c++ -java -package pt.up.fc.dcc.yap -outdir java -o $@ $(DEFS) $(CPPFLAGS) -Wall $<
|
2014-04-28 11:57:09 +01:00
|
|
|
|
2014-05-28 00:07:50 +01:00
|
|
|
jni/yap_wrap.o: jni/yap_wrap.cpp
|
2014-04-29 11:49:09 +01:00
|
|
|
$(CXX) -c $(CXXFLAGS) @JPLCFLAGS@ $< -o $@
|
2014-04-28 11:57:09 +01:00
|
|
|
|
2014-06-04 22:08:37 +01:00
|
|
|
# depends on make install on top-level
|
|
|
|
# also, should have an android device running, say
|
|
|
|
# emulator -avd first &
|
|
|
|
#
|
|
|
|
# adb uninstall org.swig.simple ( if not the first time )
|
|
|
|
# adb install bin/SwigSimple-debug.apk
|
|
|
|
#
|
|
|
|
#
|
|
|
|
android: android/jni/yap_wrap.cpp
|
2014-05-28 00:07:50 +01:00
|
|
|
|
|
|
|
android/jni/yap_wrap.cpp: $(srcdir)/yap.i
|
|
|
|
android create project --target 1 --name SwigSimple --path ./android --activity SwigSimple --package org.swig.simple
|
2014-06-04 22:08:37 +01:00
|
|
|
( cd android ; mkdir -p jni; mkdir -p assets/share/Yap; mkdir -p assets/lib/Yap;\
|
2014-05-28 00:07:50 +01:00
|
|
|
$(SWIG) -c++ -java -I$(srcdir)/../../CXX -package org.swig.simple -outdir src/org/swig/simple -o jni/yap_wrap.cpp $< ;\
|
|
|
|
cp $(srcdir)/android/SwigSimple.java src/org/swig/simple/ ;\
|
|
|
|
cp $(srcdir)/android/main.xml res/layout ;\
|
2014-06-04 22:08:37 +01:00
|
|
|
cp -r $(DESTDIR)$(PLLIBDIR)/* assets/share/Yap;\
|
|
|
|
cp -r $(DESTDIR)$(SOLIBDIR)/* assets/lib/Yap;\
|
2014-05-28 00:07:50 +01:00
|
|
|
cp ../Android.mk jni ;\
|
|
|
|
ndk-build; \
|
|
|
|
ant debug \
|
|
|
|
)
|
|
|
|
|
2014-04-28 11:57:09 +01:00
|
|
|
R:
|
|
|
|
|
|
|
|
|
2014-05-28 00:07:50 +01:00
|
|
|
yap.i: $(srcdir)/../../../../include/YapInterface.h
|
2014-04-28 11:57:09 +01:00
|
|
|
|
|
|
|
install:
|
|
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f */*
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
rm -f *def Makefile
|
|
|
|
|
|
|
|
|
|
|
|
##########
|