Improve Makefile variable caching: PREREQ, JW_PKG_NO_CACHE, subsections #28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "jan/feature/20260617-py-path-ldlibpath-mk-space-separate-jw-pkg-xxx-path"
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?
This PR adds various improvements regarding how generated Makefile variables are cached
Generate system search paths from PREREQ and friends:
Introduce the PREREQ_BUILD and PREREQ_RUN Makefile variables, and make them, together with the already existing variable PREREQ, available in the entire project via defs.mk. This allows to append project names to them, e.g. in local.mk, and have system search paths (PATH, PYTHONPATH, LD_LIBRARY_PATH) extended automatically.
JW_PKG_NO_CACHE:
Allow to turn off caching by setting
JW_PKG_NO_CACHEtotruein the environment orlocal.mk.Space-separated subsections:
Make $(call ...) macros accept multiple dependency flavours or subsections separated by whitespace.
cache-projects.mk: Remove unused ifndef / endif
make/Makefile is responsible to generate $(TOPDIR)/cache-projects.mk. The variables are taken from .cache-project.mk, with some variables intentionally omitted, but their ifndef / endif blocks remain place. Not harmful but ugly. Make sed range-delete the left-over blocks entirely.
cache.mk: Support JW_PKG_NO_CACHE
cache.mk generates .project-cache.mk, and this commit supports disabling the definitions in the generated cache by setting JW_PKG_NO_CACHE=true.
topdir.mk: Move PREREQ definition into defs.mk
At present, the PREREQ-variable is effectively only used to detect if prerequiste packages haven't run "make all" before make is run in a given package. Also, it's only useful in $(TOPDIR). This commit splits the variable up into PREREQ_BUILD and PREREQ_RUN, and makes the variables available in every Makefile of a package by placing them in defs.mk instead of topdir.mk.
This also fixes a problem that PREREQ was cached before being filled, hence empty. Which effectively wasn't much of a problem, because it was basically unused, but still.
cmds.projects.BaseCmdPkgRelations: Support spaces as delimiter
Some options to the pkg-xxx commands, like flavour, --subsections and --ignore understand a comma as delimiter if multiple option values are specified. The comma character is not very friendly to use in $(call ...) macros, though, so support spaces and pipe characters as well.
cmds.projects.Cmd[Ldlibpath|Exepath]: Support --delimiter
Support a --delimiter option to the ldlibpath and exepath commands. Notable use case are the JW_PKG_XXX_PATH variables, which should use spaces instead of colons.
TODO: Merging those two command modules with BaseCmdPkgRelations would have made introducing this redundancy unnecessary, check if that's a possibility.
py-path|ldlibpath.mk: Space-separate JW_PKG_XXX_PATH
The following variables contain colons as path-separators:
This commit makes them use spaces instead, so they can be more easily amended by Makefiles using them. Also define them in a more uniform way, and use the newly introduced PREREQ_RUN variable to fill them, which in turn can also be appended to before that.
Improve Makefile variable caching: PREREQ, JW_PKG_NO_CACHE, Space-separated subsectionsto Improve Makefile variable caching: PREREQ, JW_PKG_NO_CACHE, subsections