* m4/libtool.m4, ltmain.in (darwin): Support IBM's xlc and xlc++.
[libtool.git] / Makefile.maint
bloba44efd649786c5686a02573fb0678e84cb8cd56f
1 ## Makefile.maint -- Makefile rules for libtool maintainers
2 ##
3 ## Copyright (C) 2004 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., 59 Temple Place - Suite 330,
18 ## Boston, MA 02111-1307, USA.
20 # Need various variables defined by configure, a lot easier to just
21 # include the Makefile than figure out a way to put them in here too
22 include Makefile
23 Makefile:
24         @echo " *** Source directory must be configured to use the "
25         @echo " *** maintainer rules."
26         @exit 1
28 TEXI2HTML = texi2html
30 .PHONY: cvs-release
31 cvs-release: version-check prev-tarball cvs-news fetch cvs-commit cvs-dist deltas web-manual
32         @tarname="$(PACKAGE)-$(VERSION).tar.gz"; \
33         diffname="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).diff.gz"; \
34         xdeltaname="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).xdelta"; \
35         echo " *** Upload $$tarname, $$tarname.sig,";\
36         echo " *** $$tarname.directive.asc, $$diffname,"; \
37         echo " *** $$diffname.sig, $$diffname.directive.asc,"; \
38         echo " *** $$xdeltaname, $$xdeltaname.sig and";\
39         echo " *** $$xdeltaname.directive.asc to either"
40         echo " *** /incoming/alpha or /incoming/ftp on ftp-upload.gnu.org."
41         echo " *** You might need to upload manual.html to webcvs/libtool."
43 .PHONY: version-check
44 version-check:
45         @case $(VERSION) in \
46         *[acegikmoqsuwy]) \
47           echo "Version \`$(VERSION)' is not a releasable version, please read:"; \
48           echo "    http://www.gnu.org/software/libtool/contribute.html"; \
49           exit 1; \
50           ;; \
51         esac
53 .PHONY: prev-tarball
54 prev-tarball:
55 ## Make sure we have the previous release tarball in the tree.
56         @if test -z "$(LASTRELEASE)"; \
57                 then echo "LASTRELEASE is not set"; exit 1; fi
58         @ofile="$(PACKAGE)-$(LASTRELEASE).tar.gz"; \
59         if test -f $$ofile; then :; \
60         else echo "Cannot make deltas without $$ofile"; exit 1; fi
62 # TSDEPS will be defined to TSDEPS_DIST at `make dist' time
63 TSDEPS =
64 TSDEPS_DIST = ChangeLog m4/libtool.m4
65 CVS = cvs # set it to `:' to avoid CVS operations
67 .PHONY: timestamps update-timestamps
68 timestamps: update-timestamps
69 update-timestamps:
70         @if (cd $(srcdir) && test -d CVS && \
71             $(CVS) -n update $(TSDEPS_DIST) | grep '^M'); then \
72                 echo "Cannot make cvs-dist before commit"; exit 1; else :; fi
75 .PHONY: cvs-news
76 cvs-news:
77 ## Make sure the NEWS file is up-to-date:
78         @if sed '1,2d;3q' $(srcdir)/NEWS | grep -e "$(VERSION)" >/dev/null; \
79         then :; \
80         else \
81           echo "NEWS not updated; not releasing" 1>&2; \
82           exit 1; \
83         fi
85 ## Program to use to fetch files.
86 WGET = wget
87 WGETSGO = $(WGET) http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
89 ## Files that we fetch and which we compare against.
90 ## FIXME should be a lot more here
91 FETCHFILES = \
92 ./INSTALL \
93 config/config.guess \
94 config/config.sub \
95 config/texinfo.tex
97 ## Fetch the latest versions of files we care about.
98 .PHONY: fetch
99 fetch:
100         rm -rf Fetchdir > /dev/null 2>&1
101         mkdir Fetchdir
102 ## If a get fails then that is a problem.
103         (cd Fetchdir && \
104         $(WGETSGO)/autoconf/autoconf/INSTALL; \
105         $(WGETSGO)/config/config/config.guess; \
106         $(WGETSGO)/config/config/config.sub; \
107         $(WGETSGO)/texinfo/texinfo/doc/texinfo.tex )
108 ## Don't exit after test because we want to give as many errors as
109 ## possible.
110         @stat=0; for file in $(FETCHFILES); do \
111           fetchedfile=Fetchdir/`echo $$file | sed 's,.*/,,g'`; \
112           if diff -u $(srcdir)/$$file $$fetchedfile \
113             >>Fetchdir/update.patch 2>/dev/null; then :; \
114           else \
115             stat=1; \
116             echo "Updating $(srcdir)/$$file..."; \
117             cp $$fetchedfile $(srcdir)/$$file; \
118           fi; \
119         done; \
120         test $$stat = 1 && \
121           echo "See Fetchdir/update.patch for a log of the changes."; \
122         exit $$stat
125 GPG = gpg # set it to `:' to avoid gpg operations
127 .PHONY: cvs-commit
128 cvs-commit: cvs-news
129         cd $(srcdir) && $(SHELL) ./commit
131 .PHONY: cvs-dist
132 cvs-dist: cvs-news timestamps
133 ## Build the distribution:
134         $(MAKE) distcheck
135 ## Finally, if everything was successful, tag the release
136         cd $(srcdir) \
137           && $(CVS) -q tag -c `echo "release-$(VERSION)" | sed 's/\./-/g'`
138 ## Generate signatures and directives for FSF ftp-upload:
139         ofile="$(PACKAGE)-$(VERSION).tar.gz"; \
140         $(GPG) --detach-sign $$ofile \
141         && echo "directory: libtool" > $$ofile.directive \
142         && $(GPG) --clearsign $$ofile.directive \
143         && rm -f $$ofile.directive
145 .PHONY: new-tarball
146 new-tarball:
147 ## Make sure we have the new release tarball in the tree.
148         @ofile="$(PACKAGE)-$(VERSION).tar.gz"; \
149         if test -f $$ofile; then :; \
150         else echo "Cannot make deltas without $$ofile"; exit 1; fi
152 .PHONY: got-xdelta
153 got-xdelta:
154 ## Make sure xdelta exists;
155         @if ($(XDELTA) --version 2>&1 | grep version)>/dev/null 2>/dev/null; \
156         then :;\
157         else \
158           echo "Get xdelta from http://sourceforge.net/projects/xdelta."; \
159           exit 1; \
160         fi
162 .PHONY: deltas
163 deltas: delta-diff delta-xdelta
165 DIFF = diff
166 DIFF_OPTIONS = -ruNp
168 .PHONY: delta-diff
169 delta-diff: prev-tarball new-tarball
170 ## Unpack the tarballs somewhere to diff them
171         rm -rf delta-diff
172         mkdir delta-diff
174         ofile="../$(PACKAGE)-$(LASTRELEASE)-$(VERSION).diff.gz"; \
175         cd delta-diff \
176         && tar xzf "../$(PACKAGE)-$(LASTRELEASE).tar.gz" \
177         && tar xzf "../$(PACKAGE)-$(VERSION).tar.gz" \
178         && $(DIFF) $(DIFF_OPTIONS) \
179                 $(PACKAGE)-$(LASTRELEASE) $(PACKAGE)-$(VERSION) \
180                 | GZIP=$(GZIP_ENV) gzip -c > $$ofile \
181         && $(GPG) --detach-sign $$ofile \
182         && echo "directory: libtool" > $$ofile.directive \
183         && $(GPG) --clearsign $$ofile.directive \
184         && rm -f $$ofile.directive
186         rm -rf delta-diff
188 XDELTA = xdelta
189 XDELTA_OPTIONS = --pristine -9
191 .PHONY: delta-xdelta
192 delta-xdelta: prev-tarball new-tarball got-xdelta
193 ## Generate the delta file (xdelta has wierd exit statuses, so we need to
194 ## add some shell code to keep make happy), and then generate the signatures
195 ## for FSF ftp-upload:
196         ofile="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).xdelta"; \
197         ( test -z `$(XDELTA) delta $(XDELTA_OPTIONS) \
198             $(PACKAGE)-$(LASTRELEASE).tar.gz $(PACKAGE)-$(VERSION).tar.gz \
199             $$ofile 2>&1` \
200           && : ) \
201         && $(GPG) --detach-sign $$ofile \
202         && echo "directory: libtool" > $$ofile.directive \
203         && $(GPG) --clearsign $$ofile.directive \
204         && rm -f $$ofile.directive
206 .PHONY: web-manual
207 web-manual:
208         @$(LN_S) $(top_srcdir)/doc/libtool.texi doc/manual.texi
209         $(TEXI2HTML) -I doc -monolithic -number -verbose doc/manual.texi
210         @mv doc/manual.html manual.html
211         @rm -f doc/manual.texi