jw-pkg/make/cache.mk
Jan Lindemann 741a3b6db2 make: Install cache-projects.mk
.cache-projects.mk is not installed / packaged, which makes builds
against an installed jw-pkg considerably slower. Change that, at the
risk of making the installed jw-pkg-devel less versatile. This commit
installs a cache file cache-projects.mk, renamed from
.cache-projects.mk, because there's no justification for hiding an
installed makefile. At least I can't think of one.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-01 09:50:52 +01:00

29 lines
762 B
Makefile

# ----- define these variables
# CACHED_FILES = $(TOPDIR)/VERSION
# CACHED_VARS = VERSION
.PHONY: cache clean-cache clean-cache-projects
CACHE_PROJECT_MK ?= .cache-project.mk
CACHED_VARS_ONLY_PROJECT ?= \
PROJECT \
PREREQ \
VERSION \
HEX_VERSION \
FULL_NAME \
JW_PKG_LD_LIBRARY_PATH \
JW_PKG_EXE_PATH \
JW_PKG_PYTHON_PATH
all: cache
clean: clean-cache
clean-cache:
rm -f $(CACHE_PROJECT_MK)
cache: $(CACHE_PROJECT_MK)
$(CACHE_PROJECT_MK): $(CACHED_FILES) $(JWBDIR)/make/cache.mk
@echo $(foreach v,$(CACHED_VARS),$v = $(value $(v))EOL) | \
$(SED) 's/EOL */\n/g;' | \
$(SED) 's|$(realpath $(TOPDIR))|$$(TOPDIR)|g' | \
$(SED) 's|$(realpath $(PROJECTS_DIR))|$$(PROJECTS_DIR)|g' | \
$(GREP) . | \
tee $@.tmp
mv $@.tmp $@