Makefile.maint   [plain text]


## Makefile.maint -- Makefile rules for m4 maintainers -*-Makefile-*-
##
## Copyright (C) 2004, 2005, 2006 Free Software Foundation
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; see the file COPYING.  If not, write to
## the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
## Boston, MA 02110-1301, USA.

TEXI2HTML = texi2html

.PHONY: cvs-release
cvs-release: version-check prev-tarball cvs-news cvs-commit cvs-dist deltas web-manual
	@tarname="$(PACKAGE)-$(VERSION).tar.gz"; \
	diffname="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).diff.gz"; \
	xdeltaname="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).xdelta"; \
	echo " *** Upload $$tarname, $$tarname.sig,";\
	echo " *** $$tarname.directive.asc, $$diffname,"; \
	echo " *** $$diffname.sig, $$diffname.directive.asc,"; \
	echo " *** $$xdeltaname, $$xdeltaname.sig and";\
	echo " *** $$xdeltaname.directive.asc to either"
	echo " *** /incoming/alpha or /incoming/ftp on ftp-upload.gnu.org."

.PHONY: version-check
version-check:
	@case $(VERSION) in \
	*[acegikmoqsuwy]) \
	  echo "Version \`$(VERSION)' is not a releasable version, please read:"; \
	  echo "    http://www.gnu.org/software/libtool/contribute.html"; \
	  exit 1; \
	  ;; \
	esac

.PHONY: prev-tarball
prev-tarball:
## Make sure we have the previous release tarball in the tree.
	@if test -z "$(LASTRELEASE)"; \
		then echo "LASTRELEASE is not set"; exit 1; fi
	@ofile="$(PACKAGE)-$(LASTRELEASE).tar.gz"; \
	if test -f $$ofile; then :; \
	else echo "Cannot make deltas without $$ofile"; exit 1; fi

# TSDEPS will be defined to TSDEPS_DIST at `make dist' time
TSDEPS =
TSDEPS_DIST = ChangeLog
CVS = cvs # set it to `:' to avoid CVS operations

.PHONY: timestamps update-timestamps
timestamps: update-timestamps
update-timestamps:
	@if (cd $(srcdir) && test -d CVS && \
	    $(CVS) -n update $(TSDEPS_DIST) | grep '^M'); then \
		echo "Cannot make cvs-dist before commit"; exit 1; else :; fi


.PHONY: cvs-news
cvs-news:
## Make sure the NEWS file is up-to-date:
	@if sed '1,4d;5q' $(srcdir)/NEWS | grep -e "$(VERSION)" >/dev/null; \
	then :; \
	else \
	  echo "NEWS not updated; not releasing" 1>&2; \
	  exit 1; \
	fi

.PHONY: cvs-commit
cvs-commit: cvs-news
	cd $(srcdir) && $(SHELL) ./commit

.PHONY: cvs-dist
cvs-dist: cvs-news timestamps
## Build the distribution:
	$(MAKE) dist
## Finally, if everything was successful, tag the release
	cd $(srcdir) \
	  && $(CVS) -q tag `echo "release-$(VERSION)" | sed 's/\./_/g'`

.PHONY: new-tarball
new-tarball:
## Make sure we have the new release tarball in the tree.
	@ofile="$(PACKAGE)-$(VERSION).tar.gz"; \
	if test -f $$ofile; then :; \
	else echo "Cannot make deltas without $$ofile"; exit 1; fi

.PHONY: got-xdelta
got-xdelta:
## Make sure xdelta exists;
	@if ($(XDELTA) --version 2>&1 | grep version)>/dev/null 2>/dev/null; \
	then :;\
	else \
	  echo "Get xdelta from http://sourceforge.net/projects/xdelta."; \
	  exit 1; \
	fi

.PHONY: deltas
deltas: delta-diff delta-xdelta

DIFF = diff
DIFF_OPTIONS = -ruNp

.PHONY: delta-diff
delta-diff: prev-tarball new-tarball
## Unpack the tarballs somewhere to diff them
	rm -rf delta-diff
	mkdir delta-diff

	ofile="../$(PACKAGE)-$(LASTRELEASE)-$(VERSION).diff.gz"; \
	cd delta-diff \
	&& tar xzf "../$(PACKAGE)-$(LASTRELEASE).tar.gz" \
	&& tar xzf "../$(PACKAGE)-$(VERSION).tar.gz" \
	&& $(DIFF) $(DIFF_OPTIONS) \
		$(PACKAGE)-$(LASTRELEASE) $(PACKAGE)-$(VERSION) \
		| GZIP=$(GZIP_ENV) gzip -c > $$ofile

	rm -rf delta-diff

XDELTA = xdelta
XDELTA_OPTIONS = -9

.PHONY: delta-xdelta
delta-xdelta: prev-tarball new-tarball got-xdelta
## Generate the delta file (xdelta has weird exit statuses, so we need to
## add some shell code to keep make happy), and then generate the signatures
## for FSF ftp-upload:
	ofile="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).xdelta"; \
	( test -z `$(XDELTA) delta $(XDELTA_OPTIONS) \
	    $(PACKAGE)-$(LASTRELEASE).tar.gz $(PACKAGE)-$(VERSION).tar.gz \
	    $$ofile 2>&1` \
	  && : )

.PHONY: web-manual
web-manual:
	@cd ./doc ; \
	  $(SHELL) ../gendocs.sh $(PACKAGE) \
	    "GNU $(PACKAGE)- GNU macro processor"
	@echo " *** Upload the doc/manual directory to web-cvs."