From 940b03701106825ba6b2d842a97093a3d03e6507 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Tue, 12 Dec 2017 20:19:50 -0500 Subject: minor changes to setup.py and makefile --- Makefile | 7 +++++++ setup.py | 15 +++++++++------ 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 -- cgit v1.2.3