aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGertjan van den Burg <gertjanvandenburg@gmail.com>2017-12-12 20:19:50 -0500
committerGertjan van den Burg <gertjanvandenburg@gmail.com>2017-12-12 20:19:50 -0500
commit940b03701106825ba6b2d842a97093a3d03e6507 (patch)
tree716fc1a98fa7ab839ba626bf9304cc651b29cd25
parentadd windows doc makefile (diff)
downloadpygensvm-940b03701106825ba6b2d842a97093a3d03e6507.tar.gz
pygensvm-940b03701106825ba6b2d842a97093a3d03e6507.zip
minor changes to setup.py and makefile
-rw-r--r--Makefile7
-rw-r--r--setup.py15
2 files changed, 16 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index ed25d69..c330cd5 100644
--- a/Makefile
+++ b/Makefile
@@ -44,6 +44,9 @@ clean: ## Clean build dist and egg directories left after install
rm -rf gensvm/*.so
rm -f MANIFEST
+cleaner: clean
+ rm -f ./src/wrapper.c
+
develop: ## Install a development version of the package needed for testing
python setup.py develop --user
@@ -55,3 +58,7 @@ dist: ## Make Python source distribution
dist2: ## Make Python 2 source distribution
python2 setup.py sdist
+
+docs: doc
+doc: install ## Build documentation with Sphinx
+ $(MAKE) -C $(DOC_DIR) html
diff --git a/setup.py b/setup.py
index 2962329..28d27ce 100644
--- a/setup.py
+++ b/setup.py
@@ -39,16 +39,19 @@ def configuration():
cblas_libs.append('m')
# Wrapper code in Cython uses the .pyx extension if we want to USE_CYTHON,
- # otherwise it ends in .c. If you have more Cython code, you may want to
- # extend this a bit
- wrapper = 'wrapper.pyx' if USE_CYTHON else 'wrapper.c'
+ # otherwise it ends in .c.
+ wrappers = [
+ os.path.join('src', 'wrapper.pyx'),
+ ]
+ if not USE_CYTHON:
+ wrappers = [os.path.splitext(w)[0] + '.c' for w in wrappers]
# Sources include the C/Cython code from the wrapper and the source code of
# the C library
- gensvm_sources = [
- os.path.join('src', wrapper),
+ gensvm_sources = wrappers[:]
+ gensvm_sources.append([
os.path.join('src', 'gensvm', 'src', '*.c'),
- ]
+ ])
# Dependencies are the header files of the C library and any potential
# helper code between the library and the Cython code