2019-03-03 18:12:28 +00:00
|
|
|
TOPDIR = ..
|
|
|
|
|
CACHED_FILES := defs.mk projects.mk platform.mk Makefile
|
2026-02-01 09:50:49 +01:00
|
|
|
MKFILES += $(CACHE_PROJECTS_MK)
|
2019-02-28 13:22:12 +00:00
|
|
|
|
2006-08-16 14:53:49 +00:00
|
|
|
include $(TOPDIR)/make/proj.mk
|
2019-06-29 21:34:18 +00:00
|
|
|
include $(JWBDIR)/make/make.mk
|
2026-01-22 14:19:46 +01:00
|
|
|
|
2011-02-20 14:15:22 +00:00
|
|
|
ifneq ($(MAKECMDGOALS),install-links)
|
2019-02-28 13:22:12 +00:00
|
|
|
ifneq ($(MAKECMDGOALS),do-install-links)
|
2019-06-29 21:34:18 +00:00
|
|
|
include $(JWBDIR)/make/dirs.mk
|
2019-02-28 13:22:12 +00:00
|
|
|
endif
|
2011-02-20 14:15:22 +00:00
|
|
|
endif
|
2009-08-10 08:47:10 +00:00
|
|
|
|
2019-06-29 21:34:18 +00:00
|
|
|
include $(JWBDIR)/make/dev-utils.mk
|
2019-02-28 13:22:12 +00:00
|
|
|
|
make/[Makefile|*.mk): Improve variable caching
This commit aims at improving speed by using better caching.
- Makefile, cache.mk: Split .cache.mk up
To allow caching of runtime path variables which are
project-specific, split .cache.mk up in .cache-project.mk and
.cache-projects.mk
- ldlibpath.mk: Cache ldlibpath, exepath and pythonpath
Place the output of $(call proj_query ldlibpath), $(call
proj_query, exepath) and $(call proj_query pythonpath) in
JW_PKG_LD_LIBRARY_PATH, JW_PKG_EXE_PATH, and JW_PKG_PYTHON_PATH
respectively, and cache the variables in make/.project-cache.mk.
- cache.mk: Use = instead of :=
Recursively expanded variables are nearly as fast as := variables
if the assigned value is a fixed string. And sometimes it's not,
rightly so, because variables get assigned below, as with
JW_PKG_XXX for instance.
- cache.mk: Use $(TOPDIR) as variable values
Replace absolute references to project's topdir by $(TOPDIR) with
sed. As soon as the project queries produce absolute paths, they
will be transformed into relative paths which allow the code base
to be moved to a different location and still remain functional
without a rebuild.
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-22 14:12:58 +01:00
|
|
|
all: cache-projects
|
|
|
|
|
clean: clean-cache-projects
|
2018-11-27 15:10:18 +00:00
|
|
|
|
2009-08-10 08:47:10 +00:00
|
|
|
ifeq ($(TARGET),mingw)
|
|
|
|
|
install: $(INSTALL_MAKEDIR)/winres.rc.tmpl
|
|
|
|
|
endif
|
|
|
|
|
|
2019-02-28 13:22:12 +00:00
|
|
|
grep-vars:
|
2026-01-25 17:34:53 +01:00
|
|
|
$(Q)sed '/^ *[A-Z]/!d; s/^[ ]*//g; s/[=+?:].*//g; s/[ ]*//g' *.mk | sort -u
|
2026-02-01 09:50:49 +01:00
|
|
|
|
|
|
|
|
cache-projects: $(CACHE_PROJECTS_MK)
|
|
|
|
|
clean-cache-projects:
|
|
|
|
|
rm -f $(CACHE_PROJECTS_MK)
|
|
|
|
|
$(CACHE_PROJECTS_MK): $(CACHE_PROJECT_MK)
|
|
|
|
|
sed '/\($(subst $(space),\|,$(CACHED_VARS_ONLY_PROJECT))\)\s*[:?]\?=/ d' $< > $@.tmp
|
|
|
|
|
mv $@.tmp $@
|