From 9bfcd44cc85f9099ea313bae32e6e8622ebc266a Mon Sep 17 00:00:00 2001 From: "Josh Warner (Mac)" Date: Tue, 7 Jul 2015 19:04:35 -0500 Subject: [PATCH 1/2] ENH: `make clean` now removes compiled .c and .pyd files. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b80eba0d..39812d5c 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ all: python setup.py build_ext --inplace clean: - find . -name "*.so" -o -name "*.pyc" -o -name "*.pyx.md5" | xargs rm -f + find . -name "*.so" -o -name "*.pyc" -o -name "*.pyx.md5" -o -name "*.c" -o -name "*.pyd" | xargs rm -f test: python -c "import skimage, sys, io; sys.exit(skimage.test_verbose())" From 1d1a1a776d6af67dafd27faef0920af30c271833 Mon Sep 17 00:00:00 2001 From: "Josh Warner (Mac)" Date: Tue, 7 Jul 2015 20:40:14 -0500 Subject: [PATCH 2/2] Remove only .c files associated with .pyx source. --- Makefile | 3 ++- tools/rm_pyx_c_file.sh | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 tools/rm_pyx_c_file.sh diff --git a/Makefile b/Makefile index 39812d5c..03ffb2ad 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,8 @@ all: python setup.py build_ext --inplace clean: - find . -name "*.so" -o -name "*.pyc" -o -name "*.pyx.md5" -o -name "*.c" -o -name "*.pyd" | xargs rm -f + find . -name "*.so" -o -name "*.pyc" -o -name "*.pyx.md5" -o -name "*.pyd" | xargs rm -f + find . -name "*.pyx" -exec ./tools/rm_pyx_c_file.sh {} \; test: python -c "import skimage, sys, io; sys.exit(skimage.test_verbose())" diff --git a/tools/rm_pyx_c_file.sh b/tools/rm_pyx_c_file.sh new file mode 100755 index 00000000..1febb19e --- /dev/null +++ b/tools/rm_pyx_c_file.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# Accepts a .pyx file path and deletes an associated .c file, if present. +filename="${1%.*}".c +if [ -e "$filename" ]; then + rm -f "$filename"; +fi