[PATCH evemu 16/16] python: add all .pyc files to CLEANFILES

Peter Hutterer peter.hutterer at who-t.net
Mon Aug 11 18:34:50 PDT 2014


Splitting the python_sources into a separate variable. No functional change,
just nicer to read than base_python_PYTHON in the CLEANFILES.

Python2 and Python3 have different behaviors for the pyc files, in Python3
they're inside a __pycache__ folder and named e.g. const.cpython-33.pyc.
We can just delete the folder itself here, not worrying about the specific
names.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 python/Makefile.am | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/python/Makefile.am b/python/Makefile.am
index b529f1f..84dd7d4 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -16,13 +16,15 @@
 # You should have received a copy of the GNU General Public License along 
 # with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-nobase_python_PYTHON = \
+python_sources = \
 	evemu/__init__.py \
 	evemu/base.py \
 	evemu/const.py \
 	evemu/exception.py \
 	evemu/event_names.py # generated!
 
+nobase_python_PYTHON = $(python_sources)
+
 test_sources = \
 	       evemu/testing/__init__.py \
 	       evemu/testing/mocker.py \
@@ -52,4 +54,12 @@ $(builddir)/evemu/event_names.py: Makefile $(srcdir)/evemu/make-event-names.py
 
 BUILT_SOURCES = evemu-test-runner $(builddir)/evemu/event_names.py
 EXTRA_DIST =  evemu-test-runner.in $(test_sources) $(srcdir)/evemu/make-event-names.py
-CLEANFILES = $(BUILT_SOURCES)
+
+python3_pyc = \
+		evemu/__pycache__/ \
+		evemu/testing/__pycache__ \
+		evemu/tests/__pycache
+
+python2_pyc = $(test_sources:.py=.pyc) $(python_sources:.py=.pyc)
+
+CLEANFILES = $(BUILT_SOURCES) $(python2_pyc) $(python3_pyc)
-- 
1.9.3



More information about the Input-tools mailing list