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.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-06-17 14:10:12 +02:00
commit 8712cbc7b5
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -20,11 +20,13 @@ clean-cache:
cache: $(CACHE_PROJECT_MK)
$(CACHE_PROJECT_MK): $(CACHED_FILES) $(JWBDIR)/make/cache.mk
@echo 'ifneq ($$(JW_PKG_NO_CACHE),true)' | tee $@.tmp
@echo $(foreach v,$(CACHED_VARS),$v = $(value $(v)) EOL) | \
$(SED) 's/\s\+EOL/\n/g;' | \
$(SED) 's/\s*\(\S\+\)\s*=\s*\(.*\)\s*/ifndef \1\n \1 = \2\nendif\n/g;' | \
$(SED) 's|$(realpath $(TOPDIR))|$$(TOPDIR)|g' | \
$(SED) 's|$(realpath $(PROJECTS_DIR))|$$(PROJECTS_DIR)|g' | \
$(GREP) . | \
tee $@.tmp
tee -a $@.tmp
@echo 'endif # ifneq ($$(JW_PKG_NO_CACHE),true)' | tee -a $@.tmp
mv $@.tmp $@