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>
This commit is contained in:
Jan Lindemann 2026-06-17 14:08:58 +02:00
commit 10bde0c05d
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61
4 changed files with 19 additions and 10 deletions

View file

@ -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))