maintcheck: fixup list of files in $(xdefs)
[platform/upstream/automake.git] / syntax-checks.mk
1 # Maintainer checks for Automake.  Requires GNU make.
2
3 # Copyright (C) 2012 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18 # We also have to take into account VPATH builds (where some generated
19 # tests might be in '$(builddir)' rather than in '$(srcdir)'), TAP-based
20 # tests script (which have a '.tap' extension) and helper scripts used
21 # by other test cases (which have a '.sh' extension).
22 xtests := $(shell \
23   if test $(srcdir) = .; then \
24      dirs=.; \
25    else \
26      dirs='$(srcdir) .'; \
27    fi; \
28    for d in $$dirs; do \
29      for s in tap sh; do \
30        ls $$d/t/*.$$s $$d/t/ax/*.$$s 2>/dev/null; \
31      done; \
32    done | sort)
33
34 xdefs = \
35   $(srcdir)/t/ax/am-test-lib.sh \
36   $(srcdir)/t/ax/test-lib.sh \
37   $(srcdir)/t/ax/test-defs.in \
38   $(srcdir)/defs
39
40 ams := $(shell find $(srcdir) -name '*.dir' -prune -o -name '*.am' -print)
41
42 # Some simple checks, and then ordinary check.  These are only really
43 # guaranteed to work on my machine.
44 syntax_check_rules = \
45 $(sc_tests_plain_check_rules) \
46 sc_test_names \
47 sc_diff_automake_in_automake \
48 sc_diff_aclocal_in_automake \
49 sc_perl_syntax \
50 sc_no_brace_variable_expansions \
51 sc_rm_minus_f \
52 sc_no_for_variable_in_macro \
53 sc_mkinstalldirs \
54 sc_pre_normal_post_install_uninstall \
55 sc_perl_no_undef \
56 sc_perl_no_split_regex_space \
57 sc_cd_in_backquotes \
58 sc_cd_relative_dir \
59 sc_perl_at_uscore_in_scalar_context \
60 sc_perl_local \
61 sc_AMDEP_TRUE_in_automake_in \
62 sc_tests_make_without_am_makeflags \
63 sc_tests_obsolete_variables \
64 sc_tests_here_document_format \
65 sc_tests_command_subst \
66 sc_tests_Exit_not_exit \
67 sc_tests_automake_fails \
68 sc_tests_required_after_defs \
69 sc_tests_overriding_macros_on_cmdline \
70 sc_tests_plain_sleep \
71 sc_tests_ls_t \
72 sc_tests_executable \
73 sc_m4_am_plain_egrep_fgrep \
74 sc_tests_no_configure_in \
75 sc_tests_PATH_SEPARATOR \
76 sc_tests_logs_duplicate_prefixes \
77 sc_tests_makefile_variable_order \
78 sc_perl_at_substs \
79 sc_unquoted_DESTDIR \
80 sc_tabs_in_texi \
81 sc_at_in_texi
82
83 ## Look for test whose names can cause spurious failures when used as
84 ## first argument to AC_INIT (chiefly because they might contain an
85 ## m4/m4sugar builtin or macro name).
86 m4_builtins = \
87   __gnu__ \
88   __unix__ \
89   bpatsubst \
90   bregexp \
91   builtin \
92   changecom \
93   changequote \
94   changeword \
95   debugfile \
96   debugmode \
97   decr \
98   define \
99   defn \
100   divert \
101   divnum \
102   dnl \
103   dumpdef \
104   errprint \
105   esyscmd \
106   eval \
107   format \
108   ifdef \
109   ifelse \
110   include \
111   incr \
112   index \
113   indir \
114   len \
115   m4exit \
116   m4wrap \
117   maketemp \
118   mkstemp \
119   patsubst \
120   popdef \
121   pushdef \
122   regexp \
123   shift \
124   sinclude \
125   substr \
126   symbols \
127   syscmd \
128   sysval \
129   traceoff \
130   traceon \
131   translit \
132   undefine \
133   undivert
134 sc_test_names:
135         @m4_builtin_rx=`echo $(m4_builtins) | sed 's/ /|/g'`; \
136          m4_macro_rx="\\<($$m4_builtin_rx)\\>|\\<_?(A[CUMHS]|m4)_"; \
137          if { \
138            for t in $(xtests); do echo $$t; done \
139              | LC_ALL=C grep -E "$$m4_macro_rx"; \
140          }; then \
141            echo "the names of the tests above can be problematic" 1>&2; \
142            echo "Avoid test names that contain names of m4 macros" 1>&2; \
143            exit 1; \
144          fi
145
146 ## These check avoids accidental configure substitutions in the source.
147 ## There are exactly 9 lines that should be modified from automake.in to
148 ## automake, and 10 lines that should be modified from aclocal.in to
149 ## aclocal; these wors out to 32 and 34 lines of diffs, respectively.
150 sc_diff_automake_in_automake:
151         @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 32; then \
152           echo "found too many diffs between automake.in and automake" 1>&2; \
153           diff -c $(srcdir)/automake.in automake; \
154           exit 1; \
155         fi
156 sc_diff_aclocal_in_aclocal:
157         @if test `diff $(srcdir)/aclocal.in aclocal | wc -l` -ne 34; then \
158           echo "found too many diffs between aclocal.in and aclocal" 1>&2; \
159           diff -c $(srcdir)/aclocal.in aclocal; \
160           exit 1; \
161         fi
162
163 ## Syntax check with default Perl (on my machine, Perl 5).
164 sc_perl_syntax:
165         @perllibdir="./lib$(PATH_SEPARATOR)$(srcdir)/lib" $(PERL) -c -w automake
166         @perllibdir="./lib$(PATH_SEPARATOR)$(srcdir)/lib" $(PERL) -c -w aclocal
167
168 ## Expect no instances of '${...}'.  However, $${...} is ok, since that
169 ## is a shell construct, not a Makefile construct.
170 sc_no_brace_variable_expansions:
171         @if grep -v '^ *#' $(ams) | grep -F '$${' | grep -F -v '$$$$'; then \
172           echo "Found too many uses of '\$${' in the lines above." 1>&2; \
173           exit 1;                               \
174         else :; fi
175
176 ## Make sure 'rm' is called with '-f'.
177 sc_rm_minus_f:
178         @if grep -v '^#' $(ams) $(xtests) \
179            | grep -vE '/(spy-rm\.tap|subobj-clean.*-pr10697\.sh):' \
180            | grep -E '\<rm ([^-]|\-[^f ]*\>)'; \
181         then \
182           echo "Suspicious 'rm' invocation." 1>&2; \
183           exit 1;                               \
184         else :; fi
185
186 ## Never use something like "for file in $(FILES)", this doesn't work
187 ## if FILES is empty or if it contains shell meta characters (e.g. $ is
188 ## commonly used in Java filenames).
189 sc_no_for_variable_in_macro:
190         @if grep 'for .* in \$$(' $(ams) | grep -v '/Makefile\.am:'; then \
191           echo 'Use "list=$$(mumble); for var in $$$$list".' 1>&2 ; \
192           exit 1; \
193         else :; fi
194
195 ## Make sure all invocations of mkinstalldirs are correct.
196 sc_mkinstalldirs:
197         @if grep -n 'mkinstalldirs' $(ams) \
198               | grep -F -v '$$(mkinstalldirs)' \
199               | grep -v '^\./Makefile.am:[0-9][0-9]*:  *lib/mkinstalldirs \\$$'; \
200         then \
201           echo "Found incorrect use of mkinstalldirs in the lines above" 1>&2; \
202           exit 1; \
203         else :; fi
204
205 ## Make sure all calls to PRE/NORMAL/POST_INSTALL/UNINSTALL
206 sc_pre_normal_post_install_uninstall:
207         @if grep -E -n '\((PRE|NORMAL|POST)_(|UN)INSTALL\)' $(ams) | \
208               grep -v ':##' | grep -v ':        @\$$('; then \
209           echo "Found incorrect use of PRE/NORMAL/POST_INSTALL/UNINSTALL in the lines above" 1>&2; \
210           exit 1; \
211         else :; fi
212
213 ## We never want to use "undef", only "delete", but for $/.
214 sc_perl_no_undef:
215         @if grep -n -w 'undef ' $(srcdir)/automake.in | \
216               grep -F -v 'undef $$/'; then \
217           echo "Found undef in automake.in; use delete instead" 1>&2; \
218           exit 1; \
219         fi
220
221 ## We never want split (/ /,...), only split (' ', ...).
222 sc_perl_no_split_regex_space:
223         @if grep -n 'split (/ /' $(srcdir)/automake.in; then \
224           echo "Found bad split in the lines above." 1>&2; \
225           exit 1; \
226         fi
227
228 ## Look for cd within backquotes
229 sc_cd_in_backquotes:
230         @if grep -n '^[^#]*` *cd ' $(srcdir)/automake.in $(ams); then \
231           echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
232           exit 1; \
233         fi
234
235 ## Look for cd to a relative directory (may be influenced by CDPATH).
236 ## Skip some known directories that are OK.
237 sc_cd_relative_dir:
238         @if grep -n '^[^#]*cd ' $(srcdir)/automake.in $(ams) | \
239               grep -v 'echo.*cd ' | \
240               grep -v 'am__cd =' | \
241               grep -v '^[^#]*cd [./]' | \
242               grep -v '^[^#]*cd \$$(top_builddir)' | \
243               grep -v '^[^#]*cd "\$$\$$am__cwd' | \
244               grep -v '^[^#]*cd \$$(abs' | \
245               grep -v '^[^#]*cd "\$$(DESTDIR)'; then \
246           echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
247           exit 1; \
248         fi
249
250 ## Using @_ in a scalar context is most probably a programming error.
251 sc_perl_at_uscore_in_scalar_context:
252         @if grep -Hn '[^@_A-Za-z0-9][_A-Za-z0-9]*[^) ] *= *@_' $(srcdir)/automake.in; then \
253           echo "Using @_ in a scalar context in the lines above." 1>&2; \
254           exit 1; \
255         fi
256
257 ## Allow only few variables to be localized in Automake.
258 sc_perl_local:
259         @if egrep -v '^[ \t]*local \$$[_~]( *=|;)' $(srcdir)/automake.in | \
260                 grep '^[ \t]*local [^*]'; then \
261           echo "Please avoid 'local'." 1>&2; \
262           exit 1; \
263         fi
264
265 ## Don't let AMDEP_TRUE substitution appear in automake.in.
266 sc_AMDEP_TRUE_in_automake_in:
267         @if grep '@AMDEP''_TRUE@' $(srcdir)/automake.in; then \
268           echo "Don't put AMDEP_TRUE substitution in automake.in" 1>&2; \
269           exit 1; \
270         fi
271
272 ## Recursive make invocations should always pass $(AM_MAKEFLAGS)
273 ## to $(MAKE), for portability to non-GNU make.
274 sc_tests_make_without_am_makeflags:
275         @if grep '^[^#].*(MAKE) ' $(ams) $(srcdir)/automake.in \
276             | grep -v 'AM_MAKEFLAGS' \
277             | grep -v '/am/header-vars\.am:.*am--echo.*| $$(MAKE) -f *-'; \
278         then \
279           echo 'Use $$(MAKE) $$(AM_MAKEFLAGS).' 1>&2; \
280           exit 1; \
281         fi
282
283 ## Look out for some obsolete variables.
284 sc_tests_obsolete_variables:
285         @vars=" \
286           using_tap \
287           am_using_tap \
288           test_prefer_config_shell \
289           original_AUTOMAKE \
290           original_ACLOCAL \
291           parallel_tests \
292           am_parallel_tests \
293         "; \
294         seen=""; \
295         for v in $$vars; do \
296           if grep -E "\b$$v\b" $(xtests) $(xdefs); then \
297             seen="$$seen $$v"; \
298           fi; \
299         done; \
300         if test -n "$$seen"; then \
301           for v in $$seen; do \
302             case $$v in \
303               parallel_tests|am_parallel_tests) v2=am_serial_tests;; \
304               *) v2=am_$$v;; \
305             esac; \
306             echo "Variable '$$v' is obsolete, use '$$v2' instead." 1>&2; \
307           done; \
308           exit 1; \
309         else :; fi
310
311 ## Tests should never call some programs directly, but only through the
312 ## corresponding variable (e.g., '$MAKE', not 'make').  This will allow
313 ## the programs to be overridden at configure time (for less brittleness)
314 ## or by the user at make time (to allow better testsuite coverage).
315 sc_tests_plain_check_rules = \
316   sc_tests_plain_egrep \
317   sc_tests_plain_fgrep \
318   sc_tests_plain_make \
319   sc_tests_plain_perl \
320   sc_tests_plain_automake \
321   sc_tests_plain_aclocal \
322   sc_tests_plain_autoconf \
323   sc_tests_plain_autoupdate \
324   sc_tests_plain_autom4te \
325   sc_tests_plain_autoheader \
326   sc_tests_plain_autoreconf
327
328 toupper = $(shell echo $(1) | LC_ALL=C tr '[a-z]' '[A-Z]')
329
330 $(sc_tests_plain_check_rules): sc_tests_plain_% :
331         @# The leading ':' in the grep below is what is printed by the
332         @# preceding 'grep -v' after the file name.
333         @# It works here as a poor man's substitute for beginning-of-line
334         @# marker.
335         @if grep -v '^[         ]*#' $(xtests) \
336            | $(EGREP) '(:|\bif|\bnot|[;!{\|\(]|&&|\|\|)[        ]*?$*\b'; \
337          then \
338            echo 'Do not run "$*" in the above tests.' \
339                 'Use "$$$(call toupper,$*)" instead.' 1>&2; \
340            exit 1; \
341         fi
342
343 ## Tests should only use END and EOF for here documents
344 ## (so that the next test is effective).
345 sc_tests_here_document_format:
346         @if grep '<<' $(xtests) | grep -Ev '\b(END|EOF)\b|\bcout <<'; then \
347           echo 'Use here documents with "END" and "EOF" only, for greppability.' 1>&2; \
348           exit 1; \
349         fi
350
351 ## Our test case should use the $(...) POSIX form for command substitution,
352 ## rather than the older `...` form.
353 ## The point of ignoring text on here-documents is that we want to exempt
354 ## Makefile.am rules, configure.ac code and helper shell script created and
355 ## used by out shell scripts, because Autoconf (as of version 2.69) does not
356 ## yet ensure that $CONFIG_SHELL will be set to a proper POSIX shell.
357 sc_tests_command_subst:
358         @found=false; \
359         scan () { \
360           sed -n -e '/^#/d' \
361                  -e '/<<.*END/,/^END/b' -e '/<<.*EOF/,/^EOF/b' \
362                  -e 's/\\`/\\{backtick}/' \
363                  -e "s/[^\\]'\([^']*\`[^']*\)*'/'{quoted-text}'/g" \
364                  -e '/`/p' $$*; \
365         }; \
366         for file in $(xtests); do \
367           res=`scan $$file`; \
368           if test -n "$$res"; then \
369             echo "$$file:$$res"; \
370             found=true; \
371           fi; \
372         done; \
373         if $$found; then \
374           echo 'Use $$(...), not `...`, for command substitutions.' >&2; \
375           exit 1; \
376         fi
377
378 ## Tests should no more call 'Exit', just 'exit'.  That's because we
379 ## now have in place a better workaround to ensure the exit status is
380 ## transported correctly across the exit trap.
381 sc_tests_Exit_not_exit:
382         @if grep 'Exit' $(xtests) $(xdefs) | grep -Ev '^[^:]+: *#' | grep .; then \
383           echo "Use 'exit', not 'Exit'; it's obsolete now." 1>&2; \
384           exit 1; \
385         fi
386
387 ## Use AUTOMAKE_fails when appropriate
388 sc_tests_automake_fails:
389         @if grep -v '^#' $(xtests) | grep '\$$AUTOMAKE.*&&.*exit'; then \
390           echo 'Use AUTOMAKE_fails + grep to catch automake failures in the above tests.' 1>&2;  \
391           exit 1; \
392         fi
393
394 ## Setting 'required' after sourcing './defs' is a bug.
395 sc_tests_required_after_defs:
396         @for file in $(xtests); do \
397           if out=`sed -n '/defs/,$${/required=/p;}' $$file`; test -n "$$out"; then \
398             echo 'Do not set "required" after sourcing "defs" in '"$$file: $$out" 1>&2; \
399             exit 1; \
400           fi; \
401         done
402
403 ## Overriding a Makefile macro on the command line is not portable when
404 ## recursive targets are used.  Better use an envvar.  SHELL is an
405 ## exception, POSIX says it can't come from the environment.  V, DESTDIR,
406 ## DISTCHECK_CONFIGURE_FLAGS and DISABLE_HARD_ERRORS are exceptions, too,
407 ## as package authors are urged not to initialize them anywhere.
408 ## Finally, 'exp' is used by some ad-hoc checks, where we ensure it's
409 ## ok to override it from the command line.
410 sc_tests_overriding_macros_on_cmdline:
411         @if grep -E '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(xtests); then \
412           echo 'Rewrite "$$MAKE foo=bar SHELL=$$SHELL" as "foo=bar $$MAKE -e SHELL=$$SHELL"' 1>&2; \
413           echo ' in the above lines, it is more portable.' 1>&2; \
414           exit 1; \
415         fi
416 # The first s/// tries to account for usages like "$MAKE || st=$?".
417 # 'DISTCHECK_CONFIGURE_FLAGS' and 'exp' are allowed to contain whitespace in
418 # their definitions, hence the more complex last three substitutions below.
419 # Also, the 'make-dryrun.sh' is whitelisted, since there we need to
420 # override variables from the command line in order to cover the expected
421 # code paths.
422         @tests=`for t in $(xtests); do \
423                   case $$t in */make-dryrun.sh);; *) echo $$t;; esac; \
424                 done`; \
425         if sed -e 's/ || .*//' -e 's/ && .*//' \
426                 -e 's/ DESTDIR=[^ ]*/ /' -e 's/ SHELL=[^ ]*/ /' \
427                 -e 's/ V=[^ ]*/ /' -e 's/ DISABLE_HARD_ERRORS=[^ ]*/ /' \
428                 -e "s/ DISTCHECK_CONFIGURE_FLAGS='[^']*'/ /" \
429                 -e 's/ DISTCHECK_CONFIGURE_FLAGS="[^"]*"/ /' \
430                 -e 's/ DISTCHECK_CONFIGURE_FLAGS=[^ ]/ /' \
431                 -e "s/ exp='[^']*'/ /" \
432                 -e 's/ exp="[^"]*"/ /' \
433                 -e 's/ exp=[^ ]/ /' \
434               $$tests | grep '\$$MAKE .*='; then \
435           echo 'Rewrite "$$MAKE foo=bar" as "foo=bar $$MAKE -e" in the above lines,' 1>&2; \
436           echo 'it is more portable.' 1>&2; \
437           exit 1; \
438         fi
439         @if grep 'SHELL=.*\$$MAKE' $(xtests); then \
440           echo '$$MAKE ignores the SHELL envvar, use "$$MAKE SHELL=$$SHELL" in' 1>&2; \
441           echo 'the above lines.' 1>&2; \
442           exit 1; \
443         fi
444
445 ## Prefer use of our 'is_newest' auxiliary script over the more hacky
446 ## idiom "test $(ls -1t new old | sed 1q) = new", which is both more
447 ## cumbersome and more fragile.
448 sc_tests_ls_t:
449         @if LC_ALL=C grep -E '\bls(\s+-[a-zA-Z0-9]+)*\s+-[a-zA-Z0-9]*t' \
450             $(xtests); then \
451           echo "Use 'is_newest' rather than hacks based on 'ls -t'" 1>&2; \
452           exit 1; \
453         fi
454
455 ## Test scripts must be executable.
456 sc_tests_executable:
457         @st=0; \
458         for f in $(xtests); do \
459           case $$f in \
460             t/ax/*|./t/ax/*|$(srcdir)/t/ax/*);; \
461             *) test -x $$f || { echo "$$f: not executable" >&2; st=1; }; \
462           esac; \
463         done; \
464         test $$st -eq 0 || echo '$@: some test scripts are not executable' >&2; \
465         exit $$st;
466
467
468 ## Never use 'sleep 1' to create files with different timestamps.
469 ## Use '$sleep' instead.  Some filesystems (e.g., Windows) have only
470 ## a 2sec resolution.
471 sc_tests_plain_sleep:
472         @if grep -E '\bsleep +[12345]\b' $(xtests); then \
473           echo 'Do not use "sleep x" in the above tests.  Use "$$sleep" instead.' 1>&2; \
474           exit 1; \
475         fi
476
477 ## fgrep and egrep are not required by POSIX.
478 sc_m4_am_plain_egrep_fgrep:
479         @if grep -E '\b[ef]grep\b' $(ams) $(srcdir)/m4/*.m4; then \
480           echo 'Do not use egrep or fgrep in the above files,' \
481                'they are not portable.' 1>&2; \
482           exit 1; \
483         fi
484
485 ## Prefer 'configure.ac' over the obsolescent 'configure.in' as the name
486 ## for configure input files in our testsuite.  The latter  has been
487 ## deprecated for several years (at least since autoconf 2.50).
488 sc_tests_no_configure_in:
489         @if grep -E '\bconfigure\\*\.in\b' $(xtests) $(xdefs) \
490               | grep -Ev '/backcompat.*\.(sh|tap):' \
491               | grep -Ev '/autodist-configure-no-subdir\.sh:' \
492               | grep -Ev '/(configure|help)\.sh:' \
493               | grep .; \
494         then \
495           echo "Use 'configure.ac', not 'configure.in', as the name" >&2; \
496           echo "for configure input files in the test cases above." >&2; \
497           exit 1; \
498         fi
499
500 ## Rule to ensure that the testsuite has been run before.  We don't depend
501 ## on 'check' here, because that would be very wasteful in the common case.
502 ## We could run "make check RECHECK_LOGS=" and avoid toplevel races with
503 ## AM_RECURSIVE_TARGETS.  Suggest keeping test directories around for
504 ## greppability of the Makefile.in files.
505 sc_ensure_testsuite_has_run:
506         @if test ! -f '$(TEST_SUITE_LOG)'; then \
507           echo 'Run "env keep_testdirs=yes make check" before' \
508                'running "make maintainer-check"' >&2; \
509           exit 1; \
510         fi
511 .PHONY: sc_ensure_testsuite_has_run
512
513 ## Ensure our warning and error messages do not contain duplicate 'warning:' prefixes.
514 ## This test actually depends on the testsuite having been run before.
515 sc_tests_logs_duplicate_prefixes: sc_ensure_testsuite_has_run
516         @if grep -E '(warning|error):.*(warning|error):' t/*.log; then \
517           echo 'Duplicate warning/error message prefixes seen in above tests.' >&2; \
518           exit 1; \
519         fi
520
521 ## Ensure variables are listed before rules in Makefile.in files we generate.
522 sc_tests_makefile_variable_order: sc_ensure_testsuite_has_run
523         @st=0; \
524         for file in `find t -name Makefile.in -print`; do \
525           latevars=`sed -n \
526             -e :x -e 's/#.*//' \
527             -e '/\\\\$$/{' -e N -e 'b x' -e '}' \
528             -e '# Literal TAB.' \
529             -e '1,/^    /d' \
530             -e '# Allow @ so we match conditionals.' \
531             -e '/^ *[a-zA-Z_@]\{1,\} *=/p' $$file`; \
532           if test -n "$$latevars"; then \
533             echo "Variables are expanded too late in $$file:" >&2; \
534             echo "$$latevars" | sed 's/^/  /' >&2; \
535             st=1; \
536           fi; \
537         done; \
538         test $$st -eq 0 || { \
539           echo 'Ensure variables are expanded before rules' >&2; \
540           exit 1; \
541         }
542
543 ## Using ':' as a PATH separator is not portable.
544 sc_tests_PATH_SEPARATOR:
545         @if grep -E '\bPATH=.*:.*' $(xtests) ; then \
546           echo "Use '\$$PATH_SEPARATOR', not ':', in PATH definitions" \
547                "above." 1>&2; \
548           exit 1; \
549         fi
550
551 ## Try to make sure all @...@ substitutions are covered by our
552 ## substitution rule.
553 sc_perl_at_substs:
554         @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' aclocal | wc -l` -ne 0; then \
555           echo "Unresolved @...@ substitution in aclocal" 1>&2; \
556           exit 1; \
557         fi
558         @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' automake | wc -l` -ne 0; then \
559           echo "Unresolved @...@ substitution in automake" 1>&2; \
560           exit 1; \
561         fi
562
563 sc_unquoted_DESTDIR:
564         @if grep -E "[^\'\"]\\\$$\(DESTDIR" $(ams); then \
565           echo 'Suspicious unquoted DESTDIR uses.' 1>&2 ; \
566           exit 1; \
567         fi
568
569 sc_tabs_in_texi:
570         @if grep '      ' $(srcdir)/doc/automake.texi; then \
571           echo 'Do not use tabs in the manual.' 1>&2; \
572           exit 1; \
573         fi
574
575 sc_at_in_texi:
576         @if grep -E '([^@]|^)@([         ][^@]|$$)' $(srcdir)/doc/automake.texi; \
577         then \
578           echo 'Unescaped @.' 1>&2; \
579           exit 1; \
580         fi
581
582 $(syntax_check_rules): automake aclocal
583 maintainer-check: $(syntax_check_rules)
584 .PHONY: maintainer-check $(syntax_check_rules)
585
586 ## Check that the list of tests given in the Makefile is equal to the
587 ## list of all test scripts in the Automake testsuite.
588 maintainer-check: maintainer-check-list-of-tests