Further improve build time: Try to avoid calling projects.py

This commit tries to remove the necessity to call projects.py from $(TOPDIR) to
speed up recursive builds over all projects yet again. This is a major
undertaking. There are two variables which are filled py projects.py in
$(TOPDIR): PREREQ and PREREQ_DIRS. Sadly, the latter is a path relative to
$(TOPDIR)/make, so this is kind of pointless. Unless the cache is maintained in
$(TOPDIR), a thing I tried to avoid. So this commit is only able to cache
$(PREREQ), not $(PREREQ_DIRS), which still is a hassle. Introduced defs-dirs.mk
for that, to make it accessible to make.mk, and modified all the other parts of
the machinery, too.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2019-02-28 14:48:57 +00:00
commit 3dd55cf067
5 changed files with 49 additions and 30 deletions

View file

@ -3,10 +3,6 @@
# contact@jannet.de
# $Id$
ALLOWED_SUBDIR_TARGETS ?= all install clean distclean test link-in
reverse = $(if $(wordlist 2,2,$(1)),$(call reverse,$(wordlist 2,$(words $(1)),$(1))) $(firstword $(1)),$(1))
.NOTPARALLEL:
.PHONY: $(SUBDIRS_TO_ITERATE) $(ALLOWED_SUBDIR_TARGETS)
@ -15,10 +11,7 @@ ifneq ($(FORCE_REBUILD_SUBDIRS),)
endif
include $(MODDIR)/make/defs.mk
SUBDIRS ?= $(ORDERED_SUBDIRS) $(filter-out $(ORDERED_SUBDIRS),$(FIND_SUBDIRS))
#SUBDIRS ?= $(filter-out $(ORDERED_SUBDIRS),$(FIND_SUBDIRS))
#SUBDIRS ?= $(FIND_SUBDIRS)
include $(MODDIR)/make/defs-dirs.mk
ifeq ($(SUBDIRS_TO_ITERATE),)
@ -26,18 +19,6 @@ $(ALLOWED_SUBDIR_TARGETS):
else
ifeq ($(MAKECMDGOALS),)
SUBDIR_TARGETS = all
else
SUBDIR_TARGETS = $(filter $(ALLOWED_SUBDIR_TARGETS),$(MAKECMDGOALS))
endif
ifneq ($(DONT_CHECK_PREREQ_DONE),true)
PREREQ := $(call proj_query,pkg-requires --no-version --no-subpackages --subsections=jw --delimiter=' ' build $(PROJECT))
PREREQ_DIRS := $(call proj_query,proj-dir $(PREREQ))
PREREQ_DIRS_DONE := $(addsuffix /dirs-all.done,$(filter-out $(TOPDIR) /opt/%,$(PREREQ_DIRS)))
endif
all: dirs-all.done
install: dirs-install.done
clean: dirs.clean