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