Recommend latest m4 release.
[autoconf.git] / maint.mk
blob7696c96d971d45e31c9732682dd037a56d530274
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 ## 2010 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 # Override gnu_rel_host and url_dir_list in cfg.mk if these are not right.
63 # Use alpha.gnu.org for alpha and beta releases.
64 # Use ftp.gnu.org for stable releases.
65 gnu_ftp_host-alpha = alpha.gnu.org
66 gnu_ftp_host-beta = alpha.gnu.org
67 gnu_ftp_host-stable = ftp.gnu.org
68 gnu_rel_host ?= $(gnu_ftp_host-$(RELEASE_TYPE))
70 ifeq ($(gnu_rel_host),ftp.gnu.org)
71 url_dir_list ?= http://ftpmirror.gnu.org/$(PACKAGE)
72 else
73 url_dir_list ?= ftp://$(gnu_rel_host)/gnu/$(PACKAGE)
74 endif
76 # Prevent programs like 'sort' from considering distinct strings to be equal.
77 # Doing it here saves us from having to set LC_ALL elsewhere in this file.
78 export LC_ALL = C
82 ## --------------- ##
83 ## Sanity checks. ##
84 ## --------------- ##
86 # Collect the names of rules starting with `sc_'.
87 syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
88 $(srcdir)/$(ME))
89 .PHONY: $(syntax-check-rules)
91 local-checks-available = \
92 po-check copyright-check writable-files m4-check author_mark_check \
93 changelog-check patch-check strftime-check $(syntax-check-rules) \
94 makefile_path_separator_check \
95 makefile-check check-AUTHORS
96 .PHONY: $(local-checks-available)
98 local-check := $(filter-out $(local-checks-to-skip), $(local-checks-available))
100 syntax-check: $(local-check)
101 # @shopt -s nullglob; \
102 # grep -nE '# *include <(limits|std(def|arg|bool))\.h>' \
103 # $$(find -type f -name '*.[chly]') /dev/null && \
104 # { echo '$(ME): found conditional include' 1>&2; \
105 # exit 1; } || :
107 # grep -nE '^# *include <(string|stdlib)\.h>' \
108 # $(srcdir)/{lib,src}/*.[chly] /dev/null && \
109 # { echo '$(ME): FIXME' 1>&2; \
110 # exit 1; } || :
111 # FIXME: don't allow `#include .strings\.h' anywhere
113 sc_cast_of_argument_to_free:
114 @shopt -s nullglob; \
115 grep -nE '\<free \(\(' \
116 $(srcdir)/{lib,src}/*.[chly] /dev/null && \
117 { echo '$(ME): don'\''t cast free argument' 1>&2; \
118 exit 1; } || :
120 sc_cast_of_x_alloc_return_value:
121 @shopt -s nullglob; \
122 grep -nE --exclude=$(srcdir)/lib/regex.c \
123 '\*\) *x(m|c|re)alloc\>' \
124 $(srcdir)/{lib,src}/*.[chly] /dev/null && \
125 { echo '$(ME): don'\''t cast x*alloc return value' 1>&2; \
126 exit 1; } || :
128 sc_cast_of_alloca_return_value:
129 @shopt -s nullglob; \
130 grep -nE '\*\) *alloca\>' \
131 $(srcdir)/src/*.[chly] /dev/null && \
132 { echo '$(ME): don'\''t cast alloca return value' 1>&2; \
133 exit 1; } || :
135 sc_space_tab:
136 @grep -n '[ ] ' $$($(VC_LIST_EXCEPT)) && \
137 { echo '$(ME): found SPACE-TAB sequence; remove the SPACE' \
138 1>&2; exit 1; } || :
140 # Don't use *scanf or the old ato* functions in `real' code.
141 # They provide no error checking mechanism.
142 # Instead, use strto* functions.
143 sc_prohibit_atoi_atof:
144 @grep -nE '\<([fs]?scanf|ato([filq]|ll))\>' $$($(VC_LIST_EXCEPT)) && \
145 { echo '$(ME): do not use *scan''f, ato''f, ato''i, ato''l, ato''ll, ato''q, or ss''canf' \
146 1>&2; exit 1; } || :
148 # Using EXIT_SUCCESS as the first argument to error is misleading,
149 # since when that parameter is 0, error does not exit. Use `0' instead.
150 sc_error_exit_success:
151 @grep -nF 'error (EXIT_SUCCESS,' \
152 $$(find -type f -name '*.[chly]') /dev/null && \
153 { echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \
154 exit 1; } || :
156 sc_file_system:
157 @grep -ni 'file''system' $$($(VC_LIST_EXCEPT)) \
158 | grep -v 'File''system Hierarchy Standard' && \
159 { echo '$(ME): found use of "file''system";' \
160 'rewrite to use "file system"' 1>&2; \
161 exit 1; } || :
163 sc_no_have_config_h:
164 @grep -n '^# *if.*HAVE''_CONFIG_H' $$($(VC_LIST_EXCEPT)) && \
165 { echo '$(ME): found use of HAVE''_CONFIG_H; remove' \
166 1>&2; exit 1; } || :
168 # Nearly all .c files must include <config.h>.
169 sc_require_config_h:
170 @if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
171 grep -L '^# *include <config\.h>' \
172 $$($(VC_LIST_EXCEPT) | grep '\.c$$') \
173 | grep . && \
174 { echo '$(ME): the above files do not include <config.h>' \
175 1>&2; exit 1; } || :; \
176 else :; \
179 # To use this "command" macro, you must first define two shell variables:
180 # h: the header, enclosed in <> or ""
181 # re: a regular expression that matches IFF something provided by $h is used.
182 define _header_without_use
183 h_esc=`echo "$$h"|sed 's/\./\\./'`; \
184 if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
185 files=$$(grep -l '^# *include '"$$h_esc" \
186 $$($(VC_LIST_EXCEPT) | grep '\.c$$')) && \
187 grep -LE "$$re" $$files | grep . && \
188 { echo "$(ME): the above files include $$h but don't use it" \
189 1>&2; exit 1; } || :; \
190 else :; \
192 endef
194 # Prohibit the inclusion of assert.h without an actual use of assert.
195 sc_prohibit_assert_without_use:
196 @h='<assert.h>' re='\<assert *\(' $(_header_without_use)
198 # Prohibit the inclusion of getopt.h without an actual use.
199 sc_prohibit_getopt_without_use:
200 @h='<getopt.h>' re='\<getopt(_long)? *\(' $(_header_without_use)
202 # Don't include quotearg.h unless you use one of its functions.
203 sc_prohibit_quotearg_without_use:
204 @h='"quotearg.h"' re='\<quotearg(_[^ ]+)? *\(' $(_header_without_use)
206 # Don't include quote.h unless you use one of its functions.
207 sc_prohibit_quote_without_use:
208 @h='"quote.h"' re='\<quote(_n)? *\(' $(_header_without_use)
210 # Don't include this header unless you use one of its functions.
211 sc_prohibit_long_options_without_use:
212 @h='"long-options.h"' re='\<parse_long_options *\(' \
213 $(_header_without_use)
215 # Don't include this header unless you use one of its functions.
216 sc_prohibit_inttostr_without_use:
217 @h='"inttostr.h"' re='\<(off|[iu]max|uint)tostr *\(' \
218 $(_header_without_use)
220 # Don't include this header unless you use one of its functions.
221 sc_prohibit_error_without_use:
222 @h='"error.h"' \
223 re='\<error(_at_line|_print_progname|_one_per_line|_message_count)? *\('\
224 $(_header_without_use)
226 sc_prohibit_safe_read_without_use:
227 @h='"safe-read.h"' re='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \
228 $(_header_without_use)
230 sc_prohibit_argmatch_without_use:
231 @h='"argmatch.h"' \
232 re='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<argmatch(_exit_fn|_(in)?valid) *\()' \
233 $(_header_without_use)
235 sc_prohibit_root_dev_ino_without_use:
236 @h='"root-dev-ino.h"' \
237 re='(\<ROOT_DEV_INO_(CHECK|WARN)\>|\<get_root_dev_ino *\()' \
238 $(_header_without_use)
240 sc_obsolete_symbols:
241 @grep -nE '\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
242 $$($(VC_LIST_EXCEPT)) && \
243 { echo '$(ME): do not use HAVE''_FCNTL_H or O''_NDELAY' \
244 1>&2; exit 1; } || :
246 # FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
248 # Each nonempty line must start with a year number, or a TAB.
249 sc_changelog:
250 @grep -n '^[^12 ]' $$(find $(srcdir) -maxdepth 2 -name ChangeLog) && \
251 { echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \
252 exit 1; } || :
254 # Ensure that dd's definition of LONGEST_SYMBOL stays in sync
255 # with the strings from the two affected variables.
256 dd_c = $(srcdir)/src/dd.c
257 sc_dd_max_sym_length:
258 ifneq ($(wildcard $(dd_c)),)
259 @len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
260 sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
261 |sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
262 | wc --max-line-length); \
263 max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
264 |tr -d '"' | wc --max-line-length); \
265 if test "$$len" = "$$max"; then :; else \
266 echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \
267 exit 1; \
269 endif
271 # Many m4 macros names once began with `jm_'.
272 # On 2004-04-13, they were all changed to start with gl_ instead.
273 # Make sure that none are inadvertently reintroduced.
274 sc_prohibit_jm_in_m4:
275 @grep -nE 'jm_[A-Z]' \
276 $$($(VC_LIST) m4 |grep '\.m4$$') && \
277 { echo '$(ME): do not use jm_ in m4 macro names' \
278 1>&2; exit 1; } || :
280 sc_root_tests:
281 @t1=sc-root.expected; t2=sc-root.actual; \
282 grep -nl '^PRIV_CHECK_ARG=require-root' \
283 $$($(VC_LIST) tests) |sed s/tests/./ |sort > $$t1; \
284 sed -n 's, cd \([^ ]*\) .*MAKE..check TESTS=\(.*\),./\1/\2,p' \
285 $(srcdir)/tests/Makefile.am |sort > $$t2; \
286 diff -u $$t1 $$t2 || diff=1; \
287 rm -f $$t1 $$t2; \
288 test "$$diff" \
289 && { echo 'tests/Makefile.am: missing check-root action'>&2; \
290 exit 1; } || :
292 # Files in src/ should not include directly any of
293 # the headers already included via system.h.
294 sc_system_h_headers:
295 @if test -f $(srcdir)/src/system.h; then \
296 pat=$$( \
297 sed -n '/^# *include /s///p' $(srcdir)/src/system.h /dev/null \
298 | grep -Ev 'sys/(param|file)\.h' \
299 | sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
300 ) && \
301 grep -nE -f "$pat" \
302 $$($(VC_LIST) src | \
303 grep -Ev '((copy|system)\.h|parse-gram\.c)$$') \
304 && { echo '$(ME): the above are already included via system.h'\
305 1>&2; exit 1; } || :; \
308 sc_sun_os_names:
309 @grep -nEi \
310 'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
311 $$($(VC_LIST_EXCEPT)) && \
312 { echo '$(ME): found misuse of Sun OS version numbers' 1>&2; \
313 exit 1; } || :
315 sc_the_the:
316 @grep -ni '\<the ''the\>' $$($(VC_LIST_EXCEPT)) && \
317 { echo '$(ME): found use of "the ''the";' 1>&2; \
318 exit 1; } || :
320 sc_tight_scope:
321 test ! -d src || $(MAKE) -C src $@
323 sc_trailing_blank:
324 @grep -n '[ ]$$' $$($(VC_LIST_EXCEPT)) && \
325 { echo '$(ME): found trailing blank(s)' \
326 1>&2; exit 1; } || :
328 # Match lines like the following, but where there is only one space
329 # between the options and the description:
330 # -D, --all-repeated[=delimit-method] print all duplicate lines\n
331 longopt_re = --[a-z][0-9A-Za-z-]*(\[?=[0-9A-Za-z-]*\]?)?
332 sc_two_space_separator_in_usage:
333 @grep -nE '^ *(-[A-Za-z],)? $(longopt_re) [^ ].*\\$$' \
334 $$($(VC_LIST_EXCEPT)) && \
335 { echo "$(ME): help2man requires at least two spaces between"; \
336 echo "$(ME): an option and its description"; \
337 1>&2; exit 1; } || :
339 # Look for diagnostics that aren't marked for translation.
340 # This won't find any for which error's format string is on a separate line.
341 sc_unmarked_diagnostics:
342 @grep -nE \
343 '\<error \([^"]*"[^"]*[a-z]{3}' $$($(VC_LIST_EXCEPT)) \
344 | grep -v '_''(' && \
345 { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
346 exit 1; } || :
348 # Avoid useless parentheses like those in this example:
349 # #if defined (SYMBOL) || defined (SYM2)
350 sc_useless_cpp_parens:
351 @grep -n '^# *if .*defined *(' $$($(VC_LIST_EXCEPT)) && \
352 { echo '$(ME): found useless parentheses in cpp directive' \
353 1>&2; exit 1; } || :
355 # Ensure that the c99-to-c89 patch applies cleanly.
356 patch-check:
357 if test -f src/c99-to-c89.diff; then \
358 rm -rf src-c89 $@.1 $@.2 && \
359 cp -a src src-c89 && \
360 (cd src-c89; patch -V never --fuzz=0) < src/c99-to-c89.diff \
361 > $@.1 2>&1 && \
362 { grep -v '^patching file ' $@.1 > $@.2 || :; } && \
363 test -s $@.2 && \
364 rm -rf src-c89 $@.1 $@.2; \
367 # Ensure that date's --help output stays in sync with the info
368 # documentation for GNU strftime. The only exception is %N,
369 # which date accepts but GNU strftime does not.
370 extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
371 strftime-check:
372 if test -f $(srcdir)/src/date.c; then \
373 grep '^ %. ' $(srcdir)/src/date.c | sort \
374 | $(extract_char) > $@-src; \
375 { echo N; \
376 info libc date calendar format | grep '^ `%.'\' \
377 | $(extract_char); } | sort > $@-info; \
378 diff -u $@-src $@-info || exit 1; \
379 rm -f $@-src $@-info; \
382 check-AUTHORS:
383 test ! -d src || $(MAKE) -C src $@
385 # Ensure that we use only the standard $(VAR) notation,
386 # not @...@ in Makefile.am, now that we can rely on automake
387 # to emit a definition for each substituted variable.
388 makefile-check:
389 grep -nE '@[A-Z_0-9]+@' `find $(srcdir) -name Makefile.am` \
390 && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
392 news-date-check: NEWS
393 today=`date +%Y-%m-%d`; \
394 if head NEWS | grep '^\*.* $(VERSION_REGEXP) ('$$today')' \
395 >/dev/null; then \
396 :; \
397 else \
398 echo "version or today's date is not in NEWS" 1>&2; \
399 exit 1; \
402 changelog-check:
403 if head ChangeLog | grep 'Version $(VERSION_REGEXP)\.$$' \
404 >/dev/null; then \
405 :; \
406 else \
407 echo "$(VERSION) not in ChangeLog" 1>&2; \
408 exit 1; \
411 m4-check:
412 @shopt -s nullglob; \
413 grep 'AC_DEFUN([^[]' m4/*.m4 /dev/null \
414 && { echo '$(ME): quote the first arg to AC_DEFUN' 1>&2; \
415 exit 1; } || :
417 # Verify that all source files using _() are listed in po/POTFILES.in.
418 # FIXME: don't hard-code file names below; use a more general mechanism.
419 po-check:
420 if test -f po/POTFILES.in; then \
421 grep -E -v '^(#|$$)' po/POTFILES.in \
422 | grep -v '^src/false\.c$$' | sort > $@-1; \
423 files=; \
424 for file in $$($(VC_LIST_EXCEPT)) lib/*.[ch]; do \
425 case $$file in \
426 djgpp/* | man/*) continue;; \
427 */c99-to-c89.diff) continue;; \
428 esac; \
429 case $$file in \
430 *.[ch]) \
431 base=`expr " $$file" : ' \(.*\)\..'`; \
432 { test -f $$base.l || test -f $$base.y; } && continue;; \
433 esac; \
434 files="$$files $$file"; \
435 done; \
436 grep -E -l '\b(N?_|gettext *)\([^)"]*("|$$)' $$files \
437 | sort -u > $@-2; \
438 diff -u $@-1 $@-2 || exit 1; \
439 rm -f $@-1 $@-2; \
442 # In a definition of #define AUTHORS "... and ..." where the RHS contains
443 # the English word `and', the string must be marked with `N_ (...)' so that
444 # gettext recognizes it as a string requiring translation.
445 author_mark_check:
446 @shopt -s nullglob; \
447 grep -n '^# *define AUTHORS "[^"]* and ' src/*.c /dev/null \
448 | grep -v ' N_ (' && \
449 { echo '$(ME): enclose the above strings in N_ (...)' 1>&2; \
450 exit 1; } || :
452 # Sometimes it is useful to change the PATH environment variable
453 # in Makefiles. When doing so, it's better not to use the Unix-centric
454 # path separator of `:', but rather the automake-provided `@PATH_SEPARATOR@'.
455 # It'd be better to use `find -print0 ...|xargs -0 ...', but less portable,
456 # and there probably aren't many projects with so many Makefile.am files
457 # that we'd have to worry about limits on command line length.
458 msg = '$(ME): Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
459 makefile_path_separator_check:
460 @grep -n 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
461 && { echo $(msg) 1>&2; exit 1; } || :
463 # Check that `make alpha' will not fail at the end of the process.
464 writable-files:
465 if test -d $(release_archive_dir); then :; else \
466 mkdir $(release_archive_dir); \
468 for file in $(distdir).tar.gz $(xd-delta) \
469 $(release_archive_dir)/$(distdir).tar.gz \
470 $(release_archive_dir)/$(xd-delta); do \
471 test -e $$file || continue; \
472 test -w $$file \
473 || { echo ERROR: $$file is not writable; fail=1; }; \
474 done; \
475 test "$$fail" && exit 1 || :
477 v_etc_file = lib/version-etc.c
478 # Make sure that the copyright date in $(v_etc_file) is up to date.
479 copyright-check:
480 @if test -f $(v_etc_file); then \
481 grep 'enum { COPYRIGHT_YEAR = '$$(date +%Y)' };' $(v_etc_file) \
482 >/dev/null \
483 || { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
484 exit 1; }; \
487 vc-diff-check:
488 (CDPATH=; cd $(srcdir) && $(VC) diff) > vc-diffs || :
489 if test -s vc-diffs; then \
490 cat vc-diffs; \
491 echo "Some files are locally modified:" 1>&2; \
492 exit 1; \
493 else \
494 rm vc-diffs; \
497 cvs-check: vc-diff-check
499 maintainer-distcheck:
500 $(MAKE) distcheck
501 $(MAKE) -C tests $(AM_MAKEFLAGS) maintainer-check
502 $(MAKE) my-distcheck
504 # Don't make a distribution if checks fail.
505 # Also, make sure the NEWS file is up-to-date.
506 vc-dist: $(local-check) cvs-check maintainer-distcheck
507 $(MAKE) dist
509 # Use this to make sure we don't run these programs when building
510 # from a virgin tgz file, below.
511 null_AM_MAKEFLAGS = \
512 ACLOCAL=false \
513 AUTOCONF=false \
514 AUTOMAKE=false \
515 AUTOHEADER=false \
516 MAKEINFO=false
518 # Detect format-string/arg-list mismatches that would normally be obscured
519 # by the use of _(). The --disable-nls effectively defines away that macro,
520 # and building with CFLAGS='-Wformat -Werror' causes any format warning to be
521 # treated as a failure. Also, check for shadowing problems with -Wshadow,
522 # and for pointer arithmetic problems with -Wpointer-arith.
523 # These CFLAGS are pretty strict. If you build this target, you probably
524 # have to have a recent version of gcc and glibc headers.
525 TMPDIR ?= /tmp
526 t=$(TMPDIR)/$(PACKAGE)/test
527 my-distcheck: $(local-check) $(release_archive_dir)/$(prev-tgz)
528 -rm -rf $(t)
529 mkdir -p $(t)
530 GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
531 cd $(t)/$(distdir) \
532 && ./configure --disable-nls \
533 && $(MAKE) CFLAGS='-Werror -Wall -Wformat -Wshadow -Wpointer-arith' \
534 AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
535 && $(MAKE) dvi \
536 && $(MAKE) check \
537 && $(MAKE) distclean
538 (cd $(t) && mv $(distdir) $(distdir).old \
539 && $(AMTAR) -zxf - ) < $(distdir).tar.gz
540 diff -ur $(t)/$(distdir).old $(t)/$(distdir)
541 -rm -rf $(t)
542 @echo "========================"; \
543 echo "$(distdir).tar.gz is ready for distribution"; \
544 echo "========================"
546 prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
548 rel-files = $(DIST_ARCHIVES)
550 gnulib_dir ?= $(srcdir)/gnulib
551 gnulib-version = $$(cd $(gnulib_dir) && git describe)
552 bootstrap-tools ?= autoconf,automake,gnulib
554 # If it's not already specified, derive the GPG key ID from
555 # the signed tag we've just applied to mark this release.
556 gpg_key_ID ?= \
557 $$(git cat-file tag v$(VERSION) > .ann-sig \
558 && gpgv .ann-sig - < /dev/null 2>&1 \
559 | sed -n '/.*key ID \([0-9A-F]*\)/s//\1/p'; rm -f .ann-sig)
561 announcement: NEWS ChangeLog $(rel-files)
562 @$(build_aux)/announce_gen \
563 --release-type=$(RELEASE_TYPE) \
564 --package=$(PACKAGE) \
565 --prev=$(PREV_VERSION) \
566 --curr=$(VERSION) \
567 --gpg-key-id=$(gpg_key_ID) \
568 --news=$(srcdir)/NEWS \
569 --bootstrap-tools=$(bootstrap-tools) \
570 --gnulib-version=$(gnulib-version) \
571 --no-print-checksums \
572 $(addprefix --url-dir=, $(url_dir_list))
574 ## ---------------- ##
575 ## Updating files. ##
576 ## ---------------- ##
578 ftp-gnu = ftp://ftp.gnu.org/gnu
579 www-gnu = http://www.gnu.org
581 # Use mv, if you don't have/want move-if-change.
582 move_if_change ?= move-if-change
584 emit_upload_commands:
585 @echo =====================================
586 @echo =====================================
587 @echo "$(build_aux)/gnupload $(GNUPLOADFLAGS) \\"
588 @echo " --to $(gnu_rel_host):$(PACKAGE) \\"
589 @echo " $(rel-files)"
590 @echo '# send the /tmp/announcement e-mail'
591 @echo =====================================
592 @echo =====================================
594 .PHONY: alpha beta stable
595 alpha beta stable: news-date-check changelog-check $(local-check)
596 test $@ = stable \
597 && { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$' \
598 || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\
599 || :
600 $(MAKE) vc-dist
601 $(MAKE) $(xd-delta)
602 $(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
603 ln $(rel-files) $(release_archive_dir)
604 chmod a-w $(rel-files)
605 $(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
606 echo $(VERSION) > $(prev_version_file)
607 $(VC) commit -m \
608 '$(prev_version_file): Record previous version: $(VERSION).' \
609 $(prev_version_file)
612 .PHONY: web-manual
613 web-manual:
614 @test -z "$(manual_title)" \
615 && { echo define manual_title in cfg.mk 1>&2; exit 1; } || :
616 @cd '$(srcdir)/doc'; \
617 $(SHELL) ../build-aux/gendocs.sh -o '$(abs_builddir)/doc/manual' \
618 --email $(PACKAGE_BUGREPORT) $(PACKAGE) \
619 "$(PACKAGE_NAME) - $(manual_title)"
620 @echo " *** Upload the doc/manual directory to web-cvs."
622 # If you want to set UPDATE_COPYRIGHT_* environment variables,
623 # put the assignments in this variable.
624 update-copyright-env ?=
626 # Run this rule once per year (usually early in January)
627 # to update all FSF copyright year lists in your project.
628 # If you have an additional project-specific rule,
629 # add it in cfg.mk along with a line 'update-copyright: prereq'.
630 # By default, exclude all variants of COPYING; you can also
631 # add exemptions (such as ChangeLog..* for rotated change logs)
632 # in the file .x-update-copyright.
633 .PHONY: update-copyright
634 update-copyright:
635 grep -l -w Copyright $$($(VC_LIST_EXCEPT)) \
636 $(srcdir)/ChangeLog | grep -v COPYING \
637 | $(update-copyright-env) xargs $(build_aux)/$@