From 6a670f42b117afd2ddbfeb3320e88d701b39dddc Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Mon, 7 Nov 2016 09:31:18 +0200 Subject: [PATCH] python: move PYTHON_VERSION in own .mk file Allows for more granularity with respect to python-host.mk and python-package.mk inclusions. Signed-off-by: Alexandru Ardelean --- lang/python/Makefile | 6 +++++- lang/python/files/python-host.mk | 3 +++ lang/python/files/python-package.mk | 3 +-- lang/python/files/python-version.mk | 10 ++++++++++ 4 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 lang/python/files/python-version.mk diff --git a/lang/python/Makefile b/lang/python/Makefile index 336c3b0a6..687481fab 100644 --- a/lang/python/Makefile +++ b/lang/python/Makefile @@ -7,10 +7,13 @@ include $(TOPDIR)/rules.mk +# For PYTHON_VERSION +include ./files/python-version.mk + # This file provides the necsessary host build variables include ./files/python-host.mk -# The file included below defines PYTHON_VERSION +# For PyPackage include ./files/python-package.mk PKG_NAME:=python @@ -142,6 +145,7 @@ define Build/InstallDev $(INSTALL_DATA) \ ./files/python-package.mk \ ./files/python-host.mk \ + ./files/python-version.mk \ $(STAGING_DIR)/mk/ $(CP) \ $(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \ diff --git a/lang/python/files/python-host.mk b/lang/python/files/python-host.mk index da24f3dc1..21f238fe0 100644 --- a/lang/python/files/python-host.mk +++ b/lang/python/files/python-host.mk @@ -8,6 +8,9 @@ ifneq ($(__python_host_mk_inc),1) __python_host_mk_inc=1 +# For PYTHON_VERSION +$(call include_mk, python-version.mk) + # Compatibility fallback for older OpenWrt and LEDE versions ifeq ($(STAGING_DIR_HOSTPKG),) $(warning STAGING_DIR_HOSTPKG is unset - falling back to $$(STAGING_DIR)/host) diff --git a/lang/python/files/python-package.mk b/lang/python/files/python-package.mk index 52b6cf37e..2a2e371c3 100644 --- a/lang/python/files/python-package.mk +++ b/lang/python/files/python-package.mk @@ -5,8 +5,7 @@ # See /LICENSE for more information. # -PYTHON_VERSION:=2.7 -PYTHON_VERSION_MICRO:=12 +$(call include_mk, python-version.mk) PYTHON_DIR:=$(STAGING_DIR)/usr PYTHON_BIN_DIR:=$(PYTHON_DIR)/bin diff --git a/lang/python/files/python-version.mk b/lang/python/files/python-version.mk new file mode 100644 index 000000000..6905c3d68 --- /dev/null +++ b/lang/python/files/python-version.mk @@ -0,0 +1,10 @@ +# +# Copyright (C) 2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +PYTHON_VERSION:=2.7 +PYTHON_VERSION_MICRO:=12 +