[continued from previous message]
scripts/mk/buildapi.mk | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/scripts/mk/buildapi.mk b/scripts/mk/buildapi.mk
index ba6b43543..1462866c7 100644
--- a/scripts/mk/buildapi.mk
+++ b/scripts/mk/buildapi.mk
@@ -4,7 +4,13 @@ ifndef dpkg_buildapi.mk_included
dpkg_buildapi.mk_included :=
# Default API level when not set.
-DPKG_BUILD_API ?= $(shell dpkg-buildapi)
+ifndef DPKG_BUILD_API
+ # Run dpkg-buildapi if the variable is actually expanded,
+ # but then replace the recursive definition with a non-recursive one
+ # (and of course return the asked value).
+ DPKG_BUILD_API = \
+ $$(eval DPKG_BUILD_API := $$(shell dpkg-buildapi))$$(DPKG_BUILD_API) +endif
# We could use only built-in GNU make functions, but that seems too much
# complexity given no integer operators, given that we currently have to
--
2.39.2
From e1ea3f3e5752f304b36140019293092b0564b771 Mon Sep 17 00:00:00 2001
From: Nicolas Boulenguez <
nicolas@debian.org>
Date: Sun, 13 Feb 2022 13:41:26 +0100
Subject: [PATCH 8/8] scripts/mk: improve details in documentation
architecture.mk: give more details
Mention default.mk as an alternative in included scripts.