* m4/libtool.m4: Quote shrext as it is evaled in ltmain.
[libtool.git] / Makefile.am
blobf2ab94d546b6d22bce53efaf5099d687acd7b7df
1 ## Makefile.am -- Process this file with automake to produce Makefile.in
2 ##
3 ## Copyright (C) 2003, 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 ACLOCAL_AMFLAGS  = -I m4
22 BUILD_SUBDIRS = . libltdl doc tests
23 SUBDIRS = $(BUILD_SUBDIRS)
24 DIST_SUBDIRS = $(BUILD_SUBDIRS)
26 EXTRA_DIST = bootstrap libtoolize.in ltmain.in config/mkstamp stamp-vcl \
27         ChangeLog.1996 ChangeLog.1997 ChangeLog.1998 ChangeLog.1999 \
28         ChangeLog.2000 ChangeLog.2001 ChangeLog.2002 ChangeLog.2003
29 CLEANFILES = libtool libtoolize ltmain.shT
31 # These are required by libtoolize.
32 pkgdata_SCRIPTS = config/config.guess config/config.sub
33 pkgdata_DATA = config/ltmain.sh
35 # Me maintain our own macros to provent problems with ancient definitions.
36 pkgmacrodir = $(pkgdatadir)/m4
37 pkgmacro_DATA = m4/libtool.m4 m4/ltdl.m4 m4/ltsugar.m4
39 # The standalone libtool script, and the libtool distributor.
40 bin_SCRIPTS = libtool libtoolize
42 config_status = $(top_builddir)/config.status
44 libtool: config/ltmain.sh $(top_builddir)/config.status
45         CONFIG_FILES= CONFIG_HEADERS= CONFIG_COMMANDS=$@ $(SHELL) $(config_status)
46         chmod +x $@
48 libtoolize: $(srcdir)/libtoolize.in $(top_builddir)/config.status
49         CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_COMMANDS= $(SHELL) $(config_status)
50         chmod +x $@
52 # Make sure config.status is regenerated when the version timestamp changes
53 MKSTAMP = $(SHELL) $(top_srcdir)/config/mkstamp
54 $(config_status): stamp-vcl
55 stamp-vcl: vcl.tmp $(top_srcdir)/ChangeLog
56 vcl.tmp:
57         @dir=.; test -f $$dir/stamp-vcl || dir=$(srcdir); \
58         set `$(MKSTAMP) < $(top_srcdir)/ChangeLog`; \
59         echo "$$1" > vcl.tmp; \
60         cmp -s vcl.tmp $$dir/stamp-vcl \
61 ## If mkstamp does not match $(srcdir)/stamp-vcl, we still put the new one
62 ## in the current dir, incase $(srcdir) is not writable.  The dir selection
63 ## at the top of this rule takes care of prefering the right one on
64 ## subsequent runs.
65           || (echo "Updating stamp-vcl"; cp vcl.tmp ./stamp-vcl)
66         -@rm -f vcl.tmp
68 .PHONY: configure-subdirs
69 configure-subdirs distdir: $(DIST_MAKEFILE_LIST)
70 @DIST_MAKEFILE_LIST@:
71         dir=`echo $@ | sed 's,^[^/]*$$,.,;s,/[^/]*$$,,'`; \
72         test -d $$dir || mkdir $$dir || exit 1; \
73         abs_srcdir=`cd $(top_srcdir) && pwd`; \
74         (cd $$dir && $$abs_srcdir/$$dir/configure) || exit 1
76 install-data-local:
77 ## Don't install over the top of an old pkgdatadir
78         -rm -rf $(DESTDIR)$(pkgdatadir)
79 ## Remove old macro definitions
80         -rm -rf $(DESTDIR)$(aclocaldir)/ltdl.m4
81         -rm -rf $(DESTDIR)$(aclocaldir)/libtool.m4
83 # Create and install libltdl
84 install-data-hook:
85         cd libltdl && $(MAKE) local-install-files
87 # Uninstall libltdl
88 uninstall-local:
89         -rm -rf $(DESTDIR)$(pkgdatadir)/libltdl
92 ## ---------------------------------------------------------------- ##
93 ##  Everything past here is useful to the maintainer, but probably  ##
94 ##  not to anybody else (inspiration from automake/Makefile.am).    ##
95 ## ---------------------------------------------------------------- ##
97 CHECK_LASTRELEASE = if test -z "$(LASTRELEASE)"; \
98                       then echo "LASTRELEASE is not set"; exit 1; fi
100 .PHONY: cvs-release
101 cvs-release: version-check prev-tarball cvs-news fetch cvs-dist cvs-diff xdelta
102         @$(CHECK_LASTRELEASE); tarname="$(PACKAGE)-$(VERSION).tar.gz"; \
103         diffname="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).diff.gz"; \
104         xdeltaname="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).xdelta"; \
105         echo " *** Upload $$tarname, $$tarname.sig,";\
106         echo " *** $$tarname.directive.asc, $$diffname,"; \
107         echo " *** $$diffname.sig, $$diffname.directive.asc,"; \
108         echo " *** $$xdeltaname, $$xdeltaname.sig and";\
109         echo " *** $$xdeltaname.directive.asc to either";\
110         echo " *** /incoming/alpha or /incoming/ftp on ftp-upload.gnu.org.";
112 .PHONY: version-check
113 version-check:
114         @case $(VERSION) in \
115         *[acegikmoqsuwy]) \
116           echo "Version \`$(VERSION)' is not a releasable version, please read:"; \
117           echo "    http://www.gnu.org/software/libtool/contribute.html"; \
118           exit 1; \
119           ;; \
120         esac
122 .PHONY: prev-tarball
123 prev-tarball:
124 ## Make sure we have the previous release tarball in the tree.
125         @$(CHECK_LASTRELEASE); ofile="$(PACKAGE)-$(LASTRELEASE).tar.gz"; \
126         if test -f $$ofile; then :; \
127         else echo "Cannot make xdelta without $$ofile"; exit 1; fi
129 # TSDEPS will be defined to TSDEPS_DIST at `make dist' time
130 TSDEPS =
131 TSDEPS_DIST = ChangeLog m4/libtool.m4
132 CVS = cvs # set it to `:' to avoid CVS operations
134 .PHONY: timestamps update-timestamps
135 timestamps: update-timestamps
136 update-timestamps:
137         @if (cd $(srcdir) && test -d CVS && \
138             $(CVS) -n update $(TSDEPS_DIST) | grep '^M'); then \
139                 echo "Cannot make cvs-dist before commit"; exit 1; else :; fi
142 .PHONY: cvs-news
143 cvs-news: timestamps
144 ## Make sure the NEWS file is up-to-date:
145         @if sed '1,2d;3q' $(srcdir)/NEWS | grep -e "$(VERSION)" >/dev/null; \
146         then :; \
147         else \
148           echo "NEWS not updated; not releasing" 1>&2; \
149           exit 1; \
150         fi
152 ## Program to use to fetch files.
153 WGET = wget
154 WGETSGO = $(WGET) http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
156 ## Files that we fetch and which we compare against.
157 ## FIXME should be a lot more here
158 FETCHFILES = \
159 ./INSTALL \
160 config/config.guess \
161 libltdl/config.guess \
162 config/config.sub \
163 libltdl/config.sub \
164 config/texinfo.tex
166 ## Fetch the latest versions of files we care about.
167 .PHONY: fetch
168 fetch:
169         rm -rf Fetchdir > /dev/null 2>&1
170         mkdir Fetchdir
171 ## If a get fails then that is a problem.
172         (cd Fetchdir && \
173         $(WGETSGO)/autoconf/autoconf/INSTALL; \
174         $(WGETSGO)/config/config/config.guess; \
175         $(WGETSGO)/config/config/config.sub; \
176         $(WGETSGO)/texinfo/texinfo/doc/texinfo.tex )
177 ## Don't exit after test because we want to give as many errors as
178 ## possible.
179         @stat=0; for file in $(FETCHFILES); do \
180           fetchedfile=Fetchdir/`echo $$file | sed 's,.*/,,g'`; \
181           if diff -u $(srcdir)/$$file $$fetchedfile \
182             >>Fetchdir/update.patch 2>/dev/null; then :; \
183           else \
184             stat=1; \
185             echo "Updating $(srcdir)/$$file..."; \
186             cp $$fetchedfile $(srcdir)/$$file; \
187           fi; \
188         done; \
189         test $$stat = 1 && \
190           echo "See Fetchdir/update.patch for a log of the changes."; \
191         exit $$stat
194 GPG = gpg # set it to `:' to avoid gpg operations
196 .PHONY: cvs-dist
197 cvs-dist: cvs-news
198 ## Build the distribution:
199         $(MAKE) distcheck
200 ## Finally, if everything was successful, commit the last changes and tag
201 ## the release in the repository:
202         cd $(srcdir) \
203           && $(SHELL) ./commit \
204           && $(CVS) -q tag -c `echo "Release-$(VERSION)" | sed 's/\./-/g'`
205 ## We do want the timestamped version numbers from the CVS keywords in
206 ## ChangeLog to be correct, so we must rebuild the release tarball after
207 ## a successfull commit, and then generate the signatures needed for
208 ## FSF ftp-upload:
209         ofile="$(PACKAGE)-$(VERSION).tar.gz"; \
210         $(MAKE) dist \
211           && $(GPG) --detach-sign $$ofile \
212           && echo "directory: libtool" > $$ofile.directive \
213           && $(GPG) --clearsign $$ofile.directive \
214           && rm -f $$ofile.directive
216 .PHONY: cvs-diff
217 cvs-diff:
218 ## Figure out which cvs tags we are diffing, and if the diff works we
219 ## compress it and then generate the signatures needed for FSF ftp-upload:
220         thisver=`echo "release-$(VERSION)" | sed 's/\./-/g'`; \
221         $(CHECK_LASTRELEASE); \
222         prevver=release-`echo $(LASTRELEASE) | sed 's/\./-/g'`; \
223         ofile="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).diff.gz"; \
224         $(CVS) -f rdiff -c -r $$prevver -r $$thisver $(PACKAGE) \
225             | GZIP=$(GZIP_ENV) gzip -c > $$ofile \
226           && $(GPG) --detach-sign $$ofile \
227           && echo "directory: libtool" > $$ofile.directive \
228           && $(GPG) --clearsign $$ofile.directive \
229           && rm -f $$ofile.directive
231 XDELTA = xdelta
232 XDELTA_OPTIONS = --pristine -9
234 .PHONY: xdelta
235 xdelta: prev-tarball
236 ## Make sure xdelta exists;
237         @if ($(XDELTA) --version 2>&1 | grep version)>/dev/null 2>/dev/null; \
238         then :;\
239         else \
240           echo "Get xdelta from http://sourceforge.net/projects/xdelta."; \
241           exit 1; \
242         fi
243 ## Generate the delta file (xdelta has wierd exit statuses, so we need to
244 ## add some shell code to keep make happy), and then generate the signatures
245 ## for FSF ftp-upload:
246         $(CHECK_LASTRELEASE); \
247         ofile="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).xdelta"; \
248         ( test -z `$(XDELTA) delta $(XDELTA_OPTIONS) \
249             $(PACKAGE)-$(LASTRELEASE).tar.gz $(PACKAGE)-$(VERSION).tar.gz \
250             $$ofile 2>&1` \
251           && : ) \
252         && $(GPG) --detach-sign $$ofile \
253         && echo "directory: libtool" > $$ofile.directive \
254         && $(GPG) --clearsign $$ofile.directive \
255         && rm -f $$ofile.directive