jan/feature/20260722-make-improve-make-variable-caching-machinery into master .mypy_cache, .ruff_cache and .pytest_cache are not consistently cleaned in all subdirectories. Fix that. Signed-off-by: Jan Lindemann <jan@janware.com>
During a topdir "make all", caching variables is currently not the first thing that happens. Instead, variables are cached as soon as a project recurses into the make subdirectory. That was necessary, because some makefiles were regenerated in the make subdirectory by autoconf, potentially contributing variables that needed to be cached. As of now, autoconf is long gone and this is no longer true. And for some variables, the two step process becomes involved, notably for PYTHONPATH, which coding agents would like to look at from the topdir very early on. This commit moves the .project-cache.mk creation to topdir.mk, and .projects-cache.mk creation to jw-pkg/Makefile to address that. Signed-off-by: Jan Lindemann <jan@janware.com>
py-topdir.mk has this:
ifndef PY_CHECK_ROOTS
PY_CHECK_ROOTS += ...
endif
That is too involved: Either PY_CHECK_ROOTS is defined, then nothing
is appended, or it's undefined, then a simple "=" would be just fine.
Use that instead.
Signed-off-by: Jan Lindemann <jan@janware.com>
If run from $(TOPDIR), "make clean all" runs fine, because it recurses twice into $(TOPDIR)/make, once for every target. If invoked directly from $(TOPDIR)/make, it can break in two different ways: If the cache files don't exist, "make clean all" in $(TOPDIR)/make tries to create them too early as implicit make target. This leaves variables empty which should have a value. If the cache files do exist, "make clean all" in $(TOPDIR)/make includes them, cleans them, and re-creates them from the same variables just read from cache. Undesirable for cache purging. Signed-off-by: Jan Lindemann <jan@janware.com>