| 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. | 
|---|
| 14 | ## | 
|---|
| 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. | 
|---|
| 19 |  | 
|---|
| 20 | TEXI2HTML = texi2html | 
|---|
| 21 |  | 
|---|
| 22 | .PHONY: cvs-release | 
|---|
| 23 | cvs-release: version-check prev-tarball cvs-news 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." | 
|---|
| 33 |  | 
|---|
| 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 | 
|---|
| 43 |  | 
|---|
| 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 | 
|---|
| 52 |  | 
|---|
| 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 | 
|---|
| 57 |  | 
|---|
| 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 | 
|---|
| 64 |  | 
|---|
| 65 |  | 
|---|
| 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 | 
|---|
| 75 |  | 
|---|
| 76 | .PHONY: cvs-commit | 
|---|
| 77 | cvs-commit: cvs-news | 
|---|
| 78 | cd $(srcdir) && $(SHELL) ./commit | 
|---|
| 79 |  | 
|---|
| 80 | .PHONY: cvs-dist | 
|---|
| 81 | cvs-dist: cvs-news timestamps | 
|---|
| 82 | ## Build the distribution: | 
|---|
| 83 | $(MAKE) dist | 
|---|
| 84 | ## Finally, if everything was successful, tag the release | 
|---|
| 85 | cd $(srcdir) \ | 
|---|
| 86 | && $(CVS) -q tag `echo "release-$(VERSION)" | sed 's/\./_/g'` | 
|---|
| 87 |  | 
|---|
| 88 | .PHONY: new-tarball | 
|---|
| 89 | new-tarball: | 
|---|
| 90 | ## Make sure we have the new release tarball in the tree. | 
|---|
| 91 | @ofile="$(PACKAGE)-$(VERSION).tar.gz"; \ | 
|---|
| 92 | if test -f $$ofile; then :; \ | 
|---|
| 93 | else echo "Cannot make deltas without $$ofile"; exit 1; fi | 
|---|
| 94 |  | 
|---|
| 95 | .PHONY: got-xdelta | 
|---|
| 96 | got-xdelta: | 
|---|
| 97 | ## Make sure xdelta exists; | 
|---|
| 98 | @if ($(XDELTA) --version 2>&1 | grep version)>/dev/null 2>/dev/null; \ | 
|---|
| 99 | then :;\ | 
|---|
| 100 | else \ | 
|---|
| 101 | echo "Get xdelta from http://sourceforge.net/projects/xdelta."; \ | 
|---|
| 102 | exit 1; \ | 
|---|
| 103 | fi | 
|---|
| 104 |  | 
|---|
| 105 | .PHONY: deltas | 
|---|
| 106 | deltas: delta-diff delta-xdelta | 
|---|
| 107 |  | 
|---|
| 108 | DIFF = diff | 
|---|
| 109 | DIFF_OPTIONS = -ruNp | 
|---|
| 110 |  | 
|---|
| 111 | .PHONY: delta-diff | 
|---|
| 112 | delta-diff: prev-tarball new-tarball | 
|---|
| 113 | ## Unpack the tarballs somewhere to diff them | 
|---|
| 114 | rm -rf delta-diff | 
|---|
| 115 | mkdir delta-diff | 
|---|
| 116 |  | 
|---|
| 117 | ofile="../$(PACKAGE)-$(LASTRELEASE)-$(VERSION).diff.gz"; \ | 
|---|
| 118 | cd delta-diff \ | 
|---|
| 119 | && tar xzf "../$(PACKAGE)-$(LASTRELEASE).tar.gz" \ | 
|---|
| 120 | && tar xzf "../$(PACKAGE)-$(VERSION).tar.gz" \ | 
|---|
| 121 | && $(DIFF) $(DIFF_OPTIONS) \ | 
|---|
| 122 | $(PACKAGE)-$(LASTRELEASE) $(PACKAGE)-$(VERSION) \ | 
|---|
| 123 | | GZIP=$(GZIP_ENV) gzip -c > $$ofile | 
|---|
| 124 |  | 
|---|
| 125 | rm -rf delta-diff | 
|---|
| 126 |  | 
|---|
| 127 | XDELTA = xdelta | 
|---|
| 128 | XDELTA_OPTIONS = -9 | 
|---|
| 129 |  | 
|---|
| 130 | .PHONY: delta-xdelta | 
|---|
| 131 | delta-xdelta: prev-tarball new-tarball got-xdelta | 
|---|
| 132 | ## Generate the delta file (xdelta has weird exit statuses, so we need to | 
|---|
| 133 | ## add some shell code to keep make happy), and then generate the signatures | 
|---|
| 134 | ## for FSF ftp-upload: | 
|---|
| 135 | ofile="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).xdelta"; \ | 
|---|
| 136 | ( test -z `$(XDELTA) delta $(XDELTA_OPTIONS) \ | 
|---|
| 137 | $(PACKAGE)-$(LASTRELEASE).tar.gz $(PACKAGE)-$(VERSION).tar.gz \ | 
|---|
| 138 | $$ofile 2>&1` \ | 
|---|
| 139 | && : ) | 
|---|
| 140 |  | 
|---|
| 141 | .PHONY: web-manual | 
|---|
| 142 | web-manual: | 
|---|
| 143 | @cd ./doc ; \ | 
|---|
| 144 | $(SHELL) ../gendocs.sh $(PACKAGE) \ | 
|---|
| 145 | "GNU $(PACKAGE)- GNU macro processor" | 
|---|
| 146 | @echo " *** Upload the doc/manual directory to web-cvs." | 
|---|