* Makefile.maint: Merge from coreutils.

This commit is contained in:
Paul Eggert
2006-02-11 00:42:27 +00:00
parent 0be105dc42
commit 57bb17ca85
2 changed files with 26 additions and 24 deletions

View File

@@ -1,3 +1,7 @@
2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
* Makefile.maint: Merge from coreutils.
2006-02-09 Paul Eggert <eggert@cs.ucla.edu> 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
More portability fixes for problems summarized by Nelson H. F. Beebe. More portability fixes for problems summarized by Nelson H. F. Beebe.

View File

@@ -25,12 +25,9 @@ ME := Makefile.maint
# Do not save the original name or timestamp in the .tar.gz file. # Do not save the original name or timestamp in the .tar.gz file.
# Use --rsyncable if available. # Use --rsyncable if available.
GZIP_ENV = \ gzip_rsyncable := \
"--no-name --best$$( \ $(shell gzip --help|grep rsyncable >/dev/null && echo --rsyncable)
case $$(gzip --help) in \ GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
(*--rsyncable*) echo ' --rsyncable';; \
esac \
)"
CVS = cvs CVS = cvs
@@ -87,7 +84,8 @@ export LC_ALL = C
# new ChangeLog entries. # new ChangeLog entries.
local-checks-available = \ local-checks-available = \
po-check copyright-check writable-files m4-check author_mark_check \ po-check copyright-check writable-files m4-check author_mark_check \
changelog-check strftime-check syntax-check makefile_path_separator_check \ changelog-check strftime-check $(syntax-check-rules) \
makefile_path_separator_check \
makefile-check makefile-check
.PHONY: $(local-checks-available) .PHONY: $(local-checks-available)
@@ -114,6 +112,7 @@ syntax-check-rules = \
sc_system_h_headers \ sc_system_h_headers \
sc_tight_scope \ sc_tight_scope \
sc_trailing_blank \ sc_trailing_blank \
sc_two_space_separator_in_usage \
sc_unmarked_diagnostics \ sc_unmarked_diagnostics \
sc_useless_cpp_parens sc_useless_cpp_parens
@@ -156,7 +155,7 @@ sc_space_tab:
# They provide no error checking mechanism. # They provide no error checking mechanism.
# Instead, use strto* functions. # Instead, use strto* functions.
sc_prohibit_atoi_atof: sc_prohibit_atoi_atof:
@grep -nE '\<(ato[filq]|ato''ll)\>' $$($(CVS_LIST_EXCEPT)) && \ @grep -nE '\<ato([filq]|ll)\>' $$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): do not use ato''f, ato''i, ato''l, ato''ll, or ato''q' \ { echo '$(ME): do not use ato''f, ato''i, ato''l, ato''ll, or ato''q' \
1>&2; exit 1; } || : 1>&2; exit 1; } || :
@@ -215,8 +214,7 @@ sc_changelog:
dd_c = $(srcdir)/src/dd.c dd_c = $(srcdir)/src/dd.c
sc_dd_max_sym_length: sc_dd_max_sym_length:
ifneq ($(wildcard $(dd_c)),) ifneq ($(wildcard $(dd_c)),)
@test -f $(dd_c) || exit 0; \ @len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c); \
sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \ sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
|sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \ |sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
| wc --max-line-length); \ | wc --max-line-length); \
@@ -285,12 +283,19 @@ sc_trailing_blank:
{ echo '$(ME): found trailing blank(s)' \ { echo '$(ME): found trailing blank(s)' \
1>&2; exit 1; } || : 1>&2; exit 1; } || :
sc_two_space_separator_in_usage:
@grep -n '^ *--[a-z][0-9A-Za-z-]* [^ ].*\\$$' \
$$($(CVS_LIST_EXCEPT)) && \
{ echo "$(ME): help2man requires at least two spaces between"; \
echo "$(ME): an option and its description"; \
1>&2; exit 1; } || :
# Look for diagnostics that aren't marked for translation. # Look for diagnostics that aren't marked for translation.
# This won't find any for which error's format string is on a separate line. # This won't find any for which error's format string is on a separate line.
sc_unmarked_diagnostics: sc_unmarked_diagnostics:
@grep -nE \ @grep -nE \
'\<error \([^"]*"[^"]*[a-z]{3}' $$($(CVS_LIST_EXCEPT)) \ '\<error \([^"]*"[^"]*[a-z]{3}' $$($(CVS_LIST_EXCEPT)) \
| grep -v '_(' && \ | grep -v '_''(' && \
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \ { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
exit 1; } || : exit 1; } || :
@@ -348,13 +353,16 @@ m4-check:
exit 1; } || : exit 1; } || :
# Verify that all source files using _() are listed in po/POTFILES.in. # Verify that all source files using _() are listed in po/POTFILES.in.
# FIXME: don't hard-code src/false.c below; use a more general mechanism. # FIXME: don't hard-code file names below; use a more general mechanism.
po-check: po-check:
if test -f po/POTFILES.in; then \ if test -f po/POTFILES.in; then \
grep -E -v '^(#|$$)' po/POTFILES.in \ grep -E -v '^(#|$$)' po/POTFILES.in \
| grep -v '^src/false\.c$$' | sort > $@-1; \ | grep -v '^src/false\.c$$' | sort > $@-1; \
files=; \ files=; \
for file in lib/*.[chly] src/*.[chly]; do \ for file in $$($(CVS_LIST_EXCEPT)) lib/*.[ch]; do \
case $$file in \
djgpp/* | man/*) continue;; \
esac; \
case $$file in \ case $$file in \
*.[ch]) \ *.[ch]) \
base=`expr " $$file" : ' \(.*\)\..'`; \ base=`expr " $$file" : ' \(.*\)\..'`; \
@@ -362,7 +370,7 @@ po-check:
esac; \ esac; \
files="$$files $$file"; \ files="$$files $$file"; \
done; \ done; \
grep -E -l '\bN?_\([^)"]*("|$$)' $$files | sort > $@-2; \ grep -E -l '\bN?_\([^)"]*("|$$)' $$files | sort -u > $@-2; \
diff -u $@-1 $@-2 || exit 1; \ diff -u $@-1 $@-2 || exit 1; \
rm -f $@-1 $@-2; \ rm -f $@-1 $@-2; \
fi fi
@@ -482,16 +490,6 @@ my-distcheck: $(local-check) $(release_archive_dir)/$(prev-tgz)
WGET = wget WGET = wget
WGETFLAGS = -C off WGETFLAGS = -C off
tgz-md5 = $(shell md5sum < $(my_distdir).tar.gz|sed 's/ -//')
tgz-sha1 = $(shell sha1sum < $(my_distdir).tar.gz|sed 's/ -//')
bz2-md5 = $(shell md5sum < $(my_distdir).tar.bz2|sed 's/ -//')
bz2-sha1 = $(shell sha1sum < $(my_distdir).tar.bz2|sed 's/ -//')
xdelta-md5 = $(shell md5sum < $(xd-delta)|sed 's/ -//')
xdelta-sha1 = $(shell sha1sum < $(xd-delta)|sed 's/ -//')
tgz-size = $(shell du --human $(my_distdir).tar.gz|sed 's/\([MkK]\).*/ \1B/')
bz2-size = $(shell du --human $(my_distdir).tar.bz2|sed 's/\([MkK]\).*/ \1B/')
xd-size = $(shell du --human $(xd-delta)|sed 's/\([MkK]\).*/ \1B/')
rel-check: rel-check:
tarz=/tmp/rel-check-tarz-$$$$; \ tarz=/tmp/rel-check-tarz-$$$$; \
md5_tmp=/tmp/rel-check-md5-$$$$; \ md5_tmp=/tmp/rel-check-md5-$$$$; \