Support ifort on darwin.
[libtool.git] / Makefile.maint
blob72cac5b77123bced815d6e7243b21079e2f582ee
1 ## Makefile.maint -- Makefile rules for libtool maintainers -*-Makefile-*-
2 ##
3 ##   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
4 ##   Written by Scott James Remnant, 2004
5 ##
6 ##   This file is part of GNU Libtool.
7 ##
8 ## GNU Libtool is free software; you can redistribute it and/or modify
9 ## it under the terms of the GNU General Public License as published by
10 ## the Free Software Foundation; either version 2 of the License, or
11 ## (at your option) any later version.
13 ## GNU Libtool is distributed in the hope that it will be useful,
14 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 ## GNU General Public License for more details.
18 ## You should have received a copy of the GNU General Public License
19 ## along with GNU Libtool; see the file COPYING.  If not, a copy
20 ## can be downloaded from http://www.gnu.org/licenses/gpl.html,
21 ## or obtained by writing to the Free ## Software Foundation, Inc.,
22 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #####
25 # Need various variables defined by configure, a lot easier to just
26 # include the Makefile than figure out a way to put them in here too
27 include Makefile
28 Makefile:
29         @echo " *** Run maintainer rules from the build tree, with"
30         @echo " *** \`make -f../Makefile.maint' for example, where"
31         @echo " *** \`../' is the relative path back to the directory"
32         @echo " *** that contains the \`Makefile.maint'.  Alternatively,"
33         @echo " *** run \`./configure' in the source tree for an in"
34         @echo " *** tree build."
35         @exit 1
37 TEXI2HTML = texi2html
39 $(srcdir)/commit: $(srcdir)/$(auxdir)/mailnotify clcommit.m4sh
40         $(timestamp); \
41         cd $(srcdir); \
42         rm -f commit commit.in commit.tmp; \
43         $(M4SH) -B $(auxdir) clcommit.m4sh > commit.in; \
44         input="clcommit.m4sh"; \
45         $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" commit.in > commit.tmp; \
46         chmod a+x commit.tmp; \
47         chmod a-w commit.tmp; \
48         mv -f commit.tmp commit; \
49         rm -f commit.in
51 $(srcdir)/$(auxdir)/mailnotify: $(auxdir)/mailnotify.m4sh
52         $(timestamp); \
53         cd $(srcdir)/$(auxdir); \
54         rm -f mailnotify mailnotify.in mailnotify.tmp; \
55         $(M4SH) -B . mailnotify.m4sh > mailnotify.in; \
56         input="mailnotify.m4sh"; \
57         $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \
58                 mailnotify.in > mailnotify.tmp; \
59         chmod a+x mailnotify.tmp; \
60         chmod a-w mailnotify.tmp; \
61         mv -f mailnotify.tmp mailnotify; \
62         rm -f mailnotify.in
64 .PHONY: cvs-release
65 cvs-release: version-check prev-tarball cvs-news fetch cvs-commit cvs-dist deltas web-manual
66         @tarname="$(PACKAGE)-$(VERSION).tar.gz"; \
67         diffname="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).diff.gz"; \
68         xdeltaname="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).xdelta"; \
69         echo " *** Upload $$tarname, $$tarname.sig,";\
70         echo " *** $$tarname.directive.asc, $$diffname,"; \
71         echo " *** $$diffname.sig, $$diffname.directive.asc,"; \
72         echo " *** $$xdeltaname, $$xdeltaname.sig and";\
73         echo " *** $$xdeltaname.directive.asc to either"
74         echo " *** /incoming/alpha or /incoming/ftp on ftp-upload.gnu.org."
75         echo " *** You might need to upload manual.html to webcvs/libtool."
77 .PHONY: version-check
78 version-check:
79         @case $(VERSION) in \
80         *[acegikmoqsuwy]) \
81           echo "Version \`$(VERSION)' is not a releasable version, please read:"; \
82           echo "    http://www.gnu.org/software/libtool/contribute.html"; \
83           exit 1; \
84           ;; \
85         esac
87 .PHONY: prev-tarball
88 prev-tarball:
89 ## Make sure we have the previous release tarball in the tree.
90         @if test -z "$(LASTRELEASE)"; \
91                 then echo "LASTRELEASE is not set"; exit 1; fi
92         @ofile="$(PACKAGE)-$(LASTRELEASE).tar.gz"; \
93         if test -f $$ofile; then :; \
94         else echo "Cannot make deltas without $$ofile"; exit 1; fi
96 TSDEPS = ChangeLog libltdl/m4/libtool.m4
97 CVS = cvs # set it to `:' to avoid CVS operations
99 .PHONY: timestamps update-timestamps
100 timestamps: update-timestamps
101 update-timestamps:
102         @if (cd $(srcdir) && test -d CVS && \
103             $(CVS) -n update $(TSDEPS) | grep '^M'); then \
104                 echo "Cannot make cvs-dist before commit"; exit 1; else :; fi
107 .PHONY: cvs-news
108 cvs-news:
109 ## Make sure the NEWS file is up-to-date:
110         @if sed '1,2d;3q' $(srcdir)/NEWS | grep -e "$(VERSION)" >/dev/null; \
111         then :; \
112         else \
113           echo "NEWS not updated; not releasing" 1>&2; \
114           exit 1; \
115         fi
117 ## Program to use to fetch files.
118 WGET = wget
119 WGETSGO = $(WGET) 'http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~'
120 WGET_GIT = $(WGET) 'http://git.savannah.gnu.org/gitweb/?a=blob_plain;hb=HEAD;p='
122 ## Files that we fetch and which we compare against.
123 ## FIXME should be a lot more here
124 FETCHFILES = \
125 ./INSTALL \
126 $(auxdir)/install-sh \
127 $(auxdir)/config.guess \
128 $(auxdir)/config.sub \
129 $(auxdir)/texinfo.tex
131 ## Fetch the latest versions of files we care about.
132 .PHONY: fetch
133 fetch:
134         rm -rf Fetchdir > /dev/null 2>&1
135         mkdir Fetchdir
136 ## If a get fails then that is a problem.
137         (cd Fetchdir && \
138         $(WGET_GIT)'gnulib.git;f=doc/INSTALL' -O INSTALL && \
139         $(WGET_GIT)'automake.git;f=lib/install-sh' -O install-sh && \
140         $(WGETSGO)/config/config/config.guess -O config.guess && \
141         $(WGETSGO)/config/config/config.sub -O config.sub && \
142         $(WGETSGO)/texinfo/texinfo/doc/texinfo.tex -O texinfo.tex )
143 ## Don't exit after test because we want to give as many errors as
144 ## possible.
145         @stat=0; for file in $(FETCHFILES); do \
146           fetchedfile=Fetchdir/`echo $$file | sed 's,.*/,,g'`; \
147           if diff -u $(srcdir)/$$file $$fetchedfile \
148             >>Fetchdir/update.patch 2>/dev/null; then :; \
149           else \
150             stat=1; \
151             echo "Updating $(srcdir)/$$file..."; \
152             cp $$fetchedfile $(srcdir)/$$file; \
153           fi; \
154         done; \
155         test $$stat = 1 && \
156           echo "See Fetchdir/update.patch for a log of the changes."; \
157         exit $$stat
160 GPG = gpg # set it to `:' to avoid gpg operations
162 .PHONY: cvs-commit
163 cvs-commit: cvs-news
164         cd $(srcdir) && $(SHELL) ./commit
166 .PHONY: cvs-dist
167 cvs-dist: cvs-news timestamps
168 ## Build the distribution:
169         $(MAKE) distcheck
170 ## Finally, if everything was successful, tag the release
171         cd $(srcdir) \
172           && $(CVS) -q tag `echo "release-$(VERSION)" | sed 's/\./-/g'`
173 ## Generate signatures and directives for FSF ftp-upload:
174         for suffix in gz bz2; do \
175           ofile="$(PACKAGE)-$(VERSION).tar.$$suffix"; \
176           $(GPG) --detach-sign $$ofile \
177           && echo "directory: libtool" > $$ofile.directive \
178           && $(GPG) --clearsign $$ofile.directive \
179           && rm -f $$ofile.directive; \
180         done
182 .PHONY: new-tarball
183 new-tarball:
184 ## Make sure we have the new release tarball in the tree.
185         @ofile="$(PACKAGE)-$(VERSION).tar.gz"; \
186         if test -f $$ofile; then :; \
187         else echo "Cannot make deltas without $$ofile"; exit 1; fi
189 .PHONY: got-xdelta
190 got-xdelta:
191 ## Make sure xdelta exists;
192         @if ($(XDELTA) --version 2>&1 | grep version)>/dev/null 2>/dev/null; \
193         then :;\
194         else \
195           echo "Get xdelta from http://sourceforge.net/projects/xdelta."; \
196           exit 1; \
197         fi
199 .PHONY: deltas
200 deltas: delta-diff delta-xdelta
202 DIFF = diff
203 DIFF_OPTIONS = -ruNp
205 .PHONY: delta-diff
206 delta-diff: prev-tarball new-tarball
207 ## Unpack the tarballs somewhere to diff them
208         rm -rf delta-diff
209         mkdir delta-diff
211         ofile="../$(PACKAGE)-$(LASTRELEASE)-$(VERSION).diff.gz"; \
212         cd delta-diff \
213         && tar xzf "../$(PACKAGE)-$(LASTRELEASE).tar.gz" \
214         && tar xzf "../$(PACKAGE)-$(VERSION).tar.gz" \
215         && $(DIFF) $(DIFF_OPTIONS) \
216                 $(PACKAGE)-$(LASTRELEASE) $(PACKAGE)-$(VERSION) \
217                 | GZIP=$(GZIP_ENV) gzip -c > $$ofile \
218         && $(GPG) --detach-sign $$ofile \
219         && echo "directory: libtool" > $$ofile.directive \
220         && $(GPG) --clearsign $$ofile.directive \
221         && rm -f $$ofile.directive
223         rm -rf delta-diff
225 XDELTA = xdelta
226 XDELTA_OPTIONS = -9
228 .PHONY: delta-xdelta
229 delta-xdelta: prev-tarball new-tarball got-xdelta
230 ## Generate the delta file (xdelta has wierd exit statuses, so we need to
231 ## add some shell code to keep make happy), and then generate the signatures
232 ## for FSF ftp-upload:
233         ofile="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).xdelta"; \
234         ( test -z `$(XDELTA) delta $(XDELTA_OPTIONS) \
235             $(PACKAGE)-$(LASTRELEASE).tar.gz $(PACKAGE)-$(VERSION).tar.gz \
236             $$ofile 2>&1` \
237           && : ) \
238         && $(GPG) --detach-sign $$ofile \
239         && echo "directory: libtool" > $$ofile.directive \
240         && $(GPG) --clearsign $$ofile.directive \
241         && rm -f $$ofile.directive
243 .PHONY: web-manual
244 web-manual:
245         @rm -f doc/manual.texi manual.html
246         @$(LN_S) $(abs_srcdir)/doc/libtool.texi doc/manual.texi
247         $(TEXI2HTML) -I doc -I $(srcdir)/doc -monolithic -number -verbose doc/manual.texi
248         @test -f manual.html || mv doc/manual.html manual.html
249         @rm -f doc/manual.texi