This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/swig/Makefile.in

136 lines
3.9 KiB
Makefile
Raw Normal View History

2014-04-28 11:57:09 +01:00
PACKAGE=swig
DOC=swig
PKGCFLAGS=
SWIG=@SWIG@
2015-02-07 01:11:52 +00:00
LIBS=@LIBS@
2014-04-28 11:57:09 +01:00
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@
srcdir=@srcdir@
2014-06-11 19:31:24 +01:00
CPPFLAGS= -I../.. -I$(srcdir)/../../H -I$(srcdir)/../../include -I$(srcdir)/../../os -I$(srcdir)/../../OPTYap -I$(srcdir)/../../BEAM -I$(srcdir)/../../CXX
2014-07-14 05:42:02 +01:00
CXXFLAGS= $(YAP_EXTRAS) $(DEFS) $(CPPFLAGS)
2014-04-28 11:57:09 +01:00
2015-02-09 01:53:28 +00:00
YAP_SWIG_INTERFACE= $(srcdir)/yap.i \
$(srcdir)/../../CXX/yapi.hh \
$(srcdir)/../../CXX/yapa.hh \
$(srcdir)/../../CXX/yapdb.hh \
$(srcdir)/../../CXX/yapie.hh \
$(srcdir)/../../CXX/yapq.hh \
$(srcdir)/../../CXX/yapi.cpp
JNI_SQLITE="$(srcdir)/android/jni/sqlite"
JAVA_SQLITE="$(srcdir)/android/src/org"
SQLITE=$(JNI_SQLITE) $(JAVA_SQLITE)
PYTHON_PROGRAMS = $(srcdir)/python/demo.py
2015-04-13 13:28:17 +01:00
ANDROID_PROGRAMS=$(srcdir)/android/JavaYap.java $(SQLITE)
PROGRAMS= $(PYTHON_PROGRAMS) $(JAVA_PROGRAMS) $(ANDROID_PROGRAMS)
YAP_EXPORT_DLLS="$(DESTDIR)$(SOLIBDIR)"
YAP_EXPORT_PLS="$(DESTDIR)$(PLLIBDIR)"
YAP_EXPORT_SAVED_STATE="../../startup.yss"
PYTHON_PROGRAMS = $(srcdir)/python/demo.py
2015-04-13 13:28:17 +01:00
ANDROID_PROGRAMS=$(srcdir)/android/JavaYap.java $(SQLITE)
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
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
2014-07-14 05:42:02 +01:00
$(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
2015-02-09 01:53:28 +00:00
python/yap_wrap.cpp python/yap.py: $(YAP_SWIG_INTERFACE)
mkdir -p python
2014-06-11 19:31:24 +01:00
$(SWIG) -c++ -python -outdir python -o $@ $(CXXFLAGS) -Wall $<
2014-04-28 11:57:09 +01:00
python/yap_wrap.o: python/yap_wrap.cpp
2014-07-14 05:42:02 +01:00
$(CXX) -c @SHLIB_CXXFLAGS@ $(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
2015-02-09 01:53:28 +00:00
cd java ; $(JAVAC) *.java; $(JAR) cvf yap.jar *.class
2014-04-28 11:57:09 +01:00
2014-05-07 09:35:19 +01:00
jni/libyap.@SO@: jni/yap_wrap.o
2014-06-11 19:31:24 +01:00
$(CXX) -shared $(LDSOFLAGS) -o $@ ../../yapi.o $< $(LIBS) @JPLLDFLAGS@ -L ../.. -lYap -lpthread
2014-04-28 11:57:09 +01:00
2015-02-09 01:53:28 +00:00
jni/yap_wrap.cpp java/yap.java: $(YAP_SWIG_INTERFACE)
$(SWIG) -c++ -java -package pt.up.fc.dcc.yap -outdir java -o jni/yap_wrap.cpp $(CXXFLAGS) -Wall $<
2014-04-28 11:57:09 +01:00
jni/yap_wrap.o: jni/yap_wrap.cpp
2014-07-14 05:42:02 +01:00
$(CXX) -c @SHLIB_CXXFLAGS@ $(CXXFLAGS) @JPLCFLAGS@ $< -o $@
2015-02-07 01:11:52 +00: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 )
2014-07-10 05:28:10 +01:00
# adb install bin/JavaYap-debug.apk
#
#
android: JavaYap-debug.apk
2015-02-07 01:11:52 +00:00
JavaYap-debug.apk: android/libs/armeabi/libexample.so
( cd android && ant debug )
2015-02-07 01:11:52 +00:00
android/libs/armeabi/libexample.so: android/jni/Android.mk android/jni/Application.mk android/jni/yap_wrap.cpp
( cd android/jni && NDK_DEBUG=1 ndk-build )
2015-02-07 01:11:52 +00:00
android/jni/Application.mk: android/jni/Android.mk
cp $(srcdir)/android/jni/Application.mk android/jni
android/jni/Android.mk: android/AndroidManifest.xml
2015-03-23 07:27:10 +00:00
cp Android.mk android/jni
cp $(srcdir)/android/JavaYap.java android/src/pt/up/fc/dcc/yap
cp $(srcdir)/android/main.xml android/res/layout
cp -r $(JNI_SQLITE) android/jni
2015-02-17 20:26:46 +00:00
cp -r $(JAVA_SQLITE) android/src
2015-03-23 07:27:10 +00:00
2015-02-07 01:11:52 +00:00
android/AndroidManifest.xml: $(ANDROID_PKG)
2015-02-17 20:26:46 +00:00
android create project --target $(ANDROID_TARGET) --name JavaYap --path ./android --activity JavaYap --package pt.up.fc.dcc.yap
mkdir -p android/assets
mkdir -p android/assets/share
mkdir -p android/assets/share/Yap
2014-09-19 20:20:22 +01:00
mkdir -p android/assets/lib
2015-02-17 20:26:46 +00:00
mkdir -p android/assets/lib/Yap
mkdir -p android/jni
mkdir -p android/usr
2015-02-07 01:11:52 +00:00
2015-02-17 20:26:46 +00:00
android/jni/yap_wrap.cpp: $(YAP_SWIG_INTERFACE) android/AndroidManifest.xml
$(SWIG) -c++ -java -I$(srcdir)/../../CXX -package pt.up.fc.dcc.yap -outdir android/src/pt/up/fc/dcc/yap -o $@ $<
install-android: android
2015-03-11 22:18:00 +00:00
adb install -r android/bin/JavaYap-debug.apk
2014-07-10 05:28:10 +01:00
2014-04-28 11:57:09 +01:00
R:
yap.i: $(srcdir)/../../../../include/YapInterface.h
2014-04-28 11:57:09 +01:00
2015-04-13 13:28:17 +01:00
install: all
2014-04-28 11:57:09 +01:00
clean:
2015-04-13 13:28:17 +01:00
rm -fr android/libs/armeabi/libexample.so JavaYap-debug.apk android/jni/Application.mk \
android/jni/Android.mk android/jni/yap_wrap.cpp python/_yap.so jni/yap_wrap.o \
python/yap_wrap.cpp python/yap.py jni/yap_wrap.cpp java/yap.java
2014-04-28 11:57:09 +01:00
distclean: clean
rm -f *def Makefile
##########