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