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 = \
22 makefile_path_separator_check \
25 sc_always_defined_macros \
26 sc_cast_of_alloca_return_value \
27 sc_cross_check_PATH_usage_in_tests \
28 sc_dd_max_sym_length \
29 sc_error_exit_success \
32 sc_makefile_path_separator_check \
34 sc_prohibit_always_true_header_tests \
35 sc_prohibit_S_IS_definition \
36 sc_prohibit_atoi_atof \
37 sc_prohibit_hash_without_use \
38 sc_prohibit_jm_in_m4 \
39 sc_prohibit_quote_without_use \
40 sc_prohibit_quotearg_without_use \
41 sc_prohibit_stat_st_blocks \
48 sc_two_space_separator_in_usage \
49 sc_error_message_uppercase \
51 sc_require_test_exit_idiom \
53 sc_useless_cpp_parens \
54 sc_preprocessor_indentation
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 = \
64 # Ensure that no C source file, docs, or rng schema uses TABs for
65 # indentation. Also match *.h.in files, to get libvirt.h.in. Exclude
66 # files in gnulib, since they're imported.
67 space_indent_files=(\.(rng|s?[ch](\.in)?|html.in|py)|(daemon|tools)/.*\.in)
68 sc_TAB_in_indentation:
70 in_vc_files='$(space_indent_files)$$' \
71 halt='indent with space, not TAB, in C, sh, html, py, and RNG schemas' \
74 # G_GNUC_UNUSED should only be applied in implementations, not
76 sc_avoid_attribute_unused_in_header:
77 @prohibit='^[^#]*G_GNUC_UNUSED([^:]|$$)' \
79 halt='use G_GNUC_UNUSED in .c rather than .h files' \
82 # Enforce recommended preprocessor indentation style.
83 sc_preprocessor_indentation:
84 @if cppi --version >/dev/null 2>&1; then \
85 $(VC_LIST_EXCEPT) | grep '\.[ch]$$' | xargs cppi -a -c \
86 || { echo '$(ME): incorrect preprocessor indentation' 1>&2; \
89 echo '$(ME): skipping test $@: cppi not installed' 1>&2; \
93 @require='Copyright .*Red 'Hat', Inc\.' \
94 containing='Copyright .*Red 'Hat \
95 halt='Red Hat copyright is missing Inc.' \
97 @prohibit='Copyright [^(].*Red 'Hat \
98 halt='consistently use (C) in Red Hat copyright' \
100 @prohibit='\<Red''Hat\>' \
101 halt='spell Red Hat as two words' \
104 # We don't use this feature of maint.mk.
105 prev_version_file = /dev/null
108 msg_gen_function += g_error
109 msg_gen_function += g_set_error
110 msg_gen_function += ENTANGLE_ERROR
113 func_or := $(shell printf '$(msg_gen_function)'|tr -s '[[:space:]]' '|')
114 func_re := ($(func_or))
116 # Look for diagnostics that aren't marked for translation.
117 # This won't find any for which error's format string is on a separate line.
118 # The sed filters eliminate false-positives like these:
120 # "%s", _("no storage vol w..."
121 sc_libvirt_unmarked_diagnostics:
123 '\<$(func_re) *\([^"]*"[^"]*[a-z]{3}' $$($(VC_LIST_EXCEPT)) \
124 | grep -v '_''(' && \
125 { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
127 @{ grep -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \
128 grep -A1 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \
129 | sed 's/_("[^"][^"]*"//;s/[ ]"%s"//' \
131 { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
134 exclude_file_name_regexp--sc_prohibit_strcmp = ^*/*.[ch]
136 # Due to enum rules - fixme
137 exclude_file_name_regexp--sc_makefile_at_at_check = ^src/Makefile.am
139 exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = ^(docs|src)/.*\.png
141 exclude_file_name_regexp--sc_prohibit_test_minus_ao = git.mk
143 exclude_file_name_regexp--sc_trailing_blank = (src|docs)/.*\.(ep|png|icc)