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