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