summaryrefslogtreecommitdiffstats
path: root/build/linux/Makefile.in
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <wjp@usecode.org>2015-02-26 16:30:43 +0100
committerWillem Jan Palenstijn <wjp@usecode.org>2015-02-26 16:30:43 +0100
commit9e2bb413a937aefe57f4fcf343413543ae57258a (patch)
treef4d87d40ae17775e4e3c744476d31d56b5dba64b /build/linux/Makefile.in
parent0ca00f4c671d6d583ae77838d3e0d4fcd411f077 (diff)
parente0aca18f687e9f49223ffb24b9be354bed4b150a (diff)
downloadastra-9e2bb413a937aefe57f4fcf343413543ae57258a.tar.gz
astra-9e2bb413a937aefe57f4fcf343413543ae57258a.tar.bz2
astra-9e2bb413a937aefe57f4fcf343413543ae57258a.tar.xz
astra-9e2bb413a937aefe57f4fcf343413543ae57258a.zip
Merge pull request #16 from dmpelt/python-interface
Add Python interface
Diffstat (limited to 'build/linux/Makefile.in')
-rw-r--r--build/linux/Makefile.in45
1 files changed, 43 insertions, 2 deletions
diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in
index 5b4c9fa..6620446 100644
--- a/build/linux/Makefile.in
+++ b/build/linux/Makefile.in
@@ -1,5 +1,7 @@
cuda=@HAVECUDA@
matlab=@HAVEMATLAB@
+python=@HAVEPYTHON@
+
MATLAB_ROOT=@MATLAB_ROOT@
@@ -9,6 +11,10 @@ ifeq ($(matlab),yes)
TARGETS+=mex
endif
+ifeq ($(python),yes)
+TARGETS+=py
+endif
+
all: $(TARGETS)
prefix=@prefix@
@@ -40,6 +46,14 @@ CXXFLAGS+=-fopenmp
LDFLAGS+=-fopenmp
endif
+ifeq ($(python),yes)
+PYCPPFLAGS = ${CPPFLAGS}
+PYCPPFLAGS += -I../include
+PYLDFLAGS = ${LDFLAGS}
+PYLDFLAGS += -L../build/linux/.libs
+PYTHON = @PYTHON@
+endif
+
BOOST_CPPFLAGS=
BOOST_LDFLAGS=
@@ -54,7 +68,7 @@ LD=@CXX@
SHELL=@SHELL@
ifeq ($(matlab),yes)
-MEXFLAGS = -cxx
+MEXFLAGS = -cxx
MEXLDFLAGS='$$LDFLAGS $(LDFLAGS)'
MEXLIBS = -L.libs -lut
MEXSUFFIX = @MEXSUFFIX@
@@ -227,6 +241,14 @@ mex: $(MATLAB_MEX)
$(MEX) LDFLAGS=$(MEXLDFLAGS) $(MEXFLAGS) $(LIBS) $(MEXLIBS) -lastra -output $* $*.o $(MATLAB_CXX_OBJECTS)
endif
+ifeq ($(python),yes)
+py: libastra.la
+ cd ../../python; CPPFLAGS="${PYCPPFLAGS}" LDFLAGS="${PYLDFLAGS}" $(PYTHON) builder.py install \
+ --install-base=./finalbuild --install-headers=./finalbuild --install-purelib=./finalbuild \
+ --install-platlib=./finalbuild --install-scripts=./finalbuild --install-data=./finalbuild
+endif
+
+
libastra.la: $(ALL_OBJECTS)
./libtool --mode=link --tag=CXX $(LD) -rpath $(LIBDIR) -o $@ $(LDFLAGS) $(LIBS) $+
@@ -279,6 +301,8 @@ clean:
rm -f $(addsuffix /*.d,$(DEPDIRS))
rm -f $(addsuffix /*,$(LIBDIRS))
rm -f $(TEST_OBJECTS) test.bin
+ rm -fr ../../python/finalbuild/
+ rm -fr ../../python/build/
distclean: clean
rm -f config.guess config.sub ltmain.sh libtool install-sh
@@ -287,7 +311,7 @@ distclean: clean
rm -rf autom4te.cache
rm -f configure Makefile
-install: install-libraries install-matlab
+install: install-libraries install-matlab install-python
install-libraries: libastra.la
./install-sh -m 755 -d @libdir@
@@ -307,6 +331,23 @@ else
install-matlab:
endif
+ifeq ($(python),yes)
+# TODO: This install location doesn't work well for /usr or /usr/local
+install-python: py
+ ./install-sh -m 755 -d @prefix@/python
+ ./install-sh -m 755 -d @prefix@/python/astra
+ ./install-sh -m 644 ../../python/finalbuild/astra/*.so @prefix@/python/astra
+ ./install-sh -m 644 ../../python/finalbuild/astra/*.py @prefix@/python/astra
+ ./install-sh -m 644 ../../python/finalbuild/*.egg-info @prefix@/python/
+ @echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+ @echo "To use ASTRA in Python, add @prefix@/python/ to your PYTHONPATH"
+ @echo "and @libdir@ to your LD_LIBRARY_PATH."
+ @echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+# TODO: docs
+else
+install-python:
+endif
+
Makefile: Makefile.in config.status
CONFIG_HEADERS= CONFIG_LINKS= CONFIG_FILES=$@ $(SHELL) ./config.status