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