Recommend `sh -n' debugging, and public result variables for macros.
[autoconf.git] / maint.mk
blobbd74dfc92181fb8932f0c0045fedd86ed764e8a4
1 # -*-Makefile-*-
2 # This Makefile fragment tries to be general-purpose enough to be
3 # used by at least coreutils, idutils, CPPI, Bison, and Autoconf.
5 ## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
6 ## Free Software Foundation, Inc.
7 ##
8 ## This program is free software: you can redistribute it and/or modify
9 ## it under the terms of the GNU General Public License as published by
10 ## the Free Software Foundation, either version 3 of the License, or
11 ## (at your option) any later version.
13 ## This program is distributed in the hope that it will be useful,
14 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ## GNU General Public License for more details.
18 ## You should have received a copy of the GNU General Public License
19 ## along with this program. If not, see <http://www.gnu.org/licenses/>.
21 # This is reported not to work with make-3.79.1
22 # ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
23 ME := maint.mk
25 # Override this in cfg.mk if you use a non-standard build-aux directory.
26 build_aux ?= $(srcdir)/build-aux
28 # Do not save the original name or timestamp in the .tar.gz file.
29 # Use --rsyncable if available.
30 gzip_rsyncable := \
31 $(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null && echo --rsyncable)
32 GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
34 GIT = git
35 VC = $(GIT)
36 VC-tag = git tag -s -m '$(VERSION)'
38 VC_LIST = $(build_aux)/vc-list-files -C $(srcdir)
40 VC_LIST_EXCEPT = \
41 $(VC_LIST) | if test -f $(srcdir)/.x-$@; then \
42 grep -vEf $(srcdir)/.x-$@; \
43 else \
44 grep -v ChangeLog; \
47 ifeq ($(origin prev_version_file), undefined)
48 prev_version_file = $(srcdir)/.prev-version
49 endif
51 PREV_VERSION := $(shell cat $(prev_version_file))
52 VERSION_REGEXP = $(subst .,\.,$(VERSION))
54 this-vc-tag = v$(VERSION)
55 this-vc-tag-regexp = v$(VERSION_REGEXP)
56 my_distdir = $(PACKAGE)-$(VERSION)
58 # Old releases are stored here.
59 # Used for diffs.
60 release_archive_dir ?= ../release
62 # Prevent programs like 'sort' from considering distinct strings to be equal.
63 # Doing it here saves us from having to set LC_ALL elsewhere in this file.
64 export LC_ALL = C
68 ## --------------- ##
69 ## Sanity checks. ##
70 ## --------------- ##
72 # Collect the names of rules starting with `sc_'.
73 syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
74 $(srcdir)/$(ME))
75 .PHONY: $(syntax-check-rules)
77 local-checks-available = \
78 po-check copyright-check writable-files m4-check author_mark_check \
79 changelog-check patch-check strftime-check $(syntax-check-rules) \
80 makefile_path_separator_check \
81 makefile-check check-AUTHORS
82 .PHONY: $(local-checks-available)
84 local-check := $(filter-out $(local-checks-to-skip), $(local-checks-available))
86 syntax-check: $(local-check)
87 # @shopt -s nullglob; \
88 # grep -nE '# *include <(limits|std(def|arg|bool))\.h>' \
89 # $$(find -type f -name '*.[chly]') /dev/null && \
90 # { echo '$(ME): found conditional include' 1>&2; \
91 # exit 1; } || :
93 # grep -nE '^# *include <(string|stdlib)\.h>' \
94 # $(srcdir)/{lib,src}/*.[chly] /dev/null && \
95 # { echo '$(ME): FIXME' 1>&2; \
96 # exit 1; } || :
97 # FIXME: don't allow `#include .strings\.h' anywhere
99 sc_cast_of_argument_to_free:
100 @shopt -s nullglob; \
101 grep -nE '\<free \(\(' \
102 $(srcdir)/{lib,src}/*.[chly] /dev/null && \
103 { echo '$(ME): don'\''t cast free argument' 1>&2; \
104 exit 1; } || :
106 sc_cast_of_x_alloc_return_value:
107 @shopt -s nullglob; \
108 grep -nE --exclude=$(srcdir)/lib/regex.c \
109 '\*\) *x(m|c|re)alloc\>' \
110 $(srcdir)/{lib,src}/*.[chly] /dev/null && \
111 { echo '$(ME): don'\''t cast x*alloc return value' 1>&2; \
112 exit 1; } || :
114 sc_cast_of_alloca_return_value:
115 @shopt -s nullglob; \
116 grep -nE '\*\) *alloca\>' \
117 $(srcdir)/src/*.[chly] /dev/null && \
118 { echo '$(ME): don'\''t cast alloca return value' 1>&2; \
119 exit 1; } || :
121 sc_space_tab:
122 @grep -n '[ ] ' $$($(VC_LIST_EXCEPT)) && \
123 { echo '$(ME): found SPACE-TAB sequence; remove the SPACE' \
124 1>&2; exit 1; } || :
126 # Don't use *scanf or the old ato* functions in `real' code.
127 # They provide no error checking mechanism.
128 # Instead, use strto* functions.
129 sc_prohibit_atoi_atof:
130 @grep -nE '\<([fs]?scanf|ato([filq]|ll))\>' $$($(VC_LIST_EXCEPT)) && \
131 { echo '$(ME): do not use *scan''f, ato''f, ato''i, ato''l, ato''ll, ato''q, or ss''canf' \
132 1>&2; exit 1; } || :
134 # Using EXIT_SUCCESS as the first argument to error is misleading,
135 # since when that parameter is 0, error does not exit. Use `0' instead.
136 sc_error_exit_success:
137 @grep -nF 'error (EXIT_SUCCESS,' \
138 $$(find -type f -name '*.[chly]') /dev/null && \
139 { echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \
140 exit 1; } || :
142 sc_file_system:
143 @grep -ni 'file''system' $$($(VC_LIST_EXCEPT)) \
144 | grep -v 'File''system Hierarchy Standard' && \
145 { echo '$(ME): found use of "file''system";' \
146 'rewrite to use "file system"' 1>&2; \
147 exit 1; } || :
149 sc_no_have_config_h:
150 @grep -n '^# *if.*HAVE''_CONFIG_H' $$($(VC_LIST_EXCEPT)) && \
151 { echo '$(ME): found use of HAVE''_CONFIG_H; remove' \
152 1>&2; exit 1; } || :
154 # Nearly all .c files must include <config.h>.
155 sc_require_config_h:
156 @if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
157 grep -L '^# *include <config\.h>' \
158 $$($(VC_LIST_EXCEPT) | grep '\.c$$') \
159 | grep . && \
160 { echo '$(ME): the above files do not include <config.h>' \
161 1>&2; exit 1; } || :; \
162 else :; \
165 # To use this "command" macro, you must first define two shell variables:
166 # h: the header, enclosed in <> or ""
167 # re: a regular expression that matches IFF something provided by $h is used.
168 define _header_without_use
169 h_esc=`echo "$$h"|sed 's/\./\\./'`; \
170 if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
171 files=$$(grep -l '^# *include '"$$h_esc" \
172 $$($(VC_LIST_EXCEPT) | grep '\.c$$')) && \
173 grep -LE "$$re" $$files | grep . && \
174 { echo "$(ME): the above files include $$h but don't use it" \
175 1>&2; exit 1; } || :; \
176 else :; \
178 endef
180 # Prohibit the inclusion of assert.h without an actual use of assert.
181 sc_prohibit_assert_without_use:
182 @h='<assert.h>' re='\<assert *\(' $(_header_without_use)
184 # Prohibit the inclusion of getopt.h without an actual use.
185 sc_prohibit_getopt_without_use:
186 @h='<getopt.h>' re='\<getopt(_long)? *\(' $(_header_without_use)
188 # Don't include quotearg.h unless you use one of its functions.
189 sc_prohibit_quotearg_without_use:
190 @h='"quotearg.h"' re='\<quotearg(_[^ ]+)? *\(' $(_header_without_use)
192 # Don't include quote.h unless you use one of its functions.
193 sc_prohibit_quote_without_use:
194 @h='"quote.h"' re='\<quote(_n)? *\(' $(_header_without_use)
196 # Don't include this header unless you use one of its functions.
197 sc_prohibit_long_options_without_use:
198 @h='"long-options.h"' re='\<parse_long_options *\(' \
199 $(_header_without_use)
201 # Don't include this header unless you use one of its functions.
202 sc_prohibit_inttostr_without_use:
203 @h='"inttostr.h"' re='\<(off|[iu]max|uint)tostr *\(' \
204 $(_header_without_use)
206 # Don't include this header unless you use one of its functions.
207 sc_prohibit_error_without_use:
208 @h='"error.h"' \
209 re='\<error(_at_line|_print_progname|_one_per_line|_message_count)? *\('\
210 $(_header_without_use)
212 sc_prohibit_safe_read_without_use:
213 @h='"safe-read.h"' re='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \
214 $(_header_without_use)
216 sc_prohibit_argmatch_without_use:
217 @h='"argmatch.h"' \
218 re='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<argmatch(_exit_fn|_(in)?valid) *\()' \
219 $(_header_without_use)
221 sc_prohibit_root_dev_ino_without_use:
222 @h='"root-dev-ino.h"' \
223 re='(\<ROOT_DEV_INO_(CHECK|WARN)\>|\<get_root_dev_ino *\()' \
224 $(_header_without_use)
226 sc_obsolete_symbols:
227 @grep -nE '\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
228 $$($(VC_LIST_EXCEPT)) && \
229 { echo '$(ME): do not use HAVE''_FCNTL_H or O''_NDELAY' \
230 1>&2; exit 1; } || :
232 # FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
234 # Each nonempty line must start with a year number, or a TAB.
235 sc_changelog:
236 @grep -n '^[^12 ]' $$(find $(srcdir) -maxdepth 2 -name ChangeLog) && \
237 { echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \
238 exit 1; } || :
240 # Ensure that dd's definition of LONGEST_SYMBOL stays in sync
241 # with the strings from the two affected variables.
242 dd_c = $(srcdir)/src/dd.c
243 sc_dd_max_sym_length:
244 ifneq ($(wildcard $(dd_c)),)
245 @len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
246 sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
247 |sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
248 | wc --max-line-length); \
249 max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
250 |tr -d '"' | wc --max-line-length); \
251 if test "$$len" = "$$max"; then :; else \
252 echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \
253 exit 1; \
255 endif
257 # Many m4 macros names once began with `jm_'.
258 # On 2004-04-13, they were all changed to start with gl_ instead.
259 # Make sure that none are inadvertently reintroduced.
260 sc_prohibit_jm_in_m4:
261 @grep -nE 'jm_[A-Z]' \
262 $$($(VC_LIST) m4 |grep '\.m4$$') && \
263 { echo '$(ME): do not use jm_ in m4 macro names' \
264 1>&2; exit 1; } || :
266 sc_root_tests:
267 @t1=sc-root.expected; t2=sc-root.actual; \
268 grep -nl '^PRIV_CHECK_ARG=require-root' \
269 $$($(VC_LIST) tests) |sed s/tests/./ |sort > $$t1; \
270 sed -n 's, cd \([^ ]*\) .*MAKE..check TESTS=\(.*\),./\1/\2,p' \
271 $(srcdir)/tests/Makefile.am |sort > $$t2; \
272 diff -u $$t1 $$t2 || diff=1; \
273 rm -f $$t1 $$t2; \
274 test "$$diff" \
275 && { echo 'tests/Makefile.am: missing check-root action'>&2; \
276 exit 1; } || :
278 # Files in src/ should not include directly any of
279 # the headers already included via system.h.
280 sc_system_h_headers:
281 @if test -f $(srcdir)/src/system.h; then \
282 pat=$$( \
283 sed -n '/^# *include /s///p' $(srcdir)/src/system.h /dev/null \
284 | grep -Ev 'sys/(param|file)\.h' \
285 | sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
286 ) && \
287 grep -nE -f "$pat" \
288 $$($(VC_LIST) src | \
289 grep -Ev '((copy|system)\.h|parse-gram\.c)$$') \
290 && { echo '$(ME): the above are already included via system.h'\
291 1>&2; exit 1; } || :; \
294 sc_sun_os_names:
295 @grep -nEi \
296 'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
297 $$($(VC_LIST_EXCEPT)) && \
298 { echo '$(ME): found misuse of Sun OS version numbers' 1>&2; \
299 exit 1; } || :
301 sc_the_the:
302 @grep -ni '\<the ''the\>' $$($(VC_LIST_EXCEPT)) && \
303 { echo '$(ME): found use of "the ''the";' 1>&2; \
304 exit 1; } || :
306 sc_tight_scope:
307 test ! -d src || $(MAKE) -C src $@
309 sc_trailing_blank:
310 @grep -n '[ ]$$' $$($(VC_LIST_EXCEPT)) && \
311 { echo '$(ME): found trailing blank(s)' \
312 1>&2; exit 1; } || :
314 # Match lines like the following, but where there is only one space
315 # between the options and the description:
316 # -D, --all-repeated[=delimit-method] print all duplicate lines\n
317 longopt_re = --[a-z][0-9A-Za-z-]*(\[?=[0-9A-Za-z-]*\]?)?
318 sc_two_space_separator_in_usage:
319 @grep -nE '^ *(-[A-Za-z],)? $(longopt_re) [^ ].*\\$$' \
320 $$($(VC_LIST_EXCEPT)) && \
321 { echo "$(ME): help2man requires at least two spaces between"; \
322 echo "$(ME): an option and its description"; \
323 1>&2; exit 1; } || :
325 # Look for diagnostics that aren't marked for translation.
326 # This won't find any for which error's format string is on a separate line.
327 sc_unmarked_diagnostics:
328 @grep -nE \
329 '\<error \([^"]*"[^"]*[a-z]{3}' $$($(VC_LIST_EXCEPT)) \
330 | grep -v '_''(' && \
331 { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
332 exit 1; } || :
334 # Avoid useless parentheses like those in this example:
335 # #if defined (SYMBOL) || defined (SYM2)
336 sc_useless_cpp_parens:
337 @grep -n '^# *if .*defined *(' $$($(VC_LIST_EXCEPT)) && \
338 { echo '$(ME): found useless parentheses in cpp directive' \
339 1>&2; exit 1; } || :
341 # Ensure that the c99-to-c89 patch applies cleanly.
342 patch-check:
343 if test -f src/c99-to-c89.diff; then \
344 rm -rf src-c89 $@.1 $@.2 && \
345 cp -a src src-c89 && \
346 (cd src-c89; patch -V never --fuzz=0) < src/c99-to-c89.diff \
347 > $@.1 2>&1 && \
348 { grep -v '^patching file ' $@.1 > $@.2 || :; } && \
349 test -s $@.2 && \
350 rm -rf src-c89 $@.1 $@.2; \
353 # Ensure that date's --help output stays in sync with the info
354 # documentation for GNU strftime. The only exception is %N,
355 # which date accepts but GNU strftime does not.
356 extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
357 strftime-check:
358 if test -f $(srcdir)/src/date.c; then \
359 grep '^ %. ' $(srcdir)/src/date.c | sort \
360 | $(extract_char) > $@-src; \
361 { echo N; \
362 info libc date calendar format | grep '^ `%.'\' \
363 | $(extract_char); } | sort > $@-info; \
364 diff -u $@-src $@-info || exit 1; \
365 rm -f $@-src $@-info; \
368 check-AUTHORS:
369 test ! -d src || $(MAKE) -C src $@
371 # Ensure that we use only the standard $(VAR) notation,
372 # not @...@ in Makefile.am, now that we can rely on automake
373 # to emit a definition for each substituted variable.
374 makefile-check:
375 grep -nE '@[A-Z_0-9]+@' `find $(srcdir) -name Makefile.am` \
376 && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
378 news-date-check: NEWS
379 today=`date +%Y-%m-%d`; \
380 if head NEWS | grep '^\*.* $(VERSION_REGEXP) ('$$today')' \
381 >/dev/null; then \
382 :; \
383 else \
384 echo "version or today's date is not in NEWS" 1>&2; \
385 exit 1; \
388 changelog-check:
389 if head ChangeLog | grep 'Version $(VERSION_REGEXP)\.$$' \
390 >/dev/null; then \
391 :; \
392 else \
393 echo "$(VERSION) not in ChangeLog" 1>&2; \
394 exit 1; \
397 m4-check:
398 @shopt -s nullglob; \
399 grep 'AC_DEFUN([^[]' m4/*.m4 /dev/null \
400 && { echo '$(ME): quote the first arg to AC_DEFUN' 1>&2; \
401 exit 1; } || :
403 # Verify that all source files using _() are listed in po/POTFILES.in.
404 # FIXME: don't hard-code file names below; use a more general mechanism.
405 po-check:
406 if test -f po/POTFILES.in; then \
407 grep -E -v '^(#|$$)' po/POTFILES.in \
408 | grep -v '^src/false\.c$$' | sort > $@-1; \
409 files=; \
410 for file in $$($(VC_LIST_EXCEPT)) lib/*.[ch]; do \
411 case $$file in \
412 djgpp/* | man/*) continue;; \
413 */c99-to-c89.diff) continue;; \
414 esac; \
415 case $$file in \
416 *.[ch]) \
417 base=`expr " $$file" : ' \(.*\)\..'`; \
418 { test -f $$base.l || test -f $$base.y; } && continue;; \
419 esac; \
420 files="$$files $$file"; \
421 done; \
422 grep -E -l '\b(N?_|gettext *)\([^)"]*("|$$)' $$files \
423 | sort -u > $@-2; \
424 diff -u $@-1 $@-2 || exit 1; \
425 rm -f $@-1 $@-2; \
428 # In a definition of #define AUTHORS "... and ..." where the RHS contains
429 # the English word `and', the string must be marked with `N_ (...)' so that
430 # gettext recognizes it as a string requiring translation.
431 author_mark_check:
432 @shopt -s nullglob; \
433 grep -n '^# *define AUTHORS "[^"]* and ' src/*.c /dev/null \
434 | grep -v ' N_ (' && \
435 { echo '$(ME): enclose the above strings in N_ (...)' 1>&2; \
436 exit 1; } || :
438 # Sometimes it is useful to change the PATH environment variable
439 # in Makefiles. When doing so, it's better not to use the Unix-centric
440 # path separator of `:', but rather the automake-provided `@PATH_SEPARATOR@'.
441 # It'd be better to use `find -print0 ...|xargs -0 ...', but less portable,
442 # and there probably aren't many projects with so many Makefile.am files
443 # that we'd have to worry about limits on command line length.
444 msg = '$(ME): Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
445 makefile_path_separator_check:
446 @grep -n 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
447 && { echo $(msg) 1>&2; exit 1; } || :
449 # Check that `make alpha' will not fail at the end of the process.
450 writable-files:
451 if test -d $(release_archive_dir); then :; else \
452 mkdir $(release_archive_dir); \
454 for file in $(distdir).tar.gz $(xd-delta) \
455 $(release_archive_dir)/$(distdir).tar.gz \
456 $(release_archive_dir)/$(xd-delta); do \
457 test -e $$file || continue; \
458 test -w $$file \
459 || { echo ERROR: $$file is not writable; fail=1; }; \
460 done; \
461 test "$$fail" && exit 1 || :
463 v_etc_file = lib/version-etc.c
464 # Make sure that the copyright date in $(v_etc_file) is up to date.
465 copyright-check:
466 @if test -f $(v_etc_file); then \
467 grep 'enum { COPYRIGHT_YEAR = '$$(date +%Y)' };' $(v_etc_file) \
468 >/dev/null \
469 || { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
470 exit 1; }; \
473 vc-diff-check:
474 (CDPATH=; cd $(srcdir) && $(VC) diff) > vc-diffs || :
475 if test -s vc-diffs; then \
476 cat vc-diffs; \
477 echo "Some files are locally modified:" 1>&2; \
478 exit 1; \
479 else \
480 rm vc-diffs; \
483 cvs-check: vc-diff-check
485 maintainer-distcheck:
486 $(MAKE) distcheck
487 $(MAKE) -C tests $(AM_MAKEFLAGS) maintainer-check
488 $(MAKE) my-distcheck
490 # Don't make a distribution if checks fail.
491 # Also, make sure the NEWS file is up-to-date.
492 vc-dist: $(local-check) cvs-check maintainer-distcheck
493 $(MAKE) dist
495 # Use this to make sure we don't run these programs when building
496 # from a virgin tgz file, below.
497 null_AM_MAKEFLAGS = \
498 ACLOCAL=false \
499 AUTOCONF=false \
500 AUTOMAKE=false \
501 AUTOHEADER=false \
502 MAKEINFO=false
504 # Detect format-string/arg-list mismatches that would normally be obscured
505 # by the use of _(). The --disable-nls effectively defines away that macro,
506 # and building with CFLAGS='-Wformat -Werror' causes any format warning to be
507 # treated as a failure. Also, check for shadowing problems with -Wshadow,
508 # and for pointer arithmetic problems with -Wpointer-arith.
509 # These CFLAGS are pretty strict. If you build this target, you probably
510 # have to have a recent version of gcc and glibc headers.
511 TMPDIR ?= /tmp
512 t=$(TMPDIR)/$(PACKAGE)/test
513 my-distcheck: $(local-check) $(release_archive_dir)/$(prev-tgz)
514 -rm -rf $(t)
515 mkdir -p $(t)
516 GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
517 cd $(t)/$(distdir) \
518 && ./configure --disable-nls \
519 && $(MAKE) CFLAGS='-Werror -Wall -Wformat -Wshadow -Wpointer-arith' \
520 AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
521 && $(MAKE) dvi \
522 && $(MAKE) check \
523 && $(MAKE) distclean
524 (cd $(t) && mv $(distdir) $(distdir).old \
525 && $(AMTAR) -zxf - ) < $(distdir).tar.gz
526 diff -ur $(t)/$(distdir).old $(t)/$(distdir)
527 -rm -rf $(t)
528 @echo "========================"; \
529 echo "$(distdir).tar.gz is ready for distribution"; \
530 echo "========================"
532 prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
534 rel-files = $(DIST_ARCHIVES)
535 announcement: NEWS ChangeLog $(rel-files)
536 @$(announce_gen) \
537 --release-type=$(RELEASE_TYPE) \
538 --package=$(PACKAGE) \
539 --prev=$(PREV_VERSION) \
540 --curr=$(VERSION) \
541 --gpg-key-id=$(gpg_key_ID) \
542 --news=$(srcdir)/NEWS \
543 --bootstrap-tools=automake \
544 $(addprefix --url-dir=, $(url_dir_list))
546 ## ---------------- ##
547 ## Updating files. ##
548 ## ---------------- ##
550 ftp-gnu = ftp://ftp.gnu.org/gnu
551 www-gnu = http://www.gnu.org
553 # Use mv, if you don't have/want move-if-change.
554 move_if_change ?= move-if-change
556 emit_upload_commands:
557 @echo =====================================
558 @echo =====================================
559 @echo "$(build_aux)/gnupload $(GNUPLOADFLAGS) \\"
560 @echo " --to $(gnu_rel_host):$(PACKAGE) \\"
561 @echo " $(rel-files)"
562 @echo '# send the /tmp/announcement e-mail'
563 @echo =====================================
564 @echo =====================================
566 .PHONY: alpha beta major
567 alpha beta major: news-date-check changelog-check $(local-check)
568 test $@ = major \
569 && { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$' \
570 || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\
571 || :
572 $(MAKE) vc-dist
573 $(MAKE) $(xd-delta)
574 $(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
575 ln $(rel-files) $(release_archive_dir)
576 chmod a-w $(rel-files)
577 $(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
578 echo $(VERSION) > $(prev_version_file)
579 $(VC) commit -m \
580 '$(prev_version_file): Record previous version: $(VERSION).' \
581 $(prev_version_file)
584 .PHONY: web-manual
585 web-manual:
586 @test -z "$(manual_title)" \
587 && { echo define manual_title in cfg.mk 1>&2; exit 1; } || :
588 @cd '$(srcdir)/doc'; \
589 $(SHELL) ../build-aux/gendocs.sh -o '$(abs_builddir)/doc/manual' \
590 --email $(PACKAGE_BUGREPORT) $(PACKAGE) \
591 "$(PACKAGE_NAME) - $(manual_title)"
592 @echo " *** Upload the doc/manual directory to web-cvs."
594 # If you want to set UPDATE_COPYRIGHT_* environment variables,
595 # put the assignments in this variable.
596 update-copyright-env ?=
598 # Run this rule once per year (usually early in January)
599 # to update all FSF copyright year lists in your project.
600 # If you have an additional project-specific rule,
601 # add it in cfg.mk along with a line 'update-copyright: prereq'.
602 # By default, exclude all variants of COPYING; you can also
603 # add exemptions (such as ChangeLog..* for rotated change logs)
604 # in the file .x-update-copyright.
605 .PHONY: update-copyright
606 update-copyright:
607 grep -l -w Copyright $$($(VC_LIST_EXCEPT)) \
608 $(srcdir)/ChangeLog | grep -v COPYING \
609 | $(update-copyright-env) xargs $(build_aux)/$@