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