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