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.
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))
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.
31 $(shell gzip
--help
2>/dev
/null|grep rsyncable
>/dev
/null \
32 && printf
%s
--rsyncable
)
33 GZIP_ENV
= '--no-name --best $(gzip_rsyncable)'
37 VC-tag
= git tag
-s
-m
'$(VERSION)' -u
'$(gpg_key_ID)'
39 VC_LIST
= $(build_aux
)/vc-list-files
-C
$(srcdir)
42 $(VC_LIST
) | if
test -f
$(srcdir)/.x-
$@
; then \
43 grep
-vEf
$(srcdir)/.x-
$@
; \
48 ifeq ($(origin prev_version_file
), undefined
)
49 prev_version_file
= $(srcdir)/.prev-version
52 PREV_VERSION
:= $(shell cat
$(prev_version_file
) 2>/dev
/null
)
53 VERSION_REGEXP
= $(subst .
,\.
,$(VERSION
))
54 PREV_VERSION_REGEXP
= $(subst .
,\.
,$(PREV_VERSION
))
56 this-vc-tag
= v
$(VERSION
)
57 this-vc-tag-regexp
= v
$(VERSION_REGEXP
)
58 my_distdir
= $(PACKAGE
)-$(VERSION
)
60 # Old releases are stored here.
62 release_archive_dir ?
= ..
/release
64 # Override gnu_rel_host and url_dir_list in cfg.mk if these are not right.
65 # Use alpha.gnu.org for alpha and beta releases.
66 # Use ftp.gnu.org for stable releases.
67 gnu_ftp_host-alpha
= alpha.gnu.org
68 gnu_ftp_host-beta
= alpha.gnu.org
69 gnu_ftp_host-stable
= ftp.gnu.org
70 gnu_rel_host ?
= $(gnu_ftp_host-
$(RELEASE_TYPE
))
72 ifeq ($(gnu_rel_host
),ftp.gnu.org
)
73 url_dir_list ?
= http
://ftpmirror.gnu.org
/$(PACKAGE
)
75 url_dir_list ?
= ftp
://$(gnu_rel_host
)/gnu
/$(PACKAGE
)
78 # Prevent programs like 'sort' from considering distinct strings to be equal.
79 # Doing it here saves us from having to set LC_ALL elsewhere in this file.
88 # Collect the names of rules starting with `sc_'.
89 syntax-check-rules
:= $(shell sed
-n
's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
91 .PHONY
: $(syntax-check-rules
)
93 local-checks-available
= \
94 po-check copyright-check writable-files m4-check author_mark_check \
95 changelog-check patch-check strftime-check
$(syntax-check-rules
) \
96 makefile_path_separator_check \
97 makefile-check check-AUTHORS
98 .PHONY
: $(local-checks-available
)
100 local-check
:= $(filter-out $(local-checks-to-skip
), $(local-checks-available
))
102 syntax-check
: $(local-check
)
103 # @shopt -s nullglob; \
104 # grep -nE '# *include <(limits|std(def|arg|bool))\.h>' \
105 # $$(find -type f -name '*.[chly]') /dev/null && \
106 # { echo '$(ME): found conditional include' 1>&2; \
109 # grep -nE '^# *include <(string|stdlib)\.h>' \
110 # $(srcdir)/{lib,src}/*.[chly] /dev/null && \
111 # { echo '$(ME): FIXME' 1>&2; \
113 # FIXME: don't allow `#include .strings\.h' anywhere
115 sc_cast_of_argument_to_free
:
116 @shopt
-s nullglob
; \
117 grep
-nE
'\<free \(\(' \
118 $(srcdir)/{lib
,src
}/*.
[chly
] /dev
/null
&& \
119 { echo
'$(ME): don'\''t cast free argument' 1>&2; \
122 sc_cast_of_x_alloc_return_value
:
123 @shopt
-s nullglob
; \
124 grep
-nE
--exclude
=$(srcdir)/lib
/regex.c \
125 '\*\) *x(m|c|re)alloc\>' \
126 $(srcdir)/{lib
,src
}/*.
[chly
] /dev
/null
&& \
127 { echo
'$(ME): don'\''t cast x*alloc return value' 1>&2; \
130 sc_cast_of_alloca_return_value
:
131 @shopt
-s nullglob
; \
132 grep
-nE
'\*\) *alloca\>' \
133 $(srcdir)/src
/*.
[chly
] /dev
/null
&& \
134 { echo
'$(ME): don'\''t cast alloca return value' 1>&2; \
138 @grep
-n
'[ ] ' $$($(VC_LIST_EXCEPT
)) && \
139 { echo
'$(ME): found SPACE-TAB sequence; remove the SPACE' \
142 # Don't use *scanf or the old ato* functions in `real' code.
143 # They provide no error checking mechanism.
144 # Instead, use strto* functions.
145 sc_prohibit_atoi_atof
:
146 @grep
-nE
'\<([fs]?scanf|ato([filq]|ll))\>' $$($(VC_LIST_EXCEPT
)) && \
147 { echo
'$(ME): do not use *scan''f, ato''f, ato''i, ato''l, ato''ll, ato''q, or ss''canf' \
150 # Using EXIT_SUCCESS as the first argument to error is misleading,
151 # since when that parameter is 0, error does not exit. Use `0' instead.
152 sc_error_exit_success
:
153 @grep
-nF
'error (EXIT_SUCCESS,' \
154 $$(find
-type f
-name
'*.[chly]') /dev
/null
&& \
155 { echo
'$(ME): found error (EXIT_SUCCESS' 1>&2; \
159 @grep
-ni
'file''system' $$($(VC_LIST_EXCEPT
)) \
160 | grep
-v
'File''system Hierarchy Standard' && \
161 { echo
'$(ME): found use of "file''system";' \
162 'rewrite to use "file system"' 1>&2; \
166 @grep
-n
'^# *if.*HAVE''_CONFIG_H' $$($(VC_LIST_EXCEPT
)) && \
167 { echo
'$(ME): found use of HAVE''_CONFIG_H; remove' \
170 # Nearly all .c files must include <config.h>.
172 @if
$(VC_LIST_EXCEPT
) | grep
'\.c$$' > /dev
/null
; then \
173 grep
-L
'^# *include <config\.h>' \
174 $$($(VC_LIST_EXCEPT
) | grep
'\.c$$') \
176 { echo
'$(ME): the above files do not include <config.h>' \
177 1>&2; exit
1; } ||
:; \
181 # To use this "command" macro, you must first define two shell variables:
182 # h: the header, enclosed in <> or ""
183 # re: a regular expression that matches IFF something provided by $h is used.
184 define _header_without_use
185 h_esc
=`echo "$$h"|sed 's/\./\\./'`; \
186 if
$(VC_LIST_EXCEPT
) | grep
'\.c$$' > /dev
/null
; then \
187 files
=$$(grep
-l
'^# *include '"$$h_esc" \
188 $$($(VC_LIST_EXCEPT
) | grep
'\.c$$')) && \
189 grep
-LE
"$$re" $$files | grep .
&& \
190 { echo
"$(ME): the above files include $$h but don't use it" \
191 1>&2; exit
1; } ||
:; \
196 # Prohibit the inclusion of assert.h without an actual use of assert.
197 sc_prohibit_assert_without_use
:
198 @h
='<assert.h>' re
='\<assert *\(' $(_header_without_use
)
200 # Prohibit the inclusion of getopt.h without an actual use.
201 sc_prohibit_getopt_without_use
:
202 @h
='<getopt.h>' re
='\<getopt(_long)? *\(' $(_header_without_use
)
204 # Don't include quotearg.h unless you use one of its functions.
205 sc_prohibit_quotearg_without_use
:
206 @h
='"quotearg.h"' re
='\<quotearg(_[^ ]+)? *\(' $(_header_without_use
)
208 # Don't include quote.h unless you use one of its functions.
209 sc_prohibit_quote_without_use
:
210 @h
='"quote.h"' re
='\<quote(_n)? *\(' $(_header_without_use
)
212 # Don't include this header unless you use one of its functions.
213 sc_prohibit_long_options_without_use
:
214 @h
='"long-options.h"' re
='\<parse_long_options *\(' \
215 $(_header_without_use
)
217 # Don't include this header unless you use one of its functions.
218 sc_prohibit_inttostr_without_use
:
219 @h
='"inttostr.h"' re
='\<(off|[iu]max|uint)tostr *\(' \
220 $(_header_without_use
)
222 # Don't include this header unless you use one of its functions.
223 sc_prohibit_error_without_use
:
225 re
='\<error(_at_line|_print_progname|_one_per_line|_message_count)? *\('\
226 $(_header_without_use
)
228 sc_prohibit_safe_read_without_use
:
229 @h
='"safe-read.h"' re
='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \
230 $(_header_without_use
)
232 sc_prohibit_argmatch_without_use
:
234 re
='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<argmatch(_exit_fn|_(in)?valid) *\()' \
235 $(_header_without_use
)
237 sc_prohibit_root_dev_ino_without_use
:
238 @h
='"root-dev-ino.h"' \
239 re
='(\<ROOT_DEV_INO_(CHECK|WARN)\>|\<get_root_dev_ino *\()' \
240 $(_header_without_use
)
243 @grep
-nE
'\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
244 $$($(VC_LIST_EXCEPT
)) && \
245 { echo
'$(ME): do not use HAVE''_FCNTL_H or O''_NDELAY' \
248 # FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
250 # Each nonempty line must start with a year number, or a TAB.
252 @grep
-n
'^[^12 ]' $$(find
$(srcdir) -maxdepth
2 -name ChangeLog
) && \
253 { echo
'$(ME): found unexpected prefix in a ChangeLog' 1>&2; \
256 # Ensure that dd's definition of LONGEST_SYMBOL stays in sync
257 # with the strings from the two affected variables.
258 dd_c
= $(srcdir)/src
/dd.c
259 sc_dd_max_sym_length
:
260 ifneq ($(wildcard $(dd_c
)),)
261 @len
=$$( (sed
-n
'/conversions\[\] =$$/,/^};/p' $(dd_c
);\
262 sed
-n
'/flags\[\] =$$/,/^};/p' $(dd_c
) ) \
263 |sed
-n
'/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
264 | wc
--max-line-length
); \
265 max
=$$(sed
-n
'/^#define LONGEST_SYMBOL /s///p' $(dd_c
) \
266 |tr
-d
'"' | wc
--max-line-length
); \
267 if
test "$$len" = "$$max"; then
:; else \
268 echo
'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \
273 # Many m4 macros names once began with `jm_'.
274 # On 2004-04-13, they were all changed to start with gl_ instead.
275 # Make sure that none are inadvertently reintroduced.
276 sc_prohibit_jm_in_m4
:
277 @grep
-nE
'jm_[A-Z]' \
278 $$($(VC_LIST
) m4 |grep
'\.m4$$') && \
279 { echo
'$(ME): do not use jm_ in m4 macro names' \
283 @t1
=sc-root.expected
; t2
=sc-root.actual
; \
284 grep
-nl
'^PRIV_CHECK_ARG=require-root' \
285 $$($(VC_LIST
) tests
) |sed s
/tests
/.
/ |
sort > $$t1; \
286 sed
-n
's, cd \([^ ]*\) .*MAKE..check TESTS=\(.*\),./\1/\2,p' \
287 $(srcdir)/tests
/Makefile.am |
sort > $$t2; \
288 diff
-u
$$t1 $$t2 || diff
=1; \
291 && { echo
'tests/Makefile.am: missing check-root action'>&2; \
294 # Files in src/ should not include directly any of
295 # the headers already included via system.h.
297 @if
test -f
$(srcdir)/src
/system.h
; then \
299 sed
-n
'/^# *include /s///p' $(srcdir)/src
/system.h
/dev
/null \
300 | grep
-Ev
'sys/(param|file)\.h' \
301 | sed
's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
304 $$($(VC_LIST
) src | \
305 grep
-Ev
'((copy|system)\.h|parse-gram\.c)$$') \
306 && { echo
'$(ME): the above are already included via system.h'\
307 1>&2; exit
1; } ||
:; \
312 'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
313 $$($(VC_LIST_EXCEPT
)) && \
314 { echo
'$(ME): found misuse of Sun OS version numbers' 1>&2; \
318 @grep
-ni
'\<the ''the\>' $$($(VC_LIST_EXCEPT
)) && \
319 { echo
'$(ME): found use of "the ''the";' 1>&2; \
323 test ! -d src ||
$(MAKE
) -C src
$@
326 @grep
-n
'[ ]$$' $$($(VC_LIST_EXCEPT
)) && \
327 { echo
'$(ME): found trailing blank(s)' \
330 # Match lines like the following, but where there is only one space
331 # between the options and the description:
332 # -D, --all-repeated[=delimit-method] print all duplicate lines\n
333 longopt_re
= --[a-z
][0-9A-Za-z-
]*(\
[?
=[0-9A-Za-z-
]*\
]?
)?
334 sc_two_space_separator_in_usage
:
335 @grep
-nE
'^ *(-[A-Za-z],)? $(longopt_re) [^ ].*\\$$' \
336 $$($(VC_LIST_EXCEPT
)) && \
337 { echo
"$(ME): help2man requires at least two spaces between"; \
338 echo
"$(ME): an option and its description"; \
341 # Look for diagnostics that aren't marked for translation.
342 # This won't find any for which error's format string is on a separate line.
343 sc_unmarked_diagnostics
:
345 '\<error \([^"]*"[^"]*[a-z]{3}' $$($(VC_LIST_EXCEPT
)) \
346 | grep
-v
'_''(' && \
347 { echo
'$(ME): found unmarked diagnostic(s)' 1>&2; \
350 # Avoid useless parentheses like those in this example:
351 # #if defined (SYMBOL) || defined (SYM2)
352 sc_useless_cpp_parens
:
353 @grep
-n
'^# *if .*defined *(' $$($(VC_LIST_EXCEPT
)) && \
354 { echo
'$(ME): found useless parentheses in cpp directive' \
357 # Ensure that the c99-to-c89 patch applies cleanly.
359 if
test -f src
/c99-to-c89.diff
; then \
360 rm -rf src-c89
$@
.1 $@
.2 && \
361 cp
-a src src-c89
&& \
362 (cd src-c89
; patch
-V never
--fuzz
=0) < src
/c99-to-c89.diff \
364 { grep
-v
'^patching file ' $@
.1 > $@
.2 ||
:; } && \
366 rm -rf src-c89
$@
.1 $@
.2; \
369 # Ensure that date's --help output stays in sync with the info
370 # documentation for GNU strftime. The only exception is %N,
371 # which date accepts but GNU strftime does not.
372 extract_char
= sed
's/^[^%][^%]*%\(.\).*/\1/'
374 if
test -f
$(srcdir)/src
/date.c
; then \
375 grep
'^ %. ' $(srcdir)/src
/date.c |
sort \
376 |
$(extract_char
) > $@
-src
; \
378 info libc date calendar format | grep
'^ `%.'\' \
379 |
$(extract_char
); } |
sort > $@
-info; \
380 diff
-u
$@
-src
$@
-info || exit
1; \
381 rm -f
$@
-src
$@
-info; \
385 test ! -d src ||
$(MAKE
) -C src
$@
388 $$(sed
-n
'/^\*.* $(PREV_VERSION_REGEXP) ([0-9-]*)/,$$p' \
391 's/^Copyright.+?Free\sSoftware\sFoundation,\sInc\.\n//ms' \
395 # Ensure that we don't accidentally insert an entry into an old NEWS block.
397 @if
test -f
$(srcdir)/NEWS
; then \
398 test "$(NEWS_hash)" = '$(old_NEWS_hash)' && : || \
399 { echo
'$(ME): you have modified old NEWS' 1>&2; exit
1; }; \
402 # Update the hash stored above. Do this after each release and
403 # for any corrections to old entries.
404 update-NEWS-hash
: NEWS
405 perl
-pi
-e
's/^(old_NEWS_hash[ \t]+:?=[ \t]+).*/$${1}'"$(NEWS_hash)/" \
408 # Ensure that we use only the standard $(VAR) notation,
409 # not @...@ in Makefile.am, now that we can rely on automake
410 # to emit a definition for each substituted variable.
412 grep
-nE
'@[A-Z_0-9]+@' `find $(srcdir) -name Makefile.am` \
413 && { echo
'$(ME): use $$(...), not @...@' 1>&2; exit
1; } ||
:
415 news-date-check
: NEWS
416 today
=`date +%Y-%m-%d`; \
417 if head NEWS | grep
'^\*.* $(VERSION_REGEXP) ('$$today')' \
421 echo
"version or today's date is not in NEWS" 1>&2; \
426 if head ChangeLog | grep
'Version $(VERSION_REGEXP)\.$$' \
430 echo
"$(VERSION) not in ChangeLog" 1>&2; \
435 @shopt
-s nullglob
; \
436 grep
'AC_DEFUN([^[]' m4
/*.m4
/dev
/null \
437 && { echo
'$(ME): quote the first arg to AC_DEFUN' 1>&2; \
440 # Verify that all source files using _() are listed in po/POTFILES.in.
441 # FIXME: don't hard-code file names below; use a more general mechanism.
443 if
test -f po
/POTFILES.in
; then \
444 grep
-E
-v
'^(#|$$)' po
/POTFILES.in \
445 | grep
-v
'^src/false\.c$$' |
sort > $@
-1; \
447 for file in
$$($(VC_LIST_EXCEPT
)) lib
/*.
[ch
]; do \
449 djgpp
/* | man
/*) continue
;; \
450 */c99-to-c89.diff
) continue
;; \
454 base
=`expr " $$file" : ' \(.*\)\..'`; \
455 { test -f
$$base.l ||
test -f
$$base.y
; } && continue
;; \
457 files
="$$files $$file"; \
459 grep
-E
-l
'\b(N?_|gettext *)\([^)"]*("|$$)' $$files \
461 diff
-u
$@
-1 $@
-2 || exit
1; \
465 # In a definition of #define AUTHORS "... and ..." where the RHS contains
466 # the English word `and', the string must be marked with `N_ (...)' so that
467 # gettext recognizes it as a string requiring translation.
469 @shopt
-s nullglob
; \
470 grep
-n
'^# *define AUTHORS "[^"]* and ' src
/*.c
/dev
/null \
471 | grep
-v
' N_ (' && \
472 { echo
'$(ME): enclose the above strings in N_ (...)' 1>&2; \
475 # Sometimes it is useful to change the PATH environment variable
476 # in Makefiles. When doing so, it's better not to use the Unix-centric
477 # path separator of `:', but rather the automake-provided `@PATH_SEPARATOR@'.
478 # It'd be better to use `find -print0 ...|xargs -0 ...', but less portable,
479 # and there probably aren't many projects with so many Makefile.am files
480 # that we'd have to worry about limits on command line length.
481 msg
= '$(ME): Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
482 makefile_path_separator_check
:
483 @grep
-n
'PATH=.*:' `find $(srcdir) -name Makefile.am` \
484 && { echo
$(msg
) 1>&2; exit
1; } ||
:
486 # Check that `make alpha' will not fail at the end of the process.
488 if
test -d
$(release_archive_dir
); then
:; else \
489 mkdir
$(release_archive_dir
); \
491 for file in
$(distdir
).
tar.gz \
492 $(release_archive_dir
)/$(distdir
).
tar.gz
; do \
493 test -e
$$file || continue
; \
495 ||
{ echo ERROR
: $$file is not writable
; fail
=1; }; \
497 test "$$fail" && exit
1 ||
:
499 v_etc_file
= lib
/version-etc.c
500 # Make sure that the copyright date in $(v_etc_file) is up to date.
502 @if
test -f
$(v_etc_file
); then \
503 grep
'enum { COPYRIGHT_YEAR = '$$(date
+%Y
)' };' $(v_etc_file
) \
505 ||
{ echo
'out of date copyright in $(v_etc_file); update it' 1>&2; \
510 (CDPATH
=; cd
$(srcdir) && $(VC
) diff
) > vc-diffs ||
:
511 if
test -s vc-diffs
; then \
513 echo
"Some files are locally modified:" 1>&2; \
519 cvs-check
: vc-diff-check
521 maintainer-distcheck
:
523 $(MAKE
) -C tests
$(AM_MAKEFLAGS
) maintainer-check
526 # Don't make a distribution if checks fail.
527 # Also, make sure the NEWS file is up-to-date.
528 vc-dist
: $(local-check
) cvs-check maintainer-distcheck
531 # Use this to make sure we don't run these programs when building
532 # from a virgin tgz file, below.
533 null_AM_MAKEFLAGS
= \
540 # Detect format-string/arg-list mismatches that would normally be obscured
541 # by the use of _(). The --disable-nls effectively defines away that macro,
542 # and building with CFLAGS='-Wformat -Werror' causes any format warning to be
543 # treated as a failure. Also, check for shadowing problems with -Wshadow,
544 # and for pointer arithmetic problems with -Wpointer-arith.
545 # These CFLAGS are pretty strict. If you build this target, you probably
546 # have to have a recent version of gcc and glibc headers.
548 t
=$(TMPDIR
)/$(PACKAGE
)/test
549 my-distcheck
: $(local-check
) $(release_archive_dir
)/$(prev-tgz
)
552 GZIP
=$(GZIP_ENV
) $(AMTAR
) -C
$(t
) -zxf
$(distdir
).
tar.gz
554 && .
/configure
--disable-nls \
555 && $(MAKE
) CFLAGS
='-Werror -Wall -Wformat -Wshadow -Wpointer-arith' \
556 AM_MAKEFLAGS
='$(null_AM_MAKEFLAGS)' \
560 (cd
$(t
) && mv
$(distdir
) $(distdir
).old \
561 && $(AMTAR
) -zxf
- ) < $(distdir
).
tar.gz
562 diff
-ur
$(t
)/$(distdir
).old
$(t
)/$(distdir
)
564 @echo
"========================"; \
565 echo
"$(distdir).tar.gz is ready for distribution"; \
566 echo
"========================"
568 prev-tgz
= $(PACKAGE
)-$(PREV_VERSION
).
tar.gz
570 rel-files
= $(DIST_ARCHIVES
)
572 gnulib_dir ?
= $(srcdir)/gnulib
573 gnulib-version
= $$(cd
$(gnulib_dir
) && git describe
)
574 bootstrap-tools ?
= autoconf
,automake
,gnulib
576 # If it's not already specified, derive the GPG key ID from
577 # the signed tag we've just applied to mark this release.
579 $$(git cat-file tag v
$(VERSION
) > .ann-sig \
580 && gpgv .ann-sig
- < /dev
/null
2>&1 \
581 | sed
-n
'/.*key ID \([0-9A-F]*\)/s//\1/p'; rm -f .ann-sig
)
583 translation_project_ ?
= coordinator@translationproject.org
584 announcement_Cc_ ?
= $(translation_project_
), $(PACKAGE_BUGREPORT
)
585 announcement_mail_headers_ ?
= \
586 To
: info-gnu@gnu.org \
587 Cc
: $(announcement_Cc_
) \
588 Mail-Followup-To
: $(PACKAGE_BUGREPORT
)
590 announcement
: NEWS ChangeLog
$(rel-files
)
591 @
$(build_aux
)/announce-gen \
592 --mail-headers
='$(announcement_mail_headers_)' \
593 --release-type
=$(RELEASE_TYPE
) \
594 --package
=$(PACKAGE
) \
595 --prev
=$(PREV_VERSION
) \
597 --gpg-key-id
=$(gpg_key_ID
) \
598 --news
=$(srcdir)/NEWS \
599 --bootstrap-tools
=$(bootstrap-tools
) \
600 --no-print-checksums \
601 $(addprefix --url-dir
=, $(url_dir_list
))
603 ## ---------------- ##
604 ## Updating files. ##
605 ## ---------------- ##
607 ftp-gnu
= ftp
://ftp.gnu.org
/gnu
608 www-gnu
= http
://www.gnu.org
610 # Use mv, if you don't have/want move-if-change.
611 move_if_change ?
= move-if-change
613 upload_dest_dir_ ?
= $(PACKAGE
)
615 emit_upload_commands
:
616 @echo
=====================================
617 @echo
=====================================
618 @echo
"$(build_aux)/gnupload $(GNUPLOADFLAGS) \\"
619 @echo
" --to $(gnu_rel_host):$(upload_dest_dir_) \\"
620 @echo
" $(rel-files)"
621 @echo
'# send the ~/announce-$(my_distdir) e-mail'
622 @echo
=====================================
623 @echo
=====================================
625 noteworthy
= * Noteworthy changes in release ?.?
(????
-??
-??
) [?
]
626 define emit-commit-log
627 printf
'%s\n' 'post-release administrivia' '' \
628 '* NEWS: Add header line for next release.' \
629 '* .prev-version: Record previous version.' \
630 '* cfg.mk (old_NEWS_hash): Auto-update.'
633 .PHONY
: alpha beta stable
634 ALL_RECURSIVE_TARGETS
+= alpha beta stable
635 alpha beta stable
: news-date-check changelog-check
$(local-check
)
637 && { echo
$(VERSION
) | grep
-E
'^[0-9]+(\.[0-9]+)+$$' \
638 ||
{ echo
"invalid version string: $(VERSION)" 1>&2; exit
1;};}\
641 $(MAKE
) dist XZ_OPT
=-9ev
642 $(MAKE
) $(release-prep-hook
) RELEASE_TYPE
=$@
643 $(MAKE
) -s emit_upload_commands RELEASE_TYPE
=$@
645 # Override this in cfg.mk if you follow different procedures.
646 release-prep-hook ?
= release-prep
650 case
$$RELEASE_TYPE in alpha|beta|stable
) ;; \
651 *) echo
"invalid RELEASE_TYPE: $$RELEASE_TYPE" 1>&2; exit
1;; esac
652 $(MAKE
) -s announcement
> ~
/announce-
$(my_distdir
)
653 if
test -d
$(release_archive_dir
); then \
654 ln
$(rel-files
) $(release_archive_dir
); \
655 chmod a-w
$(rel-files
); \
657 echo
$(VERSION
) > $(prev_version_file
)
658 $(MAKE
) update-NEWS-hash
659 perl
-pi
-e
'$$. == 3 and print "$(noteworthy)\n\n\n"' NEWS
660 $(emit-commit-log
) > .ci-msg
661 $(VC
) commit
-F .ci-msg
-a
665 # Override this with e.g., -s $(srcdir)/some_other_name.texi
666 # if the default $(PACKAGE)-derived name doesn't apply.
671 @
test -z
"$(manual_title)" \
672 && { echo
define manual_title in cfg.mk
1>&2; exit
1; } ||
:
673 @cd
'$(srcdir)/doc'; \
674 $(SHELL
) ..
/build-aux
/gendocs.sh
$(gendocs_options_
) \
675 -o
'$(abs_builddir)/doc/manual' \
676 --email
$(PACKAGE_BUGREPORT
) $(PACKAGE
) \
677 "$(PACKAGE_NAME) - $(manual_title)"
678 @echo
" *** Upload the doc/manual directory to web-cvs."
680 # If you want to set UPDATE_COPYRIGHT_* environment variables,
681 # put the assignments in this variable.
682 update-copyright-env ?
=
684 # Run this rule once per year (usually early in January)
685 # to update all FSF copyright year lists in your project.
686 # If you have an additional project-specific rule,
687 # add it in cfg.mk along with a line 'update-copyright: prereq'.
688 # By default, exclude all variants of COPYING; you can also
689 # add exemptions (such as ChangeLog..* for rotated change logs)
690 # in the file .x-update-copyright.
691 .PHONY
: update-copyright
693 grep
-l
-w Copyright
$$($(VC_LIST_EXCEPT
)) \
694 $(srcdir)/ChangeLog | grep
-v COPYING \
695 |
$(update-copyright-env
) xargs
$(build_aux
)/$@