* checks/check-them: State why a test is skipped.
[m4/ericb.git] / Makefile.maint
blob4638b12c012cea595c0ecb5875cf002a1f1241a0
1 ## Makefile.maint -- Makefile rules for m4 maintainers -*-Makefile-*-
2 ##
3 ## Copyright (C) 2004, 2005, 2006 Free Software Foundation
4 ##
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 2 of the License, or
8 ## (at your option) any later version.
9 ##
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; see the file COPYING.  If not, write to
17 ## the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 ## Boston, MA 02110-1301, USA.
20 TEXI2HTML = texi2html
22 .PHONY: cvs-release
23 cvs-release: version-check prev-tarball cvs-news fetch cvs-commit cvs-dist deltas web-manual
24         @tarname="$(PACKAGE)-$(VERSION).tar.gz"; \
25         diffname="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).diff.gz"; \
26         xdeltaname="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).xdelta"; \
27         echo " *** Upload $$tarname, $$tarname.sig,";\
28         echo " *** $$tarname.directive.asc, $$diffname,"; \
29         echo " *** $$diffname.sig, $$diffname.directive.asc,"; \
30         echo " *** $$xdeltaname, $$xdeltaname.sig and";\
31         echo " *** $$xdeltaname.directive.asc to either"
32         echo " *** /incoming/alpha or /incoming/ftp on ftp-upload.gnu.org."
34 .PHONY: version-check
35 version-check:
36         @case $(VERSION) in \
37         *[acegikmoqsuwy]) \
38           echo "Version \`$(VERSION)' is not a releasable version, please read:"; \
39           echo "    http://www.gnu.org/software/libtool/contribute.html"; \
40           exit 1; \
41           ;; \
42         esac
44 .PHONY: prev-tarball
45 prev-tarball:
46 ## Make sure we have the previous release tarball in the tree.
47         @if test -z "$(LASTRELEASE)"; \
48                 then echo "LASTRELEASE is not set"; exit 1; fi
49         @ofile="$(PACKAGE)-$(LASTRELEASE).tar.gz"; \
50         if test -f $$ofile; then :; \
51         else echo "Cannot make deltas without $$ofile"; exit 1; fi
53 # TSDEPS will be defined to TSDEPS_DIST at `make dist' time
54 TSDEPS =
55 TSDEPS_DIST = ChangeLog
56 CVS = cvs # set it to `:' to avoid CVS operations
58 .PHONY: timestamps update-timestamps
59 timestamps: update-timestamps
60 update-timestamps:
61         @if (cd $(srcdir) && test -d CVS && \
62             $(CVS) -n update $(TSDEPS_DIST) | grep '^M'); then \
63                 echo "Cannot make cvs-dist before commit"; exit 1; else :; fi
66 .PHONY: cvs-news
67 cvs-news:
68 ## Make sure the NEWS file is up-to-date:
69         @if sed '1,4d;5q' $(srcdir)/NEWS | grep -e "$(VERSION)" >/dev/null; \
70         then :; \
71         else \
72           echo "NEWS not updated; not releasing" 1>&2; \
73           exit 1; \
74         fi
76 ## Program to use to fetch files.
77 WGET = wget
78 WGETSGO = $(WGET) http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
80 ## Files that we fetch and which we compare against.
81 ## FIXME should be a lot more here
82 FETCHFILES = \
83 ./INSTALL \
84 ./install-sh \
85 doc/texinfo.tex
87 ## Fetch the latest versions of files we care about.
88 .PHONY: fetch
89 fetch:
90         rm -rf Fetchdir > /dev/null 2>&1
91         mkdir Fetchdir
92 ## If a get fails then that is a problem.
93         (cd Fetchdir && \
94         $(WGETSGO)/autoconf/autoconf/INSTALL; \
95         $(WGETSGO)/automake/automake/lib/install-sh; \
96         $(WGETSGO)/texinfo/texinfo/doc/texinfo.tex; )
97 ## Don't exit after test because we want to give as many errors as
98 ## possible.
99         @stat=0; for file in $(FETCHFILES); do \
100           fetchedfile=Fetchdir/`echo $$file | sed 's,.*/,,g'`; \
101           if diff -u $(srcdir)/$$file $$fetchedfile \
102             >>Fetchdir/update.patch 2>/dev/null; then :; \
103           else \
104             stat=1; \
105             echo "Updating $(srcdir)/$$file..."; \
106             cp $$fetchedfile $(srcdir)/$$file; \
107           fi; \
108         done; \
109         test $$stat = 1 && \
110           echo "See Fetchdir/update.patch for a log of the changes."; \
111         exit $$stat
114 GPG = gpg # set it to `:' to avoid gpg operations
116 .PHONY: cvs-commit
117 cvs-commit: cvs-news
118         cd $(srcdir) && $(SHELL) ./commit
120 .PHONY: cvs-dist
121 cvs-dist: cvs-news timestamps
122 ## Build the distribution:
123         $(MAKE) dist
124 ## Finally, if everything was successful, tag the release
125         cd $(srcdir) \
126           && $(CVS) -q tag `echo "release-$(VERSION)" | sed 's/\./_/g'`
127 ## Generate signatures and directives for FSF ftp-upload:
128         for suffix in .gz .bz2; do \
129           ofile="$(PACKAGE)-$(VERSION).tar$$suffix"; \
130           $(GPG) --detach-sign $$ofile \
131           && echo "directory: $(PACKAGE)" > $$ofile.directive \
132           && $(GPG) --clearsign $$ofile.directive \
133           && rm -f $$ofile.directive; \
134         done
136 .PHONY: new-tarball
137 new-tarball:
138 ## Make sure we have the new release tarball in the tree.
139         @ofile="$(PACKAGE)-$(VERSION).tar.gz"; \
140         if test -f $$ofile; then :; \
141         else echo "Cannot make deltas without $$ofile"; exit 1; fi
143 .PHONY: got-xdelta
144 got-xdelta:
145 ## Make sure xdelta exists;
146         @if ($(XDELTA) --version 2>&1 | grep version)>/dev/null 2>/dev/null; \
147         then :;\
148         else \
149           echo "Get xdelta from http://sourceforge.net/projects/xdelta."; \
150           exit 1; \
151         fi
153 .PHONY: deltas
154 deltas: delta-diff delta-xdelta
156 DIFF = diff
157 DIFF_OPTIONS = -ruNp
159 .PHONY: delta-diff
160 delta-diff: prev-tarball new-tarball
161 ## Unpack the tarballs somewhere to diff them
162         rm -rf delta-diff
163         mkdir delta-diff
165         ofile="../$(PACKAGE)-$(LASTRELEASE)-$(VERSION).diff.gz"; \
166         cd delta-diff \
167         && tar xzf "../$(PACKAGE)-$(LASTRELEASE).tar.gz" \
168         && tar xzf "../$(PACKAGE)-$(VERSION).tar.gz" \
169         && $(DIFF) $(DIFF_OPTIONS) \
170                 $(PACKAGE)-$(LASTRELEASE) $(PACKAGE)-$(VERSION) \
171                 | GZIP=$(GZIP_ENV) gzip -c > $$ofile \
172         && $(GPG) --detach-sign $$ofile \
173         && echo "directory: $(PACKAGE)" > $$ofile.directive \
174         && $(GPG) --clearsign $$ofile.directive \
175         && rm -f $$ofile.directive
177         rm -rf delta-diff
179 XDELTA = xdelta
180 XDELTA_OPTIONS = -9
182 .PHONY: delta-xdelta
183 delta-xdelta: prev-tarball new-tarball got-xdelta
184 ## Generate the delta file (xdelta has weird exit statuses, so we need to
185 ## add some shell code to keep make happy), and then generate the signatures
186 ## for FSF ftp-upload:
187         ofile="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).xdelta"; \
188         ( test -z `$(XDELTA) delta $(XDELTA_OPTIONS) \
189             $(PACKAGE)-$(LASTRELEASE).tar.gz $(PACKAGE)-$(VERSION).tar.gz \
190             $$ofile 2>&1` \
191           && : ) \
192         && $(GPG) --detach-sign $$ofile \
193         && echo "directory: $(PACKAGE)" > $$ofile.directive \
194         && $(GPG) --clearsign $$ofile.directive \
195         && rm -f $$ofile.directive
197 .PHONY: web-manual
198 web-manual:
199         @cd "$(abs_srcdir)/doc"; \
200           $(SHELL) "$(abs_srcdir)/gendocs.sh" $(PACKAGE) \
201             "GNU $(PACKAGE)- GNU macro processor"
202         @echo " *** Upload the doc/manual directory to web-cvs."