Commit 9e8efd35c253ce940a1a39a7f70d568756b3d321
1 parent
67297c69
Adapt code to enable successful 'make distcheck'
Showing
2 changed files
with
19 additions
and
13 deletions
pyext/Makefile.am
| ... | ... | @@ -212,8 +212,10 @@ BUILT_SOURCES = |
| 212 | 212 | endif # BUILD_WRAPPERS |
| 213 | 213 | |
| 214 | 214 | # Extra files to be distributed in the tar file |
| 215 | -EXTRA_DIST = $(wildcard *.i) $(wildcard gammalib/*.i) gammalib/tests \ | |
| 216 | - $(PYTHON_WRAPPERS) | |
| 215 | +EXTRA_DIST = gammalib/tests $(PYTHON_WRAPPERS) | |
| 216 | +dist-hook: | |
| 217 | + cp -r $(srcdir)/*.i $(distdir) | |
| 218 | + cp -r $(srcdir)/gammalib/*.i $(distdir)/gammalib | |
| 217 | 219 | |
| 218 | 220 | # Dependencies. Obtain the list of dependencies by executing ls. |
| 219 | 221 | DEPFILES = $(shell ls gammalib/*.Pi 2> /dev/null) |
| ... | ... | @@ -237,16 +239,24 @@ endif |
| 237 | 239 | # Do nothing for 'make check' |
| 238 | 240 | #check-local: |
| 239 | 241 | |
| 240 | -# Install the gammalib extension module | |
| 242 | +# Install the gammalib Python module | |
| 241 | 243 | install-exec-local: |
| 242 | 244 | $(PYTHON) setup.py install --prefix=$(prefix) |
| 243 | 245 | |
| 244 | -# Set files to be removed in clean | |
| 246 | +# Uninstall the gammalib Python module | |
| 247 | +uninstall-local: | |
| 248 | + rm -rf $(pyexecdir)/gammalib | |
| 249 | + rm -rf $(pyexecdir)/gammalib-@VERSION@* | |
| 250 | + rm -rf $(datarootdir)/gammalib | |
| 251 | + | |
| 252 | +# Set files to be removed in 'make clean' | |
| 245 | 253 | CLEANFILES = $(CLEAN_FILES) $(DEPFILES) |
| 246 | 254 | |
| 247 | -# Remove build directory and test libraries | |
| 255 | +# Files to be removed in build directory | |
| 248 | 256 | clean-local: |
| 249 | 257 | rm -rf build |
| 250 | - rm -rf gammalib/__init__.py? gammalib/_*.so gammalib/*.pyc | |
| 258 | + rm -rf $(builddir)/gammalib/__init__.py? | |
| 259 | + rm -rf $(builddir)/gammalib/_*.so | |
| 260 | + rm -rf $(builddir)/gammalib/*.pyc | |
| 251 | 261 | |
| 252 | 262 | endif # WITH_PYTHON | ... | ... |
pyext/setup.py.in
| ... | ... | @@ -168,16 +168,12 @@ for module in core_modules: |
| 168 | 168 | # Set extension definition for instrument dependent modules |
| 169 | 169 | for module in inst_modules: |
| 170 | 170 | |
| 171 | - # Define paths | |
| 172 | - pyext_path = '@top_srcdir@/inst/'+module+'/pyext' | |
| 173 | - include_path = '@top_srcdir@/inst/'+module+'/include' | |
| 174 | - | |
| 175 | 171 | # Set include directories for module |
| 176 | 172 | include_inst_dirs = include_dirs |
| 177 | - include_inst_dirs.append(include_path) | |
| 173 | + include_inst_dirs.append('@top_srcdir@/inst/'+module+'/include') | |
| 178 | 174 | |
| 179 | 175 | # Add SWIG files to install_files |
| 180 | - install_files.extend(glob.glob(pyext_path+'/*.i')) | |
| 176 | + install_files.extend(glob.glob('@top_srcdir@/inst/'+module+'/pyext/*.i')) | |
| 181 | 177 | |
| 182 | 178 | # In case that wrappers were not built then copy the module wrapper files |
| 183 | 179 | # from the source to the build directory |
| ... | ... | @@ -189,7 +185,7 @@ for module in inst_modules: |
| 189 | 185 | |
| 190 | 186 | # Define module |
| 191 | 187 | ext_module = Extension('_'+module, [pkg_name+'/'+module+'_wrap.cpp'], \ |
| 192 | - include_dirs=include_dirs, \ | |
| 188 | + include_dirs=include_inst_dirs, \ | |
| 193 | 189 | libraries=libraries, |
| 194 | 190 | library_dirs=library_dirs, |
| 195 | 191 | runtime_library_dirs=runtime_library_dirs, | ... | ... |