cache.mk: Include from topdir.mk, not make.mk
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>
This commit is contained in:
parent
193c2ee0bd
commit
d90c0ebf18
9 changed files with 46 additions and 34 deletions
|
|
@ -3,6 +3,16 @@
|
|||
ifndef PLATFORM_MK_INCLUDED
|
||||
PLATFORM_MK_INCLUDED = true
|
||||
|
||||
CACHE_PROJECT_MK ?= $(TOPDIR)/.cache-project.mk
|
||||
CACHE_PROJECTS_MK := $(JWBDIR)/.cache-projects.mk
|
||||
JW_PKG_NO_CACHE ?= false
|
||||
|
||||
ifneq ($(filter clean distclean,$(MAKECMDGOALS)),)
|
||||
ifeq ($(TOPDIR),.)
|
||||
JW_PKG_NO_CACHE = true
|
||||
endif
|
||||
endif
|
||||
|
||||
# "-include" tries search path, we don't want that
|
||||
define try_include
|
||||
ifneq ($$(wildcard $(1)),)
|
||||
|
|
@ -10,12 +20,11 @@ define try_include
|
|||
endif
|
||||
endef
|
||||
|
||||
CACHE_PROJECTS_MK := $(JWBDIR)/cache-projects.mk
|
||||
|
||||
ifeq ($(filter clean distclean,$(MAKECMDGOALS)),)
|
||||
$(eval $(call try_include,$(TOPDIR)/make/.cache-project.mk))
|
||||
$(eval $(call try_include,$(CACHE_PROJECTS_MK)))
|
||||
ifneq ($(JW_PKG_NO_CACHE),true)
|
||||
$(eval $(call try_include,$(CACHE_PROJECT_MK)))
|
||||
$(eval $(call try_include,$(CACHE_PROJECTS_MK)))
|
||||
endif
|
||||
|
||||
$(eval $(call try_include,$(JWBDIR)/make/pre-local.mk))
|
||||
$(eval $(call try_include,$(TOPDIR)/make/pre-local.mk))
|
||||
$(eval $(call try_include,pre-local.mk))
|
||||
|
|
|
|||
Loading…
Reference in a new issue