X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=build-aux%2Fmaint.mk;h=81952027eb75d32b7c467dab1b99e5d66d102ea5;hb=8b9a568d723459746c648f1a4fba4b0f1291d4a0;hp=bd12e92cae30bed4a1e0a492bc6bf56c0770cc60;hpb=fef71c83bc8291522ae54810ae9b4238ca13cf1a;p=gnulib.git diff --git a/build-aux/maint.mk b/build-aux/maint.mk index bd12e92ca..81952027e 100644 --- a/build-aux/maint.mk +++ b/build-aux/maint.mk @@ -41,17 +41,85 @@ export LC_ALL = C # Casting arguments to free is never necessary. sc_cast_of_argument_to_free: - @grep -nE '\&2; \ exit 1; } || : +sc_cast_of_x_alloc_return_value: + @grep -nE '\*\) *x(m|c|re)alloc\>' $(C_SOURCES) && \ + { echo '$(ME): don'\''t cast x*alloc return value' 1>&2; \ + exit 1; } || : + +sc_cast_of_alloca_return_value: + @grep -nE '\*\) *alloca\>' $(C_SOURCES) && \ + { echo '$(ME): don'\''t cast alloca return value' 1>&2; \ + exit 1; } || : + +sc_space_tab: + @grep -n '[ ] ' $(C_SOURCES) && \ + { echo '$(ME): found SPACE-TAB sequence; remove the SPACE' \ + 1>&2; exit 1; } || : + +# Don't use the old ato* functions in `real' code. +# They provide no error checking mechanism. +# Instead, use strto* functions. +sc_prohibit_atoi_atof: + @grep -nE '\' $(C_SOURCES) && \ + { echo '$(ME): do not use ato''f, ato''i, ato''l, ato''ll, or ato''q' \ + 1>&2; exit 1; } || : + +# Using EXIT_SUCCESS as the first argument to error is misleading, +# since when that parameter is 0, error does not exit. Use `0' instead. +sc_error_exit_success: + @grep -nF 'error (EXIT_SUCCESS,' $(C_SOURCES) && \ + { echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \ + exit 1; } || : + +# Stylistic, use #ifdef instead of #if +sc_no_if_have_config_h: + @grep -n '^# *if HAVE_CONFIG_H' $(C_SOURCES) && \ + { echo '$(ME): found use of #if HAVE_CONFIG_H; use #ifdef' \ + 1>&2; exit 1; } || : + +# Prohibit the inclusion of assert.h without an actual use of assert. +sc_prohibit_assert_without_use: + @files=$$(grep -l '# *include [<"]assert\.h[>"]' $(C_SOURCES) \ + | grep '\.[cy]$$') && \ + grep -L '\ but don't use it" \ + 1>&2; exit 1; } || : + +sc_obsolete_symbols: + @grep -nE '\<(HAVE''_FCNTL_H|O''_NDELAY)\>' $(C_SOURCES) && \ + { echo '$(ME): do not use HAVE''_FCNTL_H or O''_NDELAY' \ + 1>&2; exit 1; } || : + +# Each nonempty line must start with a year number, or a TAB. +sc_changelog: + @grep -n '^[^12 ]' $$(find . -name ChangeLog) && \ + { echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \ + exit 1; } || : + # Collect the names of rules starting with `sc_'. syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' $(ME)) .PHONY: $(syntax-check-rules) syntax-check: $(syntax-check-rules) +# Update gettext files. +PACKAGE ?= $(shell basename $(PWD)) +POURL = http://www.iro.umontreal.ca/translation/maint/$(PACKAGE)/ +PODIR ?= po +refresh-po: + rm -f $(PODIR)/*.po && \ + echo "$(ME): getting translations into po (please ignore the robots.txt ERROR 404)..." && \ + wget --no-verbose --directory-prefix $(PODIR) --no-directories --recursive --level 1 --accept .po --accept .po.1 $(POURL) && \ + echo 'en@boldquot' > $(PODIR)/LINGUAS && \ + echo 'en@quot' >> $(PODIR)/LINGUAS && \ + ls $(PODIR)/*.po | sed 's/.po//' | sed 's,$(PODIR)/,,' | sort >> $(PODIR)/LINGUAS + INDENT_SOURCES ?= $(C_SOURCES) .PHONY: indent indent: - indent $(C_SOURCES) + indent $(INDENT_SOURCES)