[openwrt/openwrt] tools: automake: fix MAINTAINERCLEANFILES warnings

LEDE Commits lede-commits at lists.infradead.org
Tue Jul 29 12:31:15 PDT 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/dddf7b05cded37514be383fc3119b7277d410a33

commit dddf7b05cded37514be383fc3119b7277d410a33
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Tue Jul 29 13:56:10 2025 -0400

    tools: automake: fix MAINTAINERCLEANFILES warnings
    
    It seems that, for whatever reason in this case,
    the function "vardef ($var, $cond)" does not work
    while "$var->def ($cond)" does work for conditionals.
    
    Also, do not define it conditionally when defined unconditionally.
    Even though the reordering patch would make that functionally sound,
    it still throws a warning which can cause a build to fail
    when warnings are treated as errors.
    
    Instead, just add BUILT_SOURCES to every existing case
    rather than only when BUILT_SOURCES is defined.
    
    Fixes: 6d2bfe50d3 ("tools/automake: control all cleaning with clean variables")
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
    Link: https://github.com/openwrt/openwrt/pull/19593
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 tools/automake/patches/310-maintainer-clean-built_sources.patch | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/automake/patches/310-maintainer-clean-built_sources.patch b/tools/automake/patches/310-maintainer-clean-built_sources.patch
index 679236bda0..5166c630da 100644
--- a/tools/automake/patches/310-maintainer-clean-built_sources.patch
+++ b/tools/automake/patches/310-maintainer-clean-built_sources.patch
@@ -21,7 +21,7 @@
 +      if (! grep { $_ eq '$(BUILT_SOURCES)' } $mcleanvar->value_as_list ($rcond)) {
 +	Automake::Variable::define ($mcleanvar->name, VAR_MAKEFILE, '+', $rcond,
 +				    '$(BUILT_SOURCES)', '', INTERNAL, VAR_ASIS)
-+	  if vardef ('BUILT_SOURCES', $rcond);
++	  if var ('BUILT_SOURCES');
 +      }
 +    }
 +    my $bsources = var ('BUILT_SOURCES');
@@ -30,9 +30,9 @@
 +      {
 +	Automake::Variable::define ($mcleanvar->name, VAR_MAKEFILE, '', $rcond,
 +				    '$(BUILT_SOURCES)', '', INTERNAL, VAR_ASIS)
-+	  if ! vardef ($mcleanvar, $rcond);
++	  if ! ($mcleanvar->def ($rcond) || $mcleanvar->def (TRUE));
 +      }
-+      if (! vardef ($mcleanvar, TRUE)) {
++      if (! $mcleanvar->def (TRUE)) {
 +	Automake::Variable::define ($mcleanvar->name, VAR_MAKEFILE, '', TRUE,
 +				    '$(BUILT_SOURCES)', '', INTERNAL, VAR_ASIS);
 +      }




More information about the lede-commits mailing list