mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-18 21:13:56 +01:00
py-defs.mk, py-mod.mk: Add exports to __init__.py
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
9505e9ab40
commit
f8747fcdbd
2 changed files with 5 additions and 3 deletions
|
|
@ -6,12 +6,13 @@ else
|
||||||
PY_SITE_PACKAGES_PATH = $(PREFIX)/python/site-packages
|
PY_SITE_PACKAGES_PATH = $(PREFIX)/python/site-packages
|
||||||
endif
|
endif
|
||||||
|
|
||||||
PY_PROJ_MODULES_DIR ?= $(TOPDIR)/tools/python
|
PY_PROJ_MODULES_DIR ?= $(wildcard $(TOPDIR)/tools/python $(TOPDIR)/src/python)
|
||||||
PY_MODULES_DIR ?= $(PY_PROJ_MODULES_DIR)
|
PY_MODULES_DIR ?= $(PY_PROJ_MODULES_DIR)
|
||||||
PY_PROJ_MODULES += $(dir $(wildcard $(PY_MODULES_DIR)/*/__init__.py))
|
PY_PROJ_MODULES += $(dir $(wildcard $(PY_MODULES_DIR)/*/__init__.py))
|
||||||
PY_MODULES ?= $(PY_PROJ_MODULES)
|
PY_MODULES ?= $(PY_PROJ_MODULES)
|
||||||
PY_INSTALL_MOD ?= $(shell pwd | sed 's%.*/python/%%; s%/.*%%')
|
PY_INSTALL_MOD ?= $(shell pwd | sed 's%.*/python/%%; s%/.*%%')
|
||||||
PY_INSTALL_SUBMOD ?= $(shell pwd | sed "s%.*/$(PY_INSTALL_MOD)\(/\|$$\)%%")
|
PY_INSTALL_SUBMOD ?= $(shell pwd | sed "s%.*/$(PY_INSTALL_MOD)\(/\|$$\)%%")
|
||||||
|
PY_MOD ?= $(patsubst /,.,$(PY_INSTALL_MOD).$(PY_INSTALL_SUBMOD))
|
||||||
PY_SRC_PY = $(sort $(wildcard *.py) __init__.py)
|
PY_SRC_PY = $(sort $(wildcard *.py) __init__.py)
|
||||||
PY_PYC = $(patsubst %.py,%.pyc,$(PY_SRC_PY))
|
PY_PYC = $(patsubst %.py,%.pyc,$(PY_SRC_PY))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ distclean:
|
||||||
|
|
||||||
py.clean:
|
py.clean:
|
||||||
rm -f *.done *.pyc
|
rm -f *.done *.pyc
|
||||||
if [ ! -s __init__.py ]; then /bin/bash $(MOD_SCRIPT_DIR)/scm.sh clean -f __init__.py; fi
|
/bin/bash $(MOD_SCRIPT_DIR)/scm.sh clean -f __init__.py
|
||||||
|
|
||||||
install-dirs.done:
|
install-dirs.done:
|
||||||
$(INSTALL) -d -m $(PYMODDIRMODE) -o $(PYMODDIROWNER) -g $(PYMODDIRGROUP) $(PY_INSTALL_DIR)
|
$(INSTALL) -d -m $(PYMODDIRMODE) -o $(PYMODDIROWNER) -g $(PYMODDIRGROUP) $(PY_INSTALL_DIR)
|
||||||
|
|
@ -27,4 +27,5 @@ $(PY_INSTALL_DIR)/%.pyc: %.pyc
|
||||||
$(INSTALL) -m $(PYMODMODE) -o $(PYMODOWNER) -g $(PYMODGROUP) $< $@
|
$(INSTALL) -m $(PYMODMODE) -o $(PYMODOWNER) -g $(PYMODGROUP) $< $@
|
||||||
|
|
||||||
__init__.py:
|
__init__.py:
|
||||||
touch $@
|
/bin/bash +H $(MOD_SCRIPT_DIR)/python-tools.sh create-init -m $(PY_MOD) -e "$(PY_SED_EXTRACT_EXPORT)" *.py | tee $@.tmp
|
||||||
|
mv $@.tmp $@
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue