summaryrefslogtreecommitdiffstats
path: root/package/python
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-09-30 23:39:01 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-10-05 14:32:41 +0200
commit899d2af16d3a4345a4966e9eb3f552847b57a116 (patch)
tree3a9e26cff155b9ce2ff8baef2ce9cda54c07c237 /package/python
parent1ae62213fa26b4c0b07b635b31404f17f8ecae9b (diff)
downloadbuildroot-899d2af16d3a4345a4966e9eb3f552847b57a116.tar.gz
buildroot-899d2af16d3a4345a4966e9eb3f552847b57a116.zip
python, python3: convert py/pyc removal to TARGET_FINALIZE_HOOKS
Since the removal of py/pyc files is Python-specific, this commit moves the logic removing those files to python.mk and python3.mk respectively. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/python')
-rw-r--r--package/python/python.mk14
1 files changed, 14 insertions, 0 deletions
diff --git a/package/python/python.mk b/package/python/python.mk
index f9968ca895..24367a375c 100644
--- a/package/python/python.mk
+++ b/package/python/python.mk
@@ -208,3 +208,17 @@ PYTHON_PATH = $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/sysconfigdata/
$(eval $(autotools-package))
$(eval $(host-autotools-package))
+
+ifeq ($(BR2_PACKAGE_PYTHON_PYC_ONLY),y)
+define PYTHON_FINALIZE_TARGET
+ find $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR) -name '*.py' -print0 | xargs -0 rm -f
+endef
+endif
+
+ifeq ($(BR2_PACKAGE_PYTHON_PY_ONLY),y)
+define PYTHON_FINALIZE_TARGET
+ find $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR) -name '*.pyc' -print0 | xargs -0 rm -f
+endef
+endif
+
+TARGET_FINALIZE_HOOKS += PYTHON_FINALIZE_TARGET
OpenPOWER on IntegriCloud