tests: use append mode to capture parallel make output
[platform/upstream/automake.git] / maintainer / syntax-checks.mk
1 # Maintainer checks for Automake.  Requires GNU make.
2
3 # Copyright (C) 2012-2013 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/ax/*.$$s $$d/t/*.$$s $$d/contrib/t/*.$$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
39 ams := $(shell find $(srcdir) -name '*.dir' -prune -o -name '*.am' -print)
40
41 # Some simple checks, and then ordinary check.  These are only really
42 # guaranteed to work on my machine.
43 syntax_check_rules = \
44 $(sc_tests_plain_check_rules) \
45 sc_diff_automake \
46 sc_diff_aclocal \
47 sc_no_brace_variable_expansions \
48 sc_rm_minus_f \
49 sc_no_for_variable_in_macro \
50 sc_mkinstalldirs \
51 sc_pre_normal_post_install_uninstall \
52 sc_perl_no_undef \
53 sc_perl_no_split_regex_space \
54 sc_cd_in_backquotes \
55 sc_cd_relative_dir \
56 sc_perl_at_uscore_in_scalar_context \
57 sc_perl_local \
58 sc_AMDEP_TRUE_in_automake_in \
59 sc_tests_make_without_am_makeflags \
60 $(sc_obsolete_requirements_rules) \
61 sc_tests_no_source_defs \
62 sc_tests_obsolete_variables \
63 sc_tests_here_document_format \
64 sc_tests_command_subst \
65 sc_tests_no_run_make_redirect \
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_no_make_e \
71 sc_tests_plain_sleep \
72 sc_tests_ls_t \
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 ## These check avoids accidental configure substitutions in the source.
84 ## There are exactly 8 lines that should be modified from automake.in to
85 ## automake, and 9 lines that should be modified from aclocal.in to
86 ## aclocal.
87 automake_diff_no = 8
88 aclocal_diff_no = 9
89 sc_diff_automake sc_diff_aclocal: in=$($*_in)
90 sc_diff_automake sc_diff_aclocal: out=$($*_script)
91 sc_diff_automake sc_diff_aclocal: sc_diff_% :
92         @set +e; \
93         in=$*-in.tmp out=$*-out.tmp diffs=$*-diffs.tmp \
94           && sed '/^#!.*[pP]rototypes/d' $(in) > $$in \
95           && sed '/^# BEGIN.* PROTO/,/^# END.* PROTO/d' $(out) > $$out \
96           && { diff -u $$in $$out > $$diffs; test $$? -eq 1; } \
97           && added=`grep -v '^+++ ' $$diffs | grep -c '^+'` \
98           && removed=`grep -v '^--- ' $$diffs | grep -c '^-'` \
99           && test $$added,$$removed = $($*_diff_no),$($*_diff_no) \
100           || { \
101             echo "Found unexpected diffs between $(in) and $(out)"; \
102             echo "Lines added:   $$added"  ; \
103             echo "Lines removed: $$removed"; \
104             cat $$diffs; \
105             exit 1; \
106           } >&2; \
107         rm -f $$in $$out $$diffs
108
109 ## Expect no instances of '${...}'.  However, $${...} is ok, since that
110 ## is a shell construct, not a Makefile construct.
111 sc_no_brace_variable_expansions:
112         @if grep -v '^ *#' $(ams) | grep -F '$${' | grep -F -v '$$$$'; then \
113           echo "Found too many uses of '\$${' in the lines above." 1>&2; \
114           exit 1; \
115         else :; fi
116
117 ## Make sure 'rm' is called with '-f'.
118 sc_rm_minus_f:
119         @if grep -v '^#' $(ams) $(xtests) \
120            | grep -vE '/(rm-f-probe\.sh|spy-rm\.tap|subobj-clean.*-pr10697\.sh):' \
121            | grep -E '\<rm ([^-]|\-[^f ]*\>)'; \
122         then \
123           echo "Suspicious 'rm' invocation." 1>&2; \
124           exit 1; \
125         else :; fi
126
127 ## Never use something like "for file in $(FILES)", this doesn't work
128 ## if FILES is empty or if it contains shell meta characters (e.g. $ is
129 ## commonly used in Java filenames).
130 sc_no_for_variable_in_macro:
131         @if grep 'for .* in \$$(' $(ams) | grep -v '/Makefile\.am:'; then \
132           echo 'Use "list=$$(mumble); for var in $$$$list".' 1>&2 ; \
133           exit 1; \
134         else :; fi
135
136 ## Make sure all invocations of mkinstalldirs are correct.
137 sc_mkinstalldirs:
138         @if grep -n 'mkinstalldirs' $(ams) \
139               | grep -F -v '$$(mkinstalldirs)' \
140               | grep -v '^\./Makefile.am:[0-9][0-9]*:  *lib/mkinstalldirs \\$$'; \
141         then \
142           echo "Found incorrect use of mkinstalldirs in the lines above" 1>&2; \
143           exit 1; \
144         else :; fi
145
146 ## Make sure all calls to PRE/NORMAL/POST_INSTALL/UNINSTALL
147 sc_pre_normal_post_install_uninstall:
148         @if grep -E -n '\((PRE|NORMAL|POST)_(|UN)INSTALL\)' $(ams) | \
149               grep -v ':##' | grep -v ':        @\$$('; then \
150           echo "Found incorrect use of PRE/NORMAL/POST_INSTALL/UNINSTALL in the lines above" 1>&2; \
151           exit 1; \
152         else :; fi
153
154 ## We never want to use "undef", only "delete", but for $/.
155 sc_perl_no_undef:
156         @if grep -n -w 'undef ' $(automake_in) | \
157               grep -F -v 'undef $$/'; then \
158           echo "Found 'undef' in the lines above; use 'delete' instead" 1>&2; \
159           exit 1; \
160         fi
161
162 ## We never want split (/ /,...), only split (' ', ...).
163 sc_perl_no_split_regex_space:
164         @if grep -n 'split (/ /' $(automake_in) $(acloca_in); then \
165           echo "Found bad split in the lines above." 1>&2; \
166           exit 1; \
167         fi
168
169 ## Look for cd within backquotes
170 sc_cd_in_backquotes:
171         @if grep -n '^[^#]*` *cd ' $(automake_in) $(ams); then \
172           echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
173           exit 1; \
174         fi
175
176 ## Look for cd to a relative directory (may be influenced by CDPATH).
177 ## Skip some known directories that are OK.
178 sc_cd_relative_dir:
179         @if grep -n '^[^#]*cd ' $(automake_in) $(ams) | \
180               grep -v 'echo.*cd ' | \
181               grep -v 'am__cd =' | \
182               grep -v '^[^#]*cd [./]' | \
183               grep -v '^[^#]*cd \$$(top_builddir)' | \
184               grep -v '^[^#]*cd "\$$\$$am__cwd' | \
185               grep -v '^[^#]*cd \$$(abs' | \
186               grep -v '^[^#]*cd "\$$(DESTDIR)'; then \
187           echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
188           exit 1; \
189         fi
190
191 ## Using @_ in a scalar context is most probably a programming error.
192 sc_perl_at_uscore_in_scalar_context:
193         @if grep -Hn '[^%@_A-Za-z0-9][_A-Za-z0-9]*[^) ] *= *@_' \
194             $(automake_in) $(aclocal_in); then \
195           echo "Using @_ in a scalar context in the lines above." 1>&2; \
196           exit 1; \
197         fi
198
199 ## Allow only few variables to be localized in automake and aclocal.
200 sc_perl_local:
201         @if egrep -v '^[ \t]*local \$$[_~]( *=|;)' \
202               $(automake_in) $(aclocal_in) | \
203             grep '^[ \t]*local [^*]'; then \
204           echo "Please avoid 'local'." 1>&2; \
205           exit 1; \
206         fi
207
208 ## Don't let AMDEP_TRUE substitution appear in automake.in.
209 sc_AMDEP_TRUE_in_automake_in:
210         @if grep '@AMDEP''_TRUE@' $(automake_in); then \
211           echo "Don't put AMDEP_TRUE substitution in automake.in" 1>&2; \
212           exit 1; \
213         fi
214
215 ## Recursive make invocations should always pass $(AM_MAKEFLAGS)
216 ## to $(MAKE), for portability to non-GNU make.
217 sc_tests_make_without_am_makeflags:
218         @if grep '^[^#].*(MAKE) ' $(ams) $(automake_in) \
219             | grep -Fv '$$(AM_MAKEFLAGS)'; \
220         then \
221           echo 'Use $$(MAKE) $$(AM_MAKEFLAGS).' 1>&2; \
222           exit 1; \
223         fi
224
225 ## Look out for some obsolete variables.
226 sc_tests_obsolete_variables:
227         @vars=" \
228           using_tap \
229           am_using_tap \
230           test_prefer_config_shell \
231           original_AUTOMAKE \
232           original_ACLOCAL \
233           parallel_tests \
234           am_parallel_tests \
235         "; \
236         seen=""; \
237         for v in $$vars; do \
238           if grep -E "\b$$v\b" $(xtests) $(xdefs); then \
239             seen="$$seen $$v"; \
240           fi; \
241         done; \
242         if test -n "$$seen"; then \
243           for v in $$seen; do \
244             case $$v in \
245               parallel_tests|am_parallel_tests) v2=am_serial_tests;; \
246               *) v2=am_$$v;; \
247             esac; \
248             echo "Variable '$$v' is obsolete, use '$$v2' instead." 1>&2; \
249           done; \
250           exit 1; \
251         else :; fi
252
253 ## Look out for obsolete requirements specified in the test cases.
254 sc_obsolete_requirements_rules = sc_no_texi2dvi-o sc_no_makeinfo-html
255 modern-requirement.texi2dvi-o = texi2dvi
256 modern-requirement.makeinfo-html = makeinfo
257
258 $(sc_obsolete_requirements_rules): sc_no_% :
259         @if grep -E 'required=.*\b$*\b' $(xtests); then \
260           echo "Requirement '$*' is obsolete and shouldn't" \
261                "be used anymore." >&2; \
262           echo "You should use '$(modern-requirement.$*)' instead." >&2; \
263           exit 1; \
264         fi
265
266 ## Tests should never call some programs directly, but only through the
267 ## corresponding variable (e.g., '$MAKE', not 'make').  This will allow
268 ## the programs to be overridden at configure time (for less brittleness)
269 ## or by the user at make time (to allow better testsuite coverage).
270 sc_tests_plain_check_rules = \
271   sc_tests_plain_egrep \
272   sc_tests_plain_fgrep \
273   sc_tests_plain_make \
274   sc_tests_plain_perl \
275   sc_tests_plain_automake \
276   sc_tests_plain_aclocal \
277   sc_tests_plain_autoconf \
278   sc_tests_plain_autoupdate \
279   sc_tests_plain_autom4te \
280   sc_tests_plain_autoheader \
281   sc_tests_plain_autoreconf
282
283 toupper = $(shell echo $(1) | LC_ALL=C tr '[a-z]' '[A-Z]')
284
285 $(sc_tests_plain_check_rules): sc_tests_plain_% :
286         @# The leading ':' in the grep below is what is printed by the
287         @# preceding 'grep -v' after the file name.
288         @# It works here as a poor man's substitute for beginning-of-line
289         @# marker.
290         @if grep -v '^[         ]*#' $(xtests) \
291            | $(EGREP) '(:|\bif|\bnot|[;!{\|\(]|&&|\|\|)[        ]*?$*\b'; \
292          then \
293            echo 'Do not run "$*" in the above tests.' \
294                 'Use "$$$(call toupper,$*)" instead.' 1>&2; \
295            exit 1; \
296         fi
297
298 ## Tests should only use END and EOF for here documents
299 ## (so that the next test is effective).
300 sc_tests_here_document_format:
301         @if grep '<<' $(xtests) | grep -Ev '\b(END|EOF)\b|\bcout <<'; then \
302           echo 'Use here documents with "END" and "EOF" only, for greppability.' 1>&2; \
303           exit 1; \
304         fi
305
306 ## Our test case should use the $(...) POSIX form for command substitution,
307 ## rather than the older `...` form.
308 ## The point of ignoring text on here-documents is that we want to exempt
309 ## Makefile.am rules, configure.ac code and helper shell script created and
310 ## used by out shell scripts, because Autoconf (as of version 2.69) does not
311 ## yet ensure that $CONFIG_SHELL will be set to a proper POSIX shell.
312 sc_tests_command_subst:
313         @found=false; \
314         scan () { \
315           sed -n -e '/^#/d' \
316                  -e '/<<.*END/,/^END/b' -e '/<<.*EOF/,/^EOF/b' \
317                  -e 's/\\`/\\{backtick}/' \
318                  -e "s/[^\\]'\([^']*\`[^']*\)*'/'{quoted-text}'/g" \
319                  -e '/`/p' $$*; \
320         }; \
321         for file in $(xtests); do \
322           res=`scan $$file`; \
323           if test -n "$$res"; then \
324             echo "$$file:$$res"; \
325             found=true; \
326           fi; \
327         done; \
328         if $$found; then \
329           echo 'Use $$(...), not `...`, for command substitutions.' >&2; \
330           exit 1; \
331         fi
332
333 ## Tests should no longer call 'Exit', just 'exit'.  That's because we
334 ## now have in place a better workaround to ensure the exit status is
335 ## transported correctly across the exit trap.
336 sc_tests_exit_not_Exit:
337         @if grep 'Exit' $(xtests) $(xdefs) | grep -Ev '^[^:]+: *#' | grep .; then \
338           echo "Use 'exit', not 'Exit'; it's obsolete now." 1>&2; \
339           exit 1; \
340         fi
341
342 ## Guard against obsolescent uses of ./defs in tests.  Now,
343 ## 'test-init.sh' should be used instead.
344 sc_tests_no_source_defs:
345         @if grep -E '\. .*defs($$| )' $(xtests); then \
346           echo "Source 'test-init.sh', not './defs'." 1>&2; \
347           exit 1; \
348         fi
349
350 ## Invocation of 'run_make' should not have output redirections.
351 sc_tests_no_run_make_redirect:
352         @if grep -Pzo '.*(\$$MAKE|\brun_make)\b(.*(\\\n))*.*>.*' $(xtests); \
353         then \
354           echo 'Do not redirect stdout/stderr in "run_make" or "$$MAKE"' \
355                'invocations,' >&2; \
356           echo 'use "run_make {-E|-O|-M}" instead.' >&2; \
357           exit 1; \
358         fi
359
360 ## Use AUTOMAKE_fails when appropriate
361 sc_tests_automake_fails:
362         @if grep -v '^#' $(xtests) | grep '\$$AUTOMAKE.*&&.*exit'; then \
363           echo 'Use AUTOMAKE_fails + grep to catch automake failures in the above tests.' 1>&2;  \
364           exit 1; \
365         fi
366
367 ## Setting 'required' after sourcing 'test-init.sh' is a bug.
368 sc_tests_required_after_defs:
369         @for file in $(xtests); do \
370           if out=`sed -n '/test-init\.sh/,$${/required=/p;}' $$file`; test -n "$$out"; then \
371             echo 'Do not set "required" after sourcing "test-init.sh" in '"$$file: $$out" 1>&2; \
372             exit 1; \
373           fi; \
374         done
375
376 # "make -e" is brittle and unsafe, since it let *all* the environment
377 # win over the macro definitions in the Makefiles.  Since we offer
378 # AM_MAKEFLAGS to allow the user to portably override macro definitions
379 # from the command line in a safe way, we should encourage users to use
380 # it.
381 sc_tests_no_make_e:
382         @if grep -E '\$$MAKE\b.* -[a-zA-Z0-9]*e' $(xtests); then \
383           echo '"make -e" is brittle, use "run_make" instead.' 1>&2; \
384           exit 1; \
385         fi
386
387 ## Overriding a Makefile macro on the command line is not portable when
388 ## recursive targets are used.  Better use an envvar.  SHELL is an
389 ## exception, POSIX says it can't come from the environment.  V, DESTDIR,
390 ## DISTCHECK_CONFIGURE_FLAGS and DISABLE_HARD_ERRORS are exceptions, too,
391 ## as package authors are urged not to initialize them anywhere.
392 ## Finally, 'exp' is used by some ad-hoc checks, where we ensure it's
393 ## ok to override it from the command line.
394 sc_tests_overriding_macros_on_cmdline:
395 # The first s/// tries to account for usages like "$MAKE || st=$?".
396 # 'DISTCHECK_CONFIGURE_FLAGS' and 'exp' are allowed to contain whitespace in
397 # their definitions, hence the more complex last three substitutions below.
398         @if sed -e 's/ || .*//' -e 's/ && .*//' \
399                 -e 's/ DESTDIR=[^ ]*/ /' -e 's/ SHELL=[^ ]*/ /' \
400                 -e 's/ V=[^ ]*/ /' -e 's/ DISABLE_HARD_ERRORS=[^ ]*/ /' \
401                 -e "s/ DISTCHECK_CONFIGURE_FLAGS='[^']*'/ /" \
402                 -e 's/ DISTCHECK_CONFIGURE_FLAGS="[^"]*"/ /' \
403                 -e 's/ DISTCHECK_CONFIGURE_FLAGS=[^ ]/ /' \
404                 -e "s/ exp='[^']*'/ /" \
405                 -e 's/ exp="[^"]*"/ /' \
406                 -e 's/ exp=[^ ]/ /' \
407               $(filter-out %/am-test-lib.sh,$(xtests)) \
408                 | grep '\$$MAKE .*='; then \
409           echo 'Rewrite "$$MAKE foo=bar" as "run_make foo=bar" in the lines above,'; \
410           echo 'it is more portable.'; \
411           exit 1; \
412         fi >&2
413         @if grep 'SHELL=.*\$$MAKE' $(xtests); then \
414           echo '$$MAKE ignores the SHELL envvar, use "run_make SHELL=$$SHELL"'; \
415           echo 'in the above lines.'; \
416           exit 1; \
417         fi >&2
418
419 ## Prefer use of our 'is_newest' auxiliary script over the more hacky
420 ## idiom "test $(ls -1t new old | sed 1q) = new", which is both more
421 ## cumbersome and more fragile.
422 sc_tests_ls_t:
423         @if LC_ALL=C grep -E '\bls(\s+-[a-zA-Z0-9]+)*\s+-[a-zA-Z0-9]*t' \
424             $(xtests); then \
425           echo "Use 'is_newest' rather than hacks based on 'ls -t'" 1>&2; \
426           exit 1; \
427         fi
428
429 ## Never use 'sleep 1' to create files with different timestamps.
430 ## Use '$sleep' instead.  Some file systems (e.g., Windows) have only
431 ## a 2sec resolution.
432 sc_tests_plain_sleep:
433         @if grep -E '\bsleep +[12345]\b' $(xtests); then \
434           echo 'Do not use "sleep x" in the above tests.  Use "$$sleep" instead.' 1>&2; \
435           exit 1; \
436         fi
437
438 ## fgrep and egrep are not required by POSIX.
439 sc_m4_am_plain_egrep_fgrep:
440         @if grep -E '\b[ef]grep\b' $(ams) $(srcdir)/m4/*.m4; then \
441           echo 'Do not use egrep or fgrep in the above files,' \
442                'they are not portable.' 1>&2; \
443           exit 1; \
444         fi
445
446 ## Prefer 'configure.ac' over the obsolescent 'configure.in' as the name
447 ## for configure input files in our testsuite.  The latter  has been
448 ## deprecated for several years (at least since autoconf 2.50).
449 sc_tests_no_configure_in:
450         @if grep -E '\bconfigure\\*\.in\b' $(xtests) $(xdefs) \
451               | grep -Ev '/backcompat.*\.(sh|tap):' \
452               | grep -Ev '/autodist-configure-no-subdir\.sh:' \
453               | grep -Ev '/(configure|help)\.sh:' \
454               | grep .; \
455         then \
456           echo "Use 'configure.ac', not 'configure.in', as the name" >&2; \
457           echo "for configure input files in the test cases above." >&2; \
458           exit 1; \
459         fi
460
461 ## Rule to ensure that the testsuite has been run before.  We don't depend
462 ## on 'check' here, because that would be very wasteful in the common case.
463 ## We could run "make check RECHECK_LOGS=" and avoid toplevel races with
464 ## AM_RECURSIVE_TARGETS.  Suggest keeping test directories around for
465 ## greppability of the Makefile.in files.
466 sc_ensure_testsuite_has_run:
467         @if test ! -f '$(TEST_SUITE_LOG)'; then \
468           echo 'Run "env keep_testdirs=yes make check" before' \
469                'running "make maintainer-check"' >&2; \
470           exit 1; \
471         fi
472 .PHONY: sc_ensure_testsuite_has_run
473
474 ## Ensure our warning and error messages do not contain duplicate 'warning:' prefixes.
475 ## This test actually depends on the testsuite having been run before.
476 sc_tests_logs_duplicate_prefixes: sc_ensure_testsuite_has_run
477         @if grep -E '(warning|error):.*(warning|error):' t/*.log; then \
478           echo 'Duplicate warning/error message prefixes seen in above tests.' >&2; \
479           exit 1; \
480         fi
481
482 ## Ensure variables are listed before rules in Makefile.in files we generate.
483 sc_tests_makefile_variable_order: sc_ensure_testsuite_has_run
484         @st=0; \
485         for file in `find t -name Makefile.in -print`; do \
486           latevars=`sed -n \
487             -e :x -e 's/#.*//' \
488             -e '/\\\\$$/{' -e N -e 'b x' -e '}' \
489             -e '# Literal TAB.' \
490             -e '1,/^    /d' \
491             -e '# Allow @ so we match conditionals.' \
492             -e '/^ *[a-zA-Z_@]\{1,\} *=/p' $$file`; \
493           if test -n "$$latevars"; then \
494             echo "Variables are expanded too late in $$file:" >&2; \
495             echo "$$latevars" | sed 's/^/  /' >&2; \
496             st=1; \
497           fi; \
498         done; \
499         test $$st -eq 0 || { \
500           echo 'Ensure variables are expanded before rules' >&2; \
501           exit 1; \
502         }
503
504 ## Using ':' as a PATH separator is not portable.
505 sc_tests_PATH_SEPARATOR:
506         @if grep -E '\bPATH=.*:.*' $(xtests) ; then \
507           echo "Use '\$$PATH_SEPARATOR', not ':', in PATH definitions" \
508                "above." 1>&2; \
509           exit 1; \
510         fi
511
512 ## Try to make sure all @...@ substitutions are covered by our
513 ## substitution rule.
514 sc_perl_at_substs:
515         @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' bin/aclocal | wc -l` -ne 0; then \
516           echo "Unresolved @...@ substitution in aclocal" 1>&2; \
517           exit 1; \
518         fi
519         @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' bin/automake | wc -l` -ne 0; then \
520           echo "Unresolved @...@ substitution in automake" 1>&2; \
521           exit 1; \
522         fi
523
524 sc_unquoted_DESTDIR:
525         @if grep -E "[^\'\"]\\\$$\(DESTDIR" $(ams); then \
526           echo 'Suspicious unquoted DESTDIR uses.' 1>&2 ; \
527           exit 1; \
528         fi
529
530 sc_tabs_in_texi:
531         @if grep '      ' $(srcdir)/doc/automake.texi; then \
532           echo 'Do not use tabs in the manual.' 1>&2; \
533           exit 1; \
534         fi
535
536 sc_at_in_texi:
537         @if grep -E '([^@]|^)@([         ][^@]|$$)' $(srcdir)/doc/automake.texi; \
538         then \
539           echo 'Unescaped @.' 1>&2; \
540           exit 1; \
541         fi
542
543 $(syntax_check_rules): bin/automake bin/aclocal
544 maintainer-check: $(syntax_check_rules)
545 .PHONY: maintainer-check $(syntax_check_rules)
546
547 ## Check that the list of tests given in the Makefile is equal to the
548 ## list of all test scripts in the Automake testsuite.
549 maintainer-check: maintainer-check-list-of-tests
550
551 # I'm a lazy typist.
552 lint: maintainer-check
553 .PHONY: lint