build: reenable just-moved/broken syntax-check rule
[platform/upstream/coreutils.git] / cfg.mk
1 # Customize maint.mk                           -*- makefile -*-
2 # Copyright (C) 2003-2012 Free Software Foundation, Inc.
3
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 # Used in maint.mk's web-manual rule
18 manual_title = Core GNU utilities
19
20 # Use the direct link.  This is guaranteed to work immediately, while
21 # it can take a while for the faster mirror links to become usable.
22 url_dir_list = http://ftp.gnu.org/gnu/$(PACKAGE)
23
24 # Tests not to run as part of "make distcheck".
25 local-checks-to-skip =
26
27 # Tools used to bootstrap this package, used for "announcement".
28 bootstrap-tools = autoconf,automake,gnulib,bison
29
30 # Now that we have better tests, make this the default.
31 export VERBOSE = yes
32
33 # Comparing tarball sizes compressed using different xz presets, we see that
34 # an -8e-compressed tarball is only 9KiB larger than the -9e-compressed one.
35 # Using -8e is preferred, since that lets the decompression process use half
36 # the memory (32MiB rather than 64MiB).
37 # $ for i in {7,8,9}{e,}; do \
38 #     (n=$(xz -$i < coreutils-8.15*.tar|wc -c);echo $n $i) & done |sort -nr
39 # 5129388 7
40 # 5036524 7e
41 # 5017476 8
42 # 5010604 9
43 # 4923016 8e
44 # 4914152 9e
45 export XZ_OPT = -8e
46
47 old_NEWS_hash = a99128b9985b2e76bdcabf3e5d95ca1a
48
49 # Add an exemption for sc_makefile_at_at_check.
50 _makefile_at_at_check_exceptions = ' && !/^cu_install_program =/'
51
52 # Our help-version script is in a slightly different location.
53 _hv_file ?= $(srcdir)/tests/misc/help-version
54
55 # Ensure that the list of O_ symbols used to compute O_FULLBLOCK is complete.
56 dd = $(srcdir)/src/dd.c
57 sc_dd_O_FLAGS:
58         @rm -f $@.1 $@.2
59         @{ echo O_FULLBLOCK; echo O_NOCACHE;                            \
60           perl -nle '/^ +\| (O_\w*)$$/ and print $$1' $(dd); } | sort > $@.1
61         @{ echo O_NOFOLLOW; perl -nle '/{"[a-z]+",\s*(O_\w+)},/ and print $$1' \
62           $(dd); } | sort > $@.2
63         @diff -u $@.1 $@.2 || diff=1 || diff=;                          \
64         rm -f $@.1 $@.2;                                                \
65         test "$$diff"                                                   \
66           && { echo '$(ME): $(dd) has inconsistent O_ flag lists'>&2;   \
67                exit 1; } || :
68
69 # Ensure that dd's definition of LONGEST_SYMBOL stays in sync
70 # with the strings from the two affected variables.
71 dd_c = $(srcdir)/src/dd.c
72 sc_dd_max_sym_length:
73 ifneq ($(wildcard $(dd_c)),)
74         @len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
75                  sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) )      \
76                 |sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p'         \
77               | wc --max-line-length);                          \
78         max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
79               |tr -d '"' | wc --max-line-length);               \
80         if test "$$len" = "$$max"; then :; else                 \
81           echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2;      \
82           exit 1;                                               \
83         fi
84 endif
85
86 # Many m4 macros names once began with 'jm_'.
87 # On 2004-04-13, they were all changed to start with gl_ instead.
88 # Make sure that none are inadvertently reintroduced.
89 sc_prohibit_jm_in_m4:
90         @grep -nE 'jm_[A-Z]'                                            \
91                 $$($(VC_LIST) m4 |grep '\.m4$$'; echo /dev/null) &&     \
92             { echo '$(ME): do not use jm_ in m4 macro names'            \
93               1>&2; exit 1; } || :
94
95 # Ensure that each root-requiring test is run via the "check-root" rule.
96 sc_root_tests:
97         @if test -d tests \
98               && grep check-root tests/Makefile.am>/dev/null 2>&1; then \
99         t1=sc-root.expected; t2=sc-root.actual;                         \
100         grep -nl '^ *require_root_$$'                                   \
101           $$($(VC_LIST) tests) |sed s,tests/,, |sort > $$t1;            \
102         sed -n '/^root_tests =[  ]*\\$$/,/[^\]$$/p'                     \
103           $(srcdir)/tests/Makefile.am                                   \
104             | sed 's/^  *//;/^root_tests =/d'                           \
105             | tr -s '\012\\' '  ' | fmt -1 | sort > $$t2;               \
106         diff -u $$t1 $$t2 || diff=1 || diff=;                           \
107         rm -f $$t1 $$t2;                                                \
108         test "$$diff"                                                   \
109           && { echo 'tests/Makefile.am: missing check-root action'>&2;  \
110                exit 1; } || :;                                          \
111         fi
112
113 # Create a list of regular expressions matching the names
114 # of files included from system.h.  Exclude a couple.
115 .re-list:
116         @sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
117           | grep -Ev 'sys/(param|file)\.h' \
118           | sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
119           > $@-t
120         @mv $@-t $@
121
122 define gl_trap_
123   Exit () { set +e; (exit $$1); exit $$1; };                            \
124   for sig in 1 2 3 13 15; do                                            \
125     eval "trap 'Exit $$(expr $$sig + 128)' $$sig";                      \
126   done
127 endef
128
129 # Files in src/ should not include directly any of
130 # the headers already included via system.h.
131 sc_system_h_headers: .re-list
132         @if test -f $(srcdir)/src/system.h; then                        \
133           trap 'rc=$$?; rm -f .re-list; exit $$rc' 0;                   \
134           $(gl_trap_);                                                  \
135           grep -nE -f .re-list                                          \
136               $$($(VC_LIST_EXCEPT) | grep '^\($(srcdir)/\)\?src/')      \
137             && { echo '$(ME): the above are already included via system.h'\
138                   1>&2;  exit 1; } || :;                                \
139         fi
140
141 sc_sun_os_names:
142         @grep -nEi \
143             'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
144             $$($(VC_LIST_EXCEPT)) &&                                    \
145           { echo '$(ME): found misuse of Sun OS version numbers' 1>&2;  \
146             exit 1; } || :
147
148 ALL_RECURSIVE_TARGETS += sc_check-AUTHORS
149 sc_check-AUTHORS:
150         @$(MAKE) -s -C src _sc_check-AUTHORS
151
152 # Look for lines longer than 80 characters, except omit:
153 # - program-generated long lines in diff headers,
154 # - tests involving long checksum lines, and
155 # - the 'pr' test cases.
156 LINE_LEN_MAX = 80
157 FILTER_LONG_LINES =                                             \
158   /^[^:]*\.diff:[^:]*:@@ / d;                                   \
159   \|^[^:]*tests/misc/sha[0-9]*sum.*\.pl[-:]| d;                 \
160   \|^[^:]*tests/pr/|{ \|^[^:]*tests/pr/pr-tests:| !d; };
161 sc_long_lines:
162         @files=$$($(VC_LIST_EXCEPT))                                    \
163         halt='line(s) with more than $(LINE_LEN_MAX) characters; reindent'; \
164         for file in $$files; do                                         \
165           expand $$file | grep -nE '^.{$(LINE_LEN_MAX)}.' |             \
166           sed -e "s|^|$$file:|" -e '$(FILTER_LONG_LINES)';              \
167         done | grep . && { msg="$$halt" $(_sc_say_and_exit) } || :
168
169 # Option descriptions should not start with a capital letter.
170 # One could grep source directly as follows:
171 # grep -E " {2,6}-.*[^.]  [A-Z][a-z]" $$($(VC_LIST_EXCEPT) | grep '\.c$$')
172 # but that would miss descriptions not on the same line as the -option.
173 ALL_RECURSIVE_TARGETS += sc_option_desc_uppercase
174 .PHONY: sc_option_desc_uppercase
175 sc_option_desc_uppercase:
176         @grep '^\\fB\\-' -A1 man/*.1 | LC_ALL=C grep '\.1.[A-Z][a-z]'   \
177           && { echo 1>&2 '$@: found initial capitals in --help'; exit 1; } || :
178 sc_option_desc_uppercase: $(dist_man1_MANS) \
179                           $(patsubst %,man/%.1,$(NO_INSTALL_PROGS_DEFAULT)) \
180                           all_programs
181
182 # Ensure all man/*.[1x] files are present.
183 ALL_RECURSIVE_TARGETS += sc_man_file_correlation
184 .PHONY: sc_man_file_correlation
185 sc_man_file_correlation: check-x-vs-1 check-programs-vs-x
186
187 # Ensure that for each .x file in the 'man/' subdirectory, there is a
188 # corresponding .1 file in the definition of $(dist_man1_MANS).
189 # But since that expansion usually lacks programs like arch and hostname,
190 # add them here manually.
191 .PHONY: check-x-vs-1
192 check-x-vs-1:
193         @PATH=./src$(PATH_SEPARATOR)$$PATH; export PATH;                \
194         t=$@-t;                                                         \
195         (cd $(srcdir)/man && ls -1 *.x)                                 \
196           | sed 's/\.x$$//' | $(ASSORT) > $$t;                          \
197         (echo $(patsubst man/%,%,$(dist_man1_MANS))                     \
198               $(NO_INSTALL_PROGS_DEFAULT)                               \
199           | tr -s ' ' '\n' | sed 's/\.1$$//')                           \
200           | $(ASSORT) -u | diff - $$t || { rm $$t; exit 1; };           \
201         rm $$t
202
203 all_programs =                                                          \
204       (cd ./src && MAKEFLAGS= $(MAKE) -s all_programs.list)             \
205        | grep -v '\['
206
207 # Ensure that for each .x file in the 'man/' subdirectory, there is a
208 # corresponding coreutils program.
209 .PHONY: check-programs-vs-x
210 check-programs-vs-x: all_programs
211         @status=0;                                      \
212         for p in dummy `$(all_programs)`; do            \
213           test $$p = dummy && continue;                 \
214           test $$p = ginstall && p=install || : ;       \
215           test -f $(srcdir)/man/$$p.x                   \
216             || { echo missing $$p.x 1>&2; status=1; };  \
217         done;                                           \
218         exit $$status
219
220 # Ensure that the end of each release's section is marked by two empty lines.
221 sc_NEWS_two_empty_lines:
222         @sed -n 4,/Noteworthy/p $(srcdir)/NEWS                          \
223             | perl -n0e '/(^|\n)\n\n\* Noteworthy/ or exit 1'           \
224           || { echo '$(ME): use two empty lines to separate NEWS sections' \
225                  1>&2; exit 1; } || :
226
227 # Perl-based tests used to exec perl from a #!/bin/sh script.
228 # Now they all start with #!/usr/bin/perl and the portability
229 # infrastructure is in tests/Makefile.am.  Make sure no old-style
230 # script sneaks back in.
231 sc_no_exec_perl_coreutils:
232         @if test -f $(srcdir)/tests/Coreutils.pm; then                  \
233           grep '^exec  *\$$PERL.*MCoreutils' $$($(VC_LIST) tests) &&    \
234             { echo 1>&2 '$(ME): found anachronistic Perl-based tests';  \
235               exit 1; } || :;                                           \
236         fi
237
238 # With split lines, don't leave an operator at end of line.
239 # Instead, put it on the following line, where it is more apparent.
240 # Don't bother checking for "*" at end of line, since it provokes
241 # far too many false positives, matching constructs like "TYPE *".
242 # Similarly, omit "=" (initializers).
243 binop_re_ ?= [-/+^!<>]|[-/+*^!<>=]=|&&?|\|\|?|<<=?|>>=?
244 sc_prohibit_operator_at_end_of_line:
245         @prohibit='. ($(binop_re_))$$'                                  \
246         in_vc_files='\.[chly]$$'                                        \
247         halt='found operator at end of line'                            \
248           $(_sc_search_regexp)
249
250 # Don't use "readlink" or "readlinkat" directly
251 sc_prohibit_readlink:
252         @prohibit='\<readlink(at)? \('                                  \
253         halt='do not use readlink(at); use via xreadlink or areadlink*' \
254           $(_sc_search_regexp)
255
256 # Don't use address of "stat" or "lstat" functions
257 sc_prohibit_stat_macro_address:
258         @prohibit='\<l?stat '':|&l?stat\>'                              \
259         halt='stat() and lstat() may be function-like macros'           \
260           $(_sc_search_regexp)
261
262 # Ensure that date's --help output stays in sync with the info
263 # documentation for GNU strftime.  The only exception is %N,
264 # which date accepts but GNU strftime does not.
265 extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
266 sc_strftime_check:
267         @if test -f $(srcdir)/src/date.c; then                          \
268           grep '^  %.  ' $(srcdir)/src/date.c | sort                    \
269             | $(extract_char) > $@-src;                                 \
270           { echo N;                                                     \
271             info libc date calendar format 2>/dev/null|grep '^    `%.'\'\
272               | $(extract_char); } | sort > $@-info;                    \
273           if test $$(stat --format %s $@-info) != 2; then               \
274             diff -u $@-src $@-info || exit 1;                           \
275           else                                                          \
276             echo '$(ME): skipping $@: libc info not installed' 1>&2;    \
277           fi;                                                           \
278           rm -f $@-src $@-info;                                         \
279         fi
280
281 # Indent only with spaces.
282 sc_prohibit_tab_based_indentation:
283         @prohibit='^ *  '                                               \
284         halt='TAB in indentation; use only spaces'                      \
285           $(_sc_search_regexp)
286
287 # The SEE ALSO section of a man page should not be terminated with
288 # a period.  Check the first line after each "SEE ALSO" line in man/*.x:
289 sc_prohibit_man_see_also_period:
290         @grep -nB1 '\.$$' $$($(VC_LIST_EXCEPT) | grep 'man/.*\.x$$')    \
291             | grep -A1 -e '-\[SEE ALSO\]' | grep '\.$$' &&              \
292           { echo '$(ME): do not end "SEE ALSO" section with a period'   \
293               1>&2; exit 1; } || :
294
295 # Don't use "indent-tabs-mode: nil" anymore.  No longer needed.
296 sc_prohibit_emacs__indent_tabs_mode__setting:
297         @prohibit='^( *[*#] *)?indent-tabs-mode:'                       \
298         halt='use of emacs indent-tabs-mode: setting'                   \
299           $(_sc_search_regexp)
300
301 # Ensure that tests don't include a redundant fail=0.
302 sc_prohibit_fail_0:
303         @prohibit='\<fail=0\>'                                          \
304         halt='fail=0 initialization'                                    \
305           $(_sc_search_regexp)
306
307 # The mode part of a setfacl -m option argument must be three bytes long.
308 # I.e., an argument of user:bin:rw or user:bin:r will make Solaris 10's
309 # setfacl reject it with: "Unrecognized character found in mode field".
310 # Use hyphens to give it a length of 3: "...:rw-" or "...:r--".
311 sc_prohibit_short_facl_mode_spec:
312         @prohibit='\<setfacl .*-m.*:.*:[rwx-]{1,2} '                    \
313         halt='setfacl mode string length < 3; extend with hyphen(s)'    \
314           $(_sc_search_regexp)
315
316 # Ensure that "stdio--.h" is used where appropriate.
317 sc_require_stdio_safer:
318         @if $(VC_LIST_EXCEPT) | grep -l '\.[ch]$$' > /dev/null; then    \
319           files=$$(grep -l '\bfreopen \?(' $$($(VC_LIST_EXCEPT)         \
320               | grep '\.[ch]$$'));                                      \
321           test -n "$$files" && grep -LE 'include "stdio--.h"' $$files   \
322               | grep . &&                                               \
323           { echo '$(ME): the above files should use "stdio--.h"'        \
324                 1>&2; exit 1; } || :;                                   \
325         else :;                                                         \
326         fi
327
328 sc_prohibit_perl_hash_quotes:
329         @prohibit="\{'[A-Z_]+' *[=}]"                                   \
330         halt="in Perl code, write \$$hash{KEY}, not \$$hash{'K''EY'}"   \
331           $(_sc_search_regexp)
332
333 # Prefer xnanosleep over other less-precise sleep methods
334 sc_prohibit_sleep:
335         @prohibit='\<(nano|u)?sleep \('                                 \
336         halt='prefer xnanosleep over other sleep interfaces'            \
337           $(_sc_search_regexp)
338
339 # Use print_ver_ (from init.cfg), not open-coded $VERBOSE check.
340 sc_prohibit_verbose_version:
341         @prohibit='test "\$$VERBOSE" = yes && .* --version'             \
342         halt='use the print_ver_ function instead...'                   \
343           $(_sc_search_regexp)
344
345 # Use framework_failure_, not the old name without the trailing underscore.
346 sc_prohibit_framework_failure:
347         @prohibit='\<framework_''failure\>'                             \
348         halt='use framework_failure_ instead'                           \
349           $(_sc_search_regexp)
350
351 # Prohibit the use of `...` in tests/.  Use $(...) instead.
352 sc_prohibit_test_backticks:
353         @prohibit='`' in_vc_files='^tests/'                             \
354         halt='use $$(...), not `...` in tests/'                         \
355           $(_sc_search_regexp)
356
357 # Programs like sort, ls, expr use PROG_FAILURE in place of EXIT_FAILURE.
358 # Others, use the EXIT_CANCELED, EXIT_ENOENT, etc. macros defined in system.h.
359 # In those programs, ensure that EXIT_FAILURE is not used by mistake.
360 sc_some_programs_must_avoid_exit_failure:
361         @grep -nw EXIT_FAILURE                                          \
362             $$(git grep -El '[^T]_FAILURE|EXIT_CANCELED' src)           \
363           | grep -vE '= EXIT_FAILURE|exit \(.* \?' | grep .             \
364             && { echo '$(ME): do not use EXIT_FAILURE in the above'     \
365                   1>&2; exit 1; } || :
366
367 # Ensure that tests call the print_ver_ function for programs which are
368 # actually used in that test.
369 sc_prohibit_test_calls_print_ver_with_irrelevant_argument:
370         @git grep -w print_ver_ tests                                   \
371           | sed 's#:print_ver_##'                                       \
372           | { fail=0;                                                   \
373               while read file name; do                                  \
374                 for i in $$name; do                                     \
375                   case "$$i" in install) i=ginstall;; esac;             \
376                   grep -w "$$i" $$file|grep -vw print_ver_|grep -q .    \
377                     || { fail=1;                                        \
378                          echo "*** Test: $$file, offending: $$i." 1>&2; };\
379                 done;                                                   \
380               done;                                                     \
381               test $$fail = 0 || exit 1;                                \
382             } || { echo "$(ME): the above test(s) call print_ver_ for"  \
383                     "program(s) they don't use" 1>&2; exit 1; }
384
385 # Exempt the contents of any usage function from the following.
386 _continued_string_col_1 = \
387 s/^usage .*?\n}//ms;/\\\n\w/ and print ("$$ARGV\n"),$$e=1;END{$$e||=0;exit $$e}
388 # Ding any source file that has a continued string with an alphabetic in the
389 # first column of the following line.  We prohibit them because they usually
390 # trigger false positives in tools that try to map an arbitrary line number
391 # to the enclosing function name.  Of course, very many strings do precisely
392 # this, *when they are part of the usage function*.  That is why we exempt
393 # the contents of any function named "usage".
394 sc_prohibit_continued_string_alpha_in_column_1:
395         @perl -0777 -ne '$(_continued_string_col_1)' \
396             $$($(VC_LIST_EXCEPT) | grep '\.[ch]$$') \
397           || { echo '$(ME): continued string with word in first column' \
398                 1>&2; exit 1; } || :
399 # Use this to list offending lines:
400 # git ls-files |grep '\.[ch]$' | xargs \
401 #   perl -n -0777 -e 's/^usage.*?\n}//ms;/\\\n\w/ and print "$ARGV\n"' \
402 #     | xargs grep -A1 '\\$'|grep '\.[ch][:-][_a-zA-Z]'
403
404
405 ###########################################################
406 _p0 = \([^"'/]\|"\([^\"]\|[\].\)*"\|'\([^\']\|[\].\)*'
407 _pre = $(_p0)\|[/][^"'/*]\|[/]"\([^\"]\|[\].\)*"\|[/]'\([^\']\|[\].\)*'\)*
408 _pre_anchored = ^\($(_pre)\)
409 _comment_and_close = [^*]\|[*][^/*]\)*[*][*]*/
410 # help font-lock mode: '
411
412 # A sed expression that removes ANSI C and ISO C99 comments.
413 # Derived from the one in GNU gettext's 'moopp' preprocessor.
414 _sed_remove_comments =                                  \
415 /[/][/*]/{                                              \
416   ta;                                                   \
417   :a;                                                   \
418   s,$(_pre_anchored)//.*,\1,;                           \
419   te;                                                   \
420   s,$(_pre_anchored)/[*]\($(_comment_and_close),\1 ,;   \
421   ta;                                                   \
422   /^$(_pre)[/][*]/{                                     \
423     s,$(_pre_anchored)/[*].*,\1 ,;                      \
424     tu;                                                 \
425     :u;                                                 \
426     n;                                                  \
427     s,^\($(_comment_and_close),,;                       \
428     tv;                                                 \
429     s,^.*$$,,;                                          \
430     bu;                                                 \
431     :v;                                                 \
432   };                                                    \
433   :e;                                                   \
434 }
435 # Quote all single quotes.
436 _sed_rm_comments_q = $(subst ','\'',$(_sed_remove_comments))
437 # help font-lock mode: '
438
439 _space_before_paren_exempt =? \\n\\$$
440 _space_before_paren_exempt = \
441   (^ *\#|\\n\\$$|%s\(to %s|(date|group|character)\(s\))
442 # Ensure that there is a space before each open parenthesis in C code.
443 sc_space_before_open_paren:
444         @if $(VC_LIST_EXCEPT) | grep -l '\.[ch]$$' > /dev/null; then    \
445           fail=0;                                                       \
446           for c in $$($(VC_LIST_EXCEPT) | grep '\.[ch]$$'); do          \
447             sed '$(_sed_rm_comments_q)' $$c 2>/dev/null                 \
448               | grep -i '[[:alnum:]]('                                  \
449               | grep -vE '$(_space_before_paren_exempt)'                \
450               | grep . && { fail=1; echo "*** $$c"; };                  \
451           done;                                                         \
452           test $$fail = 1 &&                                            \
453             { echo '$(ME): the above files lack a space-before-open-paren' \
454                 1>&2; exit 1; } || :;                                   \
455         else :;                                                         \
456         fi
457
458 # Similar to the gnulib maint.mk rule for sc_prohibit_strcmp
459 # Use STREQ_LEN or STRPREFIX rather than comparing strncmp == 0, or != 0.
460 sc_prohibit_strncmp:
461         @grep -nE '! *str''ncmp *\(|\<str''ncmp *\(.+\) *[!=]='         \
462             $$($(VC_LIST_EXCEPT))                                       \
463           | grep -vE ':# *define STR(N?EQ_LEN|PREFIX)\(' &&             \
464           { echo '$(ME): use STREQ_LEN or STRPREFIX instead of str''ncmp' \
465                 1>&2; exit 1; } || :
466
467 # Enforce recommended preprocessor indentation style.
468 sc_preprocessor_indentation:
469         @if cppi --version >/dev/null 2>&1; then                        \
470           $(VC_LIST_EXCEPT) | grep '\.[ch]$$' | xargs cppi -a -c        \
471             || { echo '$(ME): incorrect preprocessor indentation' 1>&2; \
472                 exit 1; };                                              \
473         else                                                            \
474           echo '$(ME): skipping test $@: cppi not installed' 1>&2;      \
475         fi
476
477 # THANKS.in is a list of name/email pairs for people who are mentioned in
478 # commit logs (and generated ChangeLog), but who are not also listed as an
479 # author of a commit.  Name/email pairs of commit authors are automatically
480 # extracted from the repository.  As a very minor factorization, when
481 # someone who was initially listed only in THANKS.in later authors a commit,
482 # this rule detects that their pair may now be removed from THANKS.in.
483 sc_THANKS_in_duplicates:
484         @{ git log --pretty=format:%aN | sort -u;                       \
485             cut -b-36 THANKS.in | sed '/^$$/d;s/  *$$//'; }             \
486           | sort | uniq -d | grep .                                     \
487             && { echo '$(ME): remove the above names from THANKS.in'    \
488                   1>&2; exit 1; } || :
489
490 # Override the default Cc: used in generating an announcement.
491 announcement_Cc_ = $(translation_project_), \
492   coreutils@gnu.org, coreutils-announce@gnu.org
493
494 -include $(srcdir)/dist-check.mk
495
496 update-copyright-env = \
497   UPDATE_COPYRIGHT_FORCE=1 \
498   UPDATE_COPYRIGHT_USE_INTERVALS=2 \
499   UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79
500
501 # List syntax-check exemptions.
502 exclude_file_name_regexp--sc_space_tab = \
503   ^(tests/pr/|tests/misc/nl\.sh$$|gl/.*\.diff$$)
504 exclude_file_name_regexp--sc_bindtextdomain = ^(gl/.*|lib/euidaccess-stat)\.c$$
505 exclude_file_name_regexp--sc_unmarked_diagnostics =    ^build-aux/cvsu$$
506 exclude_file_name_regexp--sc_error_message_uppercase = ^build-aux/cvsu$$
507 exclude_file_name_regexp--sc_trailing_blank = ^tests/pr/
508 exclude_file_name_regexp--sc_system_h_headers = \
509   ^src/((system|copy)\.h|libstdbuf\.c)$$
510
511 _src = (false|lbracket|ls-(dir|ls|vdir)|tac-pipe|uname-(arch|uname))
512 exclude_file_name_regexp--sc_require_config_h_first = \
513   (^lib/buffer-lcm\.c|src/$(_src)\.c)$$
514 exclude_file_name_regexp--sc_require_config_h = \
515   $(exclude_file_name_regexp--sc_require_config_h_first)
516
517 exclude_file_name_regexp--sc_po_check = ^gl/
518 exclude_file_name_regexp--sc_prohibit_always-defined_macros = \
519   ^src/(seq|remove)\.c$$
520 exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = ^tests/pr/
521 exclude_file_name_regexp--sc_program_name = ^(gl/.*|lib/euidaccess-stat)\.c$$
522 exclude_file_name_regexp--sc_file_system = \
523   NEWS|^(tests/init\.cfg|src/df\.c|tests/df/df-P\.sh)$$
524 exclude_file_name_regexp--sc_prohibit_always_true_header_tests = \
525   ^m4/stat-prog\.m4$$
526 exclude_file_name_regexp--sc_prohibit_fail_0 = \
527   (^.*/git-hooks/commit-msg|^tests/init\.sh|Makefile\.am|\.mk|.*\.texi)$$
528 exclude_file_name_regexp--sc_prohibit_atoi_atof = ^lib/euidaccess-stat\.c$$
529
530 tbi_1 = ^tests/pr/|(^gl/lib/reg.*\.c\.diff|Makefile(\.am)?|\.mk|^man/help2man)$$
531 tbi_2 = ^scripts/git-hooks/(pre-commit|pre-applypatch|applypatch-msg)$$
532 exclude_file_name_regexp--sc_prohibit_tab_based_indentation = \
533   $(tbi_1)|$(tbi_2)
534
535 exclude_file_name_regexp--sc_preprocessor_indentation = \
536   ^(gl/lib/rand-isaac\.[ch]|gl/tests/test-rand-isaac\.c)$$
537 exclude_file_name_regexp--sc_prohibit_stat_st_blocks = \
538   ^(src/system\.h|tests/du/2g\.sh)$$
539
540 exclude_file_name_regexp--sc_prohibit_continued_string_alpha_in_column_1 = \
541   ^src/(system\.h|od\.c|printf\.c)$$
542
543 exclude_file_name_regexp--sc_prohibit_test_backticks = \
544   ^tests/(init\.sh|Makefile\.am|misc/stdbuf\.sh)$$
545
546 # Exempt test.c, since it's nominally shared, and relatively static.
547 exclude_file_name_regexp--sc_prohibit_operator_at_end_of_line = \
548   ^src/(ptx|test|head)\.c$$