Use fastmaps for better regex performance.
[m4/ericb.git] / Makefile.maint
blobc07aee128eda2a67ba142e5ab40d21445ff2cb27
1 ## Makefile.maint -- Makefile rules for m4 maintainers -*-Makefile-*-
2 ##
3 ## Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation
4 ##
5 ## This file is part of GNU M4.
6 ##
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 TEXI2HTML = texi2html
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."
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 .PHONY: cvs-commit
77 cvs-commit: cvs-news
78         cd $(srcdir) && $(SHELL) ./commit
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'`
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
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
105 .PHONY: deltas
106 deltas: delta-diff delta-xdelta
108 DIFF = diff
109 DIFF_OPTIONS = -ruNp
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
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
125         rm -rf delta-diff
127 XDELTA = xdelta
128 XDELTA_OPTIONS = -9
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           && : )
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."