mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
make: Re-add files necessary for building jw-python
Re-add everything necessary for building and packaging jw-python. ldlibpath.mk is not strictly necessary, but might be with other Python packages backed by compiled C-code, so leave it in. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
5b758023ac
commit
0a9340af49
7 changed files with 261 additions and 0 deletions
33
make/py-rules.mk
Normal file
33
make/py-rules.mk
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
all:
|
||||
|
||||
py.clean:
|
||||
$(RM) -f *.done *.pyc *.rep
|
||||
/bin/bash $(JWB_SCRIPT_DIR)/scm.sh clean -f __init__.py
|
||||
$(RM) -rf __pycache__ .mypy_cache
|
||||
|
||||
install-dirs.done:
|
||||
$(INSTALL) -d -m $(PYJWBDIRMODE) -o $(PYJWBDIROWNER) -g $(PYJWBDIRGROUP) $(PY_INSTALL_DIRS)
|
||||
touch $@
|
||||
|
||||
install-reg.done: install-dirs.done $(PY_INSTALLED_REG)
|
||||
touch $@
|
||||
|
||||
$(PY_INSTALL_DIR_PY)/%.py: %.py
|
||||
$(INSTALL) -p -m $(PYMODMODE) -o $(PYMODOWNER) -g $(PYMODGROUP) $< $@
|
||||
|
||||
ifneq ($(PYTHON_MAJOR),3)
|
||||
%.pyc: %.py
|
||||
else
|
||||
__pycache__/%.$(PY_CPYTHON_PREFIX).pyc: %.py
|
||||
endif
|
||||
$(PYTHON) -c "import py_compile; py_compile.compile(\"$<\", doraise=True)"
|
||||
|
||||
ifeq ($(PYTHON_MAJOR),3)
|
||||
$(PY_INSTALL_DIR_PY)/__pycache__/%.$(PY_CPYTHON_PREFIX).pyc: __pycache__/%.$(PY_CPYTHON_PREFIX).pyc
|
||||
else
|
||||
$(PY_INSTALL_DIR_PY)/%.pyc: %.pyc
|
||||
endif
|
||||
$(INSTALL) -p -m $(PYMODMODE) -o $(PYMODOWNER) -g $(PYMODGROUP) $< $@
|
||||
|
||||
check:
|
||||
$(PY_MYPY) $(shell /bin/bash $(JWB_SCRIPT_DIR)/scm.sh ls-files | grep '\.py$$')
|
||||
Loading…
Add table
Add a link
Reference in a new issue