Blame cfg.mk

Packit 709fb3
# Customize maint.mk                           -*- makefile -*-
Packit 709fb3
# Copyright (C) 2009-2017 Free Software Foundation, Inc.
Packit 709fb3
Packit 709fb3
# This program is free software: you can redistribute it and/or modify
Packit 709fb3
# it under the terms of the GNU General Public License as published by
Packit 709fb3
# the Free Software Foundation, either version 3 of the License, or
Packit 709fb3
# (at your option) any later version.
Packit 709fb3
Packit 709fb3
# This program is distributed in the hope that it will be useful,
Packit 709fb3
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 709fb3
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 709fb3
# GNU General Public License for more details.
Packit 709fb3
Packit 709fb3
# You should have received a copy of the GNU General Public License
Packit 709fb3
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit 709fb3
Packit 709fb3
# Cause the tool(s) built by this package to be used also when running
Packit 709fb3
# commands via e.g., "make syntax-check".  Doing this a little sooner
Packit 709fb3
# would have avoided a grep infloop bug.
Packit 709fb3
export PATH := $(builddir)/src$(PATH_SEPARATOR)$(PATH)
Packit 709fb3
Packit 709fb3
# Used in maint.mk's web-manual rule
Packit 709fb3
manual_title = GNU Grep: Print lines matching a pattern
Packit 709fb3
Packit 709fb3
# Use the direct link.  This is guaranteed to work immediately, while
Packit 709fb3
# it can take a while for the faster mirror links to become usable.
Packit 709fb3
url_dir_list = http://ftp.gnu.org/gnu/$(PACKAGE)
Packit 709fb3
Packit 709fb3
# Tests not to run as part of "make distcheck".
Packit 709fb3
local-checks-to-skip =			\
Packit 709fb3
  sc_texinfo_acronym
Packit 709fb3
Packit 709fb3
# Tools used to bootstrap this package, used for "announcement".
Packit 709fb3
bootstrap-tools = autoconf,automake,gnulib
Packit 709fb3
Packit 709fb3
# Override the default Cc: used in generating an announcement.
Packit 709fb3
announcement_Cc_ = $(translation_project_), $(PACKAGE)-devel@gnu.org
Packit 709fb3
Packit 709fb3
# The tight_scope test gets confused about inline functions.
Packit 709fb3
# like 'to_uchar'.
Packit 709fb3
_gl_TS_unmarked_extern_functions = main usage mb_clen to_uchar dfaerror dfawarn
Packit 709fb3
Packit 709fb3
# Now that we have better tests, make this the default.
Packit 709fb3
export VERBOSE = yes
Packit 709fb3
Packit 709fb3
# Comparing tarball sizes compressed using different xz presets, we see
Packit 709fb3
# that -6e adds only 60 bytes to the size of the tarball, yet reduces
Packit 709fb3
# (from -9) the decompression memory requirement from 64 MiB to 9 MiB.
Packit 709fb3
# Don't be tempted by -5e, since -6 and -5 use the same dictionary size.
Packit 709fb3
# $ for i in {4,5,6,7,8,9}{e,}; do \
Packit 709fb3
#     (n=$(xz -$i < grep-2.11.tar|wc -c);echo $n $i) & done |sort -nr
Packit 709fb3
# 1236632 4
Packit 709fb3
# 1162564 5
Packit 709fb3
# 1140988 4e
Packit 709fb3
# 1139620 6
Packit 709fb3
# 1139480 7
Packit 709fb3
# 1139480 8
Packit 709fb3
# 1139480 9
Packit 709fb3
# 1129552 5e
Packit 709fb3
# 1127616 6e
Packit 709fb3
# 1127556 7e
Packit 709fb3
# 1127556 8e
Packit 709fb3
# 1127556 9e
Packit 709fb3
export XZ_OPT = -6e
Packit 709fb3
Packit 709fb3
old_NEWS_hash = a708c1088278e4d60e8e4ad2759228de
Packit 709fb3
Packit 709fb3
# Many m4 macros names once began with 'jm_'.
Packit 709fb3
# Make sure that none are inadvertently reintroduced.
Packit 709fb3
sc_prohibit_jm_in_m4:
Packit 709fb3
	@grep -nE 'jm_[A-Z]'						\
Packit 709fb3
		$$($(VC_LIST) m4 |grep '\.m4$$'; echo /dev/null) &&	\
Packit 709fb3
	    { echo '$(ME): do not use jm_ in m4 macro names'		\
Packit 709fb3
	      1>&2; exit 1; } || :
Packit 709fb3
Packit 709fb3
sc_prohibit_echo_minus_en:
Packit 709fb3
	@prohibit='\
Packit 709fb3
	halt='do not use echo ''-e or echo ''-n; use printf instead'	\
Packit 709fb3
	  $(_sc_search_regexp)
Packit 709fb3
Packit 709fb3
# Look for lines longer than 80 characters, except omit:
Packit 709fb3
# - program-generated long lines in diff headers,
Packit 709fb3
# - the help2man script copied from upstream,
Packit 709fb3
# - tests involving long checksum lines, and
Packit 709fb3
# - the 'pr' test cases.
Packit 709fb3
LINE_LEN_MAX = 80
Packit 709fb3
FILTER_LONG_LINES =							\
Packit 709fb3
  /^[^:]*\.diff:[^:]*:@@ / d;						\
Packit 709fb3
  \|^[^:]*TODO:| d;							\
Packit 709fb3
  \|^[^:]*man/help2man:| d;						\
Packit 709fb3
  \|^[^:]*tests/misc/sha[0-9]*sum.*\.pl[-:]| d;				\
Packit 709fb3
  \|^[^:]*tests/pr/|{ \|^[^:]*tests/pr/pr-tests:| !d; };
Packit 709fb3
sc_long_lines:
Packit 709fb3
	@files=$$($(VC_LIST_EXCEPT))					\
Packit 709fb3
	halt='line(s) with more than $(LINE_LEN_MAX) characters; reindent'; \
Packit 709fb3
	for file in $$files; do						\
Packit 709fb3
	  expand $$file | grep -nE '^.{$(LINE_LEN_MAX)}.' |		\
Packit 709fb3
	  sed -e "s|^|$$file:|" -e '$(FILTER_LONG_LINES)';		\
Packit 709fb3
	done | grep . && { msg="$$halt" $(_sc_say_and_exit) } || :
Packit 709fb3
Packit 709fb3
# Indent only with spaces.
Packit 709fb3
sc_prohibit_tab_based_indentation:
Packit 709fb3
	@prohibit='^ *	'						\
Packit 709fb3
	halt='TAB in indentation; use only spaces'			\
Packit 709fb3
	  $(_sc_search_regexp)
Packit 709fb3
Packit 709fb3
# Don't use "indent-tabs-mode: nil" anymore.  No longer needed.
Packit 709fb3
sc_prohibit_emacs__indent_tabs_mode__setting:
Packit 709fb3
	@prohibit='^( *[*#] *)?indent-tabs-mode:'			\
Packit 709fb3
	halt='use of emacs indent-tabs-mode: setting'			\
Packit 709fb3
	  $(_sc_search_regexp)
Packit 709fb3
Packit 709fb3
# Ensure that the list of test file names in tests/Makefile.am is sorted.
Packit 709fb3
sc_sorted_tests:
Packit 709fb3
	@perl -0777 -ne \
Packit 709fb3
	    '/^TESTS =(.*?)^$$/ms; ($$t = $$1) =~ s/[\\\s\n]+/\n/g;print $$t' \
Packit 709fb3
	  tests/Makefile.am | sort -c
Packit 709fb3
Packit 709fb3
# THANKS.in is a list of name/email pairs for people who are mentioned in
Packit 709fb3
# commit logs (and generated ChangeLog), but who are not also listed as an
Packit 709fb3
# author of a commit.  Name/email pairs of commit authors are automatically
Packit 709fb3
# extracted from the repository.  As a very minor factorization, when
Packit 709fb3
# someone who was initially listed only in THANKS.in later authors a commit,
Packit 709fb3
# this rule detects that their pair may now be removed from THANKS.in.
Packit 709fb3
sc_THANKS_in_duplicates:
Packit 709fb3
	@{ git log --pretty=format:%aN | sort -u;			\
Packit 709fb3
	    cut -b-36 THANKS.in | sed '/^$$/d;s/  *$$//'; }		\
Packit 709fb3
	  | sort | uniq -d | grep .					\
Packit 709fb3
	    && { echo '$(ME): remove the above names from THANKS.in'	\
Packit 709fb3
		  1>&2; exit 1; } || :
Packit 709fb3
Packit 709fb3
# Ensure that tests don't use `cmd ... && fail=1` as that hides crashes.
Packit 709fb3
# The "exclude" expression allows common idioms like `test ... && fail=1`
Packit 709fb3
# and the 2>... portion allows commands that redirect stderr and so probably
Packit 709fb3
# independently check its contents and thus detect any crash messages.
Packit 709fb3
sc_prohibit_and_fail_1:
Packit 709fb3
	@prohibit='&& fail=1'						\
Packit 709fb3
	exclude='(stat|kill|test |EGREP|grep|compare|2> *[^/])'		\
Packit 709fb3
	halt='&& fail=1 detected. Please use: returns_ 1 ... || fail=1'	\
Packit 709fb3
	in_vc_files='^tests/'						\
Packit 709fb3
	  $(_sc_search_regexp)
Packit 709fb3
Packit 709fb3
update-copyright-env = \
Packit 709fb3
  UPDATE_COPYRIGHT_USE_INTERVALS=1 \
Packit 709fb3
  UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79
Packit 709fb3
Packit 709fb3
include $(abs_top_srcdir)/dist-check.mk
Packit 709fb3
Packit 709fb3
exclude_file_name_regexp--sc_bindtextdomain = \
Packit 709fb3
  ^tests/get-mb-cur-max\.c$$
Packit 709fb3
Packit 709fb3
exclude_file_name_regexp--sc_prohibit_strcmp = /colorize-.*\.c$$
Packit 709fb3
exclude_file_name_regexp--sc_prohibit_xalloc_without_use = ^src/kwset\.c$$
Packit 709fb3
exclude_file_name_regexp--sc_prohibit_tab_based_indentation = \
Packit 709fb3
  (Makefile|\.(am|mk)$$)
Packit 709fb3
Packit 709fb3
exclude_file_name_regexp--sc_prohibit_doubled_word = ^tests/count-newline$$
Packit 709fb3
Packit 709fb3
exclude_file_name_regexp--sc_long_lines = ^tests/.*$$