Improve Makefile variable caching: PREREQ, JW_PKG_NO_CACHE, subsections #28
4 changed files with 19 additions and 10 deletions
topdir.mk: Move PREREQ definition into defs.mk
At present, the PREREQ-variable is effectively only used to detect if prerequiste packages haven't run "make all" before make is run in a given package. Also, it's only useful in $(TOPDIR). This commit splits the variable up into PREREQ_BUILD and PREREQ_RUN, and makes the variables available in every Makefile of a package by placing them in defs.mk instead of topdir.mk.
This also fixes a problem that PREREQ was cached before being filled, hence empty. Which effectively wasn't much of a problem, because it was basically unused, but still.
Signed-off-by: Jan Lindemann <jan@janware.com>
commit
10bde0c05d
|
|
@ -6,6 +6,8 @@
|
|||
CACHE_PROJECT_MK ?= .cache-project.mk
|
||||
CACHED_VARS_ONLY_PROJECT ?= \
|
||||
PROJECT \
|
||||
PREREQ_BUILD \
|
||||
PREREQ_RUN \
|
||||
PREREQ \
|
||||
VERSION \
|
||||
HEX_VERSION \
|
||||
|
|
|
|||
12
make/defs.mk
12
make/defs.mk
|
|
@ -503,6 +503,18 @@ endif
|
|||
INSTALL_FILE ?= $(INSTALL)
|
||||
INSTALL_DIR ?= $(INSTALL)
|
||||
|
||||
ifeq ($(origin PREREQ_BUILD),undefined)
|
||||
PREREQ_BUILD := $(call proj_query, pkg-requires --no-subpackages --subsections=jw --syntax names-only --delimiter ' ' 'build devel' $(PROJECT))
|
||||
endif
|
||||
|
||||
ifeq ($(origin PREREQ_RUN),undefined)
|
||||
PREREQ_RUN := $(call proj_query, pkg-requires --no-subpackages --subsections=jw --syntax names-only --delimiter ' ' 'run' $(PROJECT))
|
||||
endif
|
||||
|
||||
ifeq ($(origin PREREQ),undefined)
|
||||
PREREQ := $(sort $(PREREQ_BUILD) $(PREREQ_RUN))
|
||||
endif
|
||||
|
||||
# ----- local.mk
|
||||
|
||||
$(eval $(call try_include,$(JWBDIR)/make/local.mk))
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ include $(JWBDIR)/make/defs-dirs.mk
|
|||
include $(JWBDIR)/make/dev-utils.mk
|
||||
|
||||
CACHED_FILES ?= $(VERSION_FILE) $(wildcard $(TOPDIR)/make/project.conf)
|
||||
CACHED_VARS ?= PROJECT PREREQ VERSION HEX_VERSION FULL_NAME \
|
||||
WHICH PYTHON ECHO TEST BROWSER SED RM PWD ID CUT TR \
|
||||
CACHED_VARS ?= PROJECT PREREQ_BUILD PREREQ_RUN PREREQ VERSION HEX_VERSION \
|
||||
FULL_NAME WHICH PYTHON ECHO TEST BROWSER SED RM PWD ID CUT TR \
|
||||
AWK GETENT XARGS FIND PRINTF PLATFORM_INFO OS_NAME_VERSION \
|
||||
CAT BIN_INSTALL SUDO \
|
||||
JW_PKG_LD_LIBRARY_PATH JW_PKG_EXE_PATH JW_PKG_PYTHON_PATH
|
||||
|
|
|
|||
|
|
@ -80,23 +80,18 @@ REMOTE_GIT_DIR = /$(JANWARE_USER)/$(REMOTE_GIT_FLAVOUR)/$(PROJECT)
|
|||
REMOTE_GIT_URL = ssh://$(JANWARE_USER_PREFIX)devgit.janware.com$(REMOTE_GIT_DIR)
|
||||
|
||||
ifneq ($(DONT_CHECK_PREREQ_DONE),true)
|
||||
ifndef PREREQ
|
||||
PREREQ := $(call proj_query,pkg-requires --no-subpackages --subsections=jw --syntax names-only --delimiter=' ' build $(PROJECT))
|
||||
ifndef PREREQ_DIRS_BUILD
|
||||
PREREQ_DIRS_BUILD := $(call proj_query,proj-dir $(PREREQ_BUILD))
|
||||
endif
|
||||
ifndef PREREQ_DIRS
|
||||
PREREQ_DIRS := $(call proj_query,proj-dir $(PREREQ))
|
||||
endif
|
||||
PREREQ_DIRS_DONE := $(addsuffix /dirs-all.done,$(filter-out $(TOPDIR) /opt/%,$(PREREQ_DIRS)))
|
||||
PREREQ_DIRS_BUILD_DONE := $(addsuffix /dirs-all.done,$(filter-out $(TOPDIR) /opt/%,$(PREREQ_DIRS_BUILD)))
|
||||
endif
|
||||
|
||||
ifneq ($(SUBDIRS_TO_ITERATE),)
|
||||
|
||||
ifeq ($(MAKECMDGOALS),)
|
||||
SUBDIR_TARGETS = all
|
||||
else
|
||||
SUBDIR_TARGETS = $(filter $(ALLOWED_SUBDIR_TARGETS),$(MAKECMDGOALS))
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
all: topdir config
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue