diff options
| author | Yousong Zhou <yszhou4tech@gmail.com> | 2016-10-21 10:27:51 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-21 10:27:51 -0500 |
| commit | 9f8dd657a1ee6ef0af496d89d3aef4f9595f13bf (patch) | |
| tree | 24d0f13b6530a43866dc934b9aa0951d5c7d9435 /lang/python/files/python-package.mk | |
| parent | 78d163bdea65c3cd74ebfc6ed0ee3d9bd35fb78a (diff) | |
| parent | c6ddd3d7c0b9f4a86c6d39c03493e8f40aaa0dce (diff) | |
Merge pull request #3352 from yousong/python-packages
python-packages: initial version 1.0
Diffstat (limited to 'lang/python/files/python-package.mk')
| -rw-r--r-- | lang/python/files/python-package.mk | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/lang/python/files/python-package.mk b/lang/python/files/python-package.mk index 1f824cba6..52b6cf37e 100644 --- a/lang/python/files/python-package.mk +++ b/lang/python/files/python-package.mk @@ -82,13 +82,12 @@ endef $(call include_mk, python-host.mk) -# $(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/PyMod - $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR) +define Build/Compile/HostPyRunTarget $(call HostPython, \ - cd $(PKG_BUILD_DIR)/$(strip $(1)); \ + $(if $(1),$(1);) \ CC="$(TARGET_CC)" \ CCSHARED="$(TARGET_CC) $(FPIC)" \ CXX="$(TARGET_CXX)" \ @@ -101,8 +100,19 @@ define Build/Compile/PyMod __PYVENV_LAUNCHER__="/usr/bin/$(PYTHON)" \ $(3) \ , \ - ./setup.py $(2) \ + $(2) \ ) +endef + +# $(1) => build subdir +# $(2) => additional arguments to setup.py +# $(3) => additional variables +define Build/Compile/PyMod + $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR) + $(call Build/Compile/HostPyRunTarget, \ + cd $(PKG_BUILD_DIR)/$(strip $(1)), \ + ./setup.py $(2), \ + $(3)) find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" -o -name "*\.exe" | xargs rm -f endef |
