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