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