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