1 ## Makefile.maint -- Makefile rules for m4 maintainers -*-Makefile-*-
3 ## Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation
5 ## This file is part of GNU M4.
7 ## GNU M4 is free software: you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as published by
9 ## the Free Software Foundation, either version 3 of the License, or
10 ## (at your option) any later version.
12 ## GNU M4 is distributed in the hope that it will be useful,
13 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ## GNU General Public License for more details.
17 ## You should have received a copy of the GNU General Public License
18 ## along with this program. If not, see <http://www.gnu.org/licenses/>.
20 # Do not save the original name or timestamp in the .tar.gz file.
21 # Use --rsyncable if available.
23 $(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null && echo --rsyncable)
24 GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
29 VC-tag = git tag -s -m '$(VERSION)' -u $(gpg_key_ID)
31 VERSION_REGEXP = $(subst .,\.,$(VERSION))
33 this-vc-tag = v$(VERSION)
35 tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
36 tag-this-version = $(subst .,_,$(VERSION))
37 this-vc-tag = $(tag-package)-$(tag-this-version)
39 my_distdir = $(PACKAGE)-$(VERSION)
41 # Ensure that we use only the standard $(VAR) notation,
42 # not @...@ in Makefile.am, now that we can rely on automake
43 # to emit a definition for each substituted variable.
45 grep -nE '@[A-Z_0-9]+@' `find . -name Makefile.am` \
46 && { echo 'Makefile.maint: use $$(...), not @...@' 1>&2; exit 1; } || :
48 news-date-check: NEWS version-check
49 today=`date +%Y-%m-%d`; \
50 if head NEWS | grep '^\*.* $(VERSION_REGEXP) ('$$today')' \
54 echo "version or today's date is not in NEWS" 1>&2; \
59 if head ChangeLog | grep 'Version $(VERSION_REGEXP)\.$$' \
63 echo "$(VERSION) not in ChangeLog" 1>&2; \
68 @grep -n 'AC_DEFUN([^[]' m4/*.m4 \
69 && { echo 'Makefile.maint: quote the first arg to AC_DEFUN' 1>&2; \
73 $(VC) diff > vc-diffs || :
74 if test -s vc-diffs; then \
76 echo "Some files are locally modified:" 1>&2; \
86 # Don't make a distribution if checks fail.
87 # Also, make sure the NEWS file is up-to-date.
88 vc-dist: $(local-check) vc-diff-check maintainer-distcheck
91 # Use this to make sure we don't run these programs when building
92 # from a virgin tgz file, below.
100 # Use -Wformat -Werror to detect format-string/arg-list mismatches.
101 # Also, check for shadowing problems with -Wshadow, and for pointer
102 # arithmetic problems with -Wpointer-arith.
103 # These CFLAGS are pretty strict. If you build this target, you probably
104 # have to have a recent version of gcc and glibc headers.
106 t=$(TMPDIR)/$(PACKAGE)/test
107 my-distcheck: $(local-check) check
110 GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
113 && $(MAKE) CFLAGS='$(warn_cflags)' \
114 AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
118 (cd $(t) && mv $(distdir) $(distdir).old \
119 && $(AMTAR) -zxf - ) < $(distdir).tar.gz
120 diff -ur $(t)/$(distdir).old $(t)/$(distdir)
122 @echo "========================"; \
123 echo "$(distdir).tar.gz is ready for distribution"; \
124 echo "========================"
126 gnulib-version = $$(cd $(gnulib_dir) && git describe)
128 announcement: NEWS ChangeLog $(rel-files)
129 @./build-aux/announce-gen \
130 --release-type=$(RELEASE_TYPE) \
131 --package=$(PACKAGE) \
132 --prev=$(PREV_VERSION) \
134 --gpg-key-id=$(gpg_key_ID) \
136 --bootstrap-tools=autoconf,automake,gnulib \
137 --gnulib-version=$(gnulib-version) \
138 $(addprefix --url-dir=, $(url_dir_list))
140 .PHONY: alpha beta major
141 alpha beta major: $(local-check)
143 && { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$' \
144 || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\
147 $(MAKE) news-date-check changelog-check
149 $(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
150 $(VC-tag) $(this-vc-tag)
152 .PHONY: version-check
154 @case $(VERSION) in \
156 echo "Version \`$(VERSION)' is not a releasable version, please read:"; \
157 echo " http://www.gnu.org/software/libtool/contribute.html"; \
164 ## Make sure we have the previous release tarball in the tree.
165 @if test -z "$(PREV_VERSION)"; \
166 then echo "PREV_VERSION is not set"; exit 1; fi
167 @ofile="$(PACKAGE)-$(PREV_VERSION).tar.gz"; \
168 if test -f $$ofile; then :; \
169 else echo "Cannot make deltas without $$ofile"; exit 1; fi
173 ## Make sure we have the new release tarball in the tree.
174 @ofile="$(PACKAGE)-$(VERSION).tar.gz"; \
175 if test -f $$ofile; then :; \
176 else echo "Cannot make deltas without $$ofile"; exit 1; fi
180 ## Make sure xdelta exists;
181 @if ($(XDELTA) --version 2>&1 | grep version)>/dev/null 2>/dev/null; \
184 echo "Get xdelta from http://sourceforge.net/projects/xdelta."; \
189 deltas: delta-diff delta-xdelta
195 delta-diff: prev-tarball new-tarball
196 ## Unpack the tarballs somewhere to diff them
199 ofile="../$(PACKAGE)-$(PREV_VERSION)-$(VERSION).diff.gz"; \
201 && tar xzf "../$(PACKAGE)-$(PREV_VERSION).tar.gz" \
202 && tar xzf "../$(PACKAGE)-$(VERSION).tar.gz" \
203 && $(DIFF) $(DIFF_OPTIONS) \
204 $(PACKAGE)-$(PREV_VERSION) $(PACKAGE)-$(VERSION) \
205 | GZIP=$(GZIP_ENV) gzip -c > $$ofile
212 delta-xdelta: prev-tarball new-tarball got-xdelta
213 ## Generate the delta file (xdelta has weird exit statuses, so we need to
214 ## add some shell code to keep make happy), and then generate the signatures
215 ## for FSF ftp-upload:
216 ofile="$(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta"; \
217 ( test -z `$(XDELTA) delta $(XDELTA_OPTIONS) \
218 $(PACKAGE)-$(PREV_VERSION).tar.gz $(PACKAGE)-$(VERSION).tar.gz \
225 $(SHELL) ../gendocs.sh $(PACKAGE) \
226 "GNU $(PACKAGE)- GNU macro processor"
227 @echo " *** Upload the doc/manual directory to web-cvs."