py-xxx.mk: Some variable housekeeping #81
Loading…
Reference in a new issue
No description provided.
Delete branch "jan/fix/20260824-py-defs-mk-some-variable-housekeeping"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The variables in py-xxx.mk are not very consistently named and used. This PR does some (not all) of the due cleanup.
py-rules.mk: py.clean: Honour PY_UPDATE_INIT_PY
py.clean unconditionally runs scm.sh clean -f init.py, which deletes untracked init.py files in the source directory. In a package with PY_UPDATE_INIT_PY=false the build never generates init.py, as the generation rule in py-mod.mk is gated on the same variable.
The init.py files in question are hand-written sources which are always tracked in SCM, and for those, "scm.sh clean" becomes a no-op, so with the current code, no real problem occurs, but explicitly protecting init.py from deletion if PY_UPDATE_INIT_PY is false is certainly more obvious.
Move the init.py cleanup inside the PY_UPDATE_INIT_PY=true conditional so that py.clean only runs removal commands on files the build actually generates.
py-defs.mk, py-mod.mk: Add PY_LOCAL_PY(C)
The meaning of the many PY_XXX variables isn't easy to tell apart, so start renaming some of them.
PY_ALL_PY and PY_PYC consistently are now named PY_LOCAL|INSTALL_PY and PY_LOCAL|INSTALL_PYC, depending on whether or not they are intended to be installed.
The old PY_INSTALL_PY was renamed to PY_DO_INSTALLL_PY, a move that would be better applied to all boolean variables. I won't try with this commit, however, because a lot of downstream packages depend on PY_UPDATE_INIT_PY and PY_INSTALL_INIT_PY, i.e. without "_DO".