summaryrefslogtreecommitdiff
path: root/lang/python/files/python-host.mk
diff options
context:
space:
mode:
authorYousong Zhou <yszhou4tech@gmail.com>2016-10-17 18:05:50 +0800
committerYousong Zhou <yszhou4tech@gmail.com>2016-10-17 19:55:39 +0800
commitfbba266e793941a89f9964f7171fdbdc82e9fd61 (patch)
treeb56ebb75840733355f370d6d9a8b81c9861853b2 /lang/python/files/python-host.mk
parent3c698f22853b7d60d9e8401a861625d60c6132e5 (diff)
python: introduce Build/Compile/HostPyRun{Host,Target}
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Diffstat (limited to 'lang/python/files/python-host.mk')
-rw-r--r--lang/python/files/python-host.mk21
1 files changed, 16 insertions, 5 deletions
diff --git a/lang/python/files/python-host.mk b/lang/python/files/python-host.mk
index 8736d29ad..6f7977310 100644
--- a/lang/python/files/python-host.mk
+++ b/lang/python/files/python-host.mk
@@ -31,12 +31,12 @@ define HostPython
$(HOST_PYTHON_BIN) $(2);
endef
-# $(1) => build subdir
-# $(2) => additional arguments to setup.py
+# $(1) => commands to execute before running pythons script
+# $(2) => python script and its arguments
# $(3) => additional variables
-define Build/Compile/HostPyMod
+define Build/Compile/HostPyRunHost
$(call HostPython, \
- cd $(HOST_BUILD_DIR)/$(strip $(1)); \
+ $(if $(1),$(1);) \
CC="$(HOSTCC)" \
CCSHARED="$(HOSTCC) $(HOST_FPIC)" \
CXX="$(HOSTCXX)" \
@@ -48,9 +48,20 @@ define Build/Compile/HostPyMod
_PYTHON_HOST_PLATFORM=linux2 \
$(3) \
, \
- ./setup.py $(2) \
+ $(2) \
, \
HOST \
)
endef
+
+# $(1) => build subdir
+# $(2) => additional arguments to setup.py
+# $(3) => additional variables
+define Build/Compile/HostPyMod
+ $(call Build/Compile/HostPyRunHost, \
+ cd $(HOST_BUILD_DIR)/$(strip $(1)), \
+ ./setup.py $(2), \
+ $(3))
+endef
+