1
# Customize Makefile.maint. -*- makefile -*-
2
# Copyright (C) 2008-2011 Red Hat, Inc.
3
# Copyright (C) 2003-2008 Free Software Foundation, Inc.
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 3 of the License, or
8
# (at your option) any later version.
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.
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/>.
18
# Tests not to run as part of "make distcheck".
19
local-checks-to-skip = \
23
makefile_path_separator_check \
26
sc_always_defined_macros \
27
sc_cast_of_alloca_return_value \
28
sc_cross_check_PATH_usage_in_tests \
29
sc_dd_max_sym_length \
30
sc_error_exit_success \
33
sc_makefile_path_separator_check \
35
sc_prohibit_always_true_header_tests \
36
sc_prohibit_S_IS_definition \
37
sc_prohibit_atoi_atof \
38
sc_prohibit_hash_without_use \
39
sc_prohibit_jm_in_m4 \
40
sc_prohibit_quote_without_use \
41
sc_prohibit_quotearg_without_use \
42
sc_prohibit_stat_st_blocks \
49
sc_two_space_separator_in_usage \
50
sc_error_message_uppercase \
52
sc_require_test_exit_idiom \
56
# Files that should never cause syntax check failures.
57
VC_LIST_ALWAYS_EXCLUDE_REGEX = \
58
(^HACKING|\.po|maint.mk)$$
60
# Functions like free() that are no-ops on NULL arguments.
61
useless_free_options = \
63
--name=xmlBufferFree \
66
--name=xmlXPathFreeContext \
67
--name=xmlXPathFreeObject
69
# Ensure that no C source file, docs, or rng schema uses TABs for
70
# indentation. Also match *.h.in files, to get libvirt.h.in. Exclude
71
# files in gnulib, since they're imported.
72
space_indent_files=(\.(rng|s?[ch](\.in)?|html.in|py)|(daemon|tools)/.*\.in)
73
sc_TAB_in_indentation:
75
in_vc_files='$(space_indent_files)$$' \
76
halt='indent with space, not TAB, in C, sh, html, py, and RNG schemas' \
79
# G_GNUC_UNUSED should only be applied in implementations, not
81
sc_avoid_attribute_unused_in_header:
82
@prohibit='^[^#]*G_GNUC_UNUSED([^:]|$$)' \
84
halt='use G_GNUC_UNUSED in .c rather than .h files' \
87
# Enforce recommended preprocessor indentation style.
88
sc_preprocessor_indentation:
89
@if cppi --version >/dev/null 2>&1; then \
90
$(VC_LIST_EXCEPT) | grep '\.[ch]$$' | xargs cppi -a -c \
91
|| { echo '$(ME): incorrect preprocessor indentation' 1>&2; \
94
echo '$(ME): skipping test $@: cppi not installed' 1>&2; \
98
@require='Copyright .*Red 'Hat', Inc\.' \
99
containing='Copyright .*Red 'Hat \
100
halt='Red Hat copyright is missing Inc.' \
102
@prohibit='Copyright [^(].*Red 'Hat \
103
halt='consistently use (C) in Red Hat copyright' \
105
@prohibit='\<Red''Hat\>' \
106
halt='spell Red Hat as two words' \
109
# We don't use this feature of maint.mk.
110
prev_version_file = /dev/null
112
# Give credit where due:
113
# Ensure that each commit author email address (possibly mapped via
114
# git log's .mailmap) appears in our AUTHORS file.
115
sc_check_author_list:
117
for i in $$(git log --pretty=format:%aE%n|sort -u|grep -v '^$$'); do \
118
sanitized=$$(echo "$$i"|LC_ALL=C sed 's/\([^a-zA-Z0-9_@-]\)/\\\1/g'); \
119
grep -iq "<$$sanitized>" $(srcdir)/AUTHORS \
120
|| { printf '%s\n' "$$i" >&2; fail=1; }; \
123
&& echo '$(ME): committer(s) not listed in AUTHORS' >&2; \
127
exclude_file_name_regexp--sc_bindtextdomain = ^examples/
129
exclude_file_name_regexp--sc_preprocessor_indentation = ^*/*.[ch]
131
exclude_file_name_regexp--sc_prohibit_strcmp = ^*/*.[ch]
133
exclude_file_name_regexp--sc_require_config_h = ^plugin/
134
exclude_file_name_regexp--sc_require_config_h_first = ^plugin/
136
exclude_file_name_regexp--sc_prohibit_magic_number_exit = ^src/keymap-gen.pl
138
# XXX we shouldn't really ignore this, but the horrible enum rules...
139
exclude_file_name_regexp--sc_makefile_at_at_check = src/Makefile.am