This patch refactors one of the syntax-check rules.

2025-05-07  Bruno Haible  <br...@clisp.org>

        Tidy "make sc_prohibit_AC_LIBOBJ_in_m4" check.
        * Makefile (sc_prohibit_AC_LIBOBJ_in_m4): Don't hide the rule commands.
        (allow_AC_LIBOBJ): Remove exceptions that are no longer needed.

diff --git a/Makefile b/Makefile
index daaffc2f68..a725c5349e 100644
--- a/Makefile
+++ b/Makefile
@@ -80,22 +80,24 @@ sc_maint:
                -f cfg.mk -f maint.mk syntax-check
        rm -f maint.mk
 
-# Files in m4/ that (exceptionally) may use AC_LIBOBJ.
-# Do not include their ".m4" suffix.
+sc_prohibit_AC_LIBOBJ_in_m4:
+       url=https://lists.gnu.org/r/bug-gnulib/2011-06/msg00051.html; \
+       if test -d .git; then                                           \
+         git ls-files m4                                               \
+            | grep -Ev '^m4/($(allow_AC_LIBOBJ_or))\.m4$$'             \
+            | xargs grep '^ *AC_LIBOBJ('                               \
+           && { printf '%s\n' 'Do not use AC_LIBOBJ in m4/*.m4;'       \
+                "see <$$url>"; exit 1; } || :;                         \
+       else :; fi
+allow_AC_LIBOBJ_or = $(shell echo $(allow_AC_LIBOBJ) | tr -s ' ' '|')
+# Files in m4/ that (exceptionally) may use AC_LIBOBJ, without their ".m4"
+# suffix.
 allow_AC_LIBOBJ =      \
-  close                        \
   dprintf              \
-  dup2                 \
-  faccessat            \
-  fchdir               \
-  fclose               \
-  fcntl                        \
   fprintf-posix                \
-  open                 \
   printf-posix         \
   snprintf             \
   sprintf-posix                \
-  stdio_h              \
   termcap              \
   terminfo             \
   vasnprintf           \
@@ -106,18 +108,6 @@ allow_AC_LIBOBJ =  \
   vsnprintf            \
   vsprintf-posix
 
-allow_AC_LIBOBJ_or := $(shell echo $(allow_AC_LIBOBJ) | tr -s ' ' '|')
-
-sc_prohibit_AC_LIBOBJ_in_m4:
-       @url=https://lists.gnu.org/r/bug-gnulib/2011-06/msg00051.html; \
-       if test -d .git; then                                           \
-         git ls-files m4                                               \
-            | grep -Ev '^m4/($(allow_AC_LIBOBJ_or))\.m4$$'             \
-            | xargs grep '^ *AC_LIBOBJ('                               \
-           && { printf '%s\n' 'Do not use AC_LIBOBJ in m4/*.m4;'       \
-                "see <$$url>"; exit 1; } || :;                         \
-       else :; fi
-
 sc_pragma_columns:
        if test -d .git; then                                           \
          git ls-files|grep '\.in\.h$$'                                 \




Reply via email to