1## Process this file with automake to produce Makefile.in
2
3AUTOMAKE_OPTIONS = 1.3e gnu
4
5BUILD_SUBDIRS = . libltdl doc tests
6CONF_SUBDIRS = @CONF_SUBDIRS@
7SUBDIRS = $(BUILD_SUBDIRS)
8DIST_SUBDIRS = $(BUILD_SUBDIRS) $(CONF_SUBDIRS)
9
10# We need to export these variables
11CFLAGS = @CFLAGS@
12CPPLAGS = @CPPFLAGS@
13LDFLAGS = @LDFLAGS@
14LIBS= @LIBS@
15FFLAGS = @FFLAGS@
16FLIBS = @FLIBS@
17
18aclocal_macros = libtool.m4 ltdl.m4
19
20EXTRA_DIST = $(aclocal_macros) bootstrap libtoolize.in ltmain.in \
21	mkstamp ChangeLog.0 ChangeLog.1
22CLEANFILES = libtool libtoolize ltmain.shT
23
24# These are required by libtoolize and must be executable when installed.
25# Since _SCRIPTS gets the program transform applied we make them
26# executable by hand
27pkgdata_DATA = config.guess config.sub install-sh ltmain.sh
28
29# This macro file should be visible to Automake's aclocal.
30aclocal_DATA = $(aclocal_macros)
31
32# The standalone libtool script, and the libtool distributor.
33bin_SCRIPTS = libtool libtoolize
34
35## These are installed as a subdirectory of pkgdatadir so that
36## libtoolize --ltdl can find them later:
37## Preserve order here so that generated files remain newer than
38## their dependencies.
39ltdldatadir = $(pkgdatadir)/libltdl
40ltdldata_DATA = \
41	libltdl/COPYING.LIB \
42	libltdl/README \
43	libltdl/configure.ac \
44	libltdl/Makefile.am \
45	libltdl/ltdl.c \
46	libltdl/ltdl.h \
47	libltdl/config.guess \
48	libltdl/config.sub \
49	libltdl/install-sh \
50	libltdl/missing \
51	libltdl/ltmain.sh \
52	libltdl/acinclude.m4 \
53	libltdl/aclocal.m4 \
54	libltdl/Makefile.in \
55	libltdl/configure \
56	libltdl/config-h.in
57
58libtool: $(srcdir)/ltmain.sh $(top_builddir)/configure.ac
59	$(SHELL) $(top_builddir)/config.status --recheck
60	chmod +x $@
61
62libtoolize: $(srcdir)/libtoolize.in $(top_builddir)/config.status
63	CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) $(top_builddir)/config.status
64	chmod +x $@
65
66$(srcdir)/ltmain.sh: $(srcdir)/ltmain.in $(TSDEPS)
67	-rm -f ltmain.shT
68	date=`$(SHELL) $(srcdir)/mkstamp < $(srcdir)/ChangeLog` && \
69	sed -e 's/@''PACKAGE@/@PACKAGE@/' -e 's/@''VERSION@/@VERSION@/' \
70	    -e "s%@""TIMESTAMP@%$$date%" $(srcdir)/ltmain.in > ltmain.shT
71	mv -f ltmain.shT $@ || \
72	(rm -f $@ && cp ltmain.shT $@ && rm -f ltmain.shT)
73	cp $@ $(srcdir)/libltdl/
74
75# All our rules should depend on these demo files.
76all-recursive: $(srcdir)/libltdl/acinclude.m4 $(ACINCLUDE_M4_LIST)
77
78@srcdir@/libltdl/acinclude.m4: $(srcdir)/libtool.m4 $(srcdir)/ltdl.m4
79	-rm -f $@ $@T
80	cat $(srcdir)/libtool.m4 $(srcdir)/ltdl.m4 > $@T
81	mv $@T $@
82
83@ACINCLUDE_M4_LIST@: $(srcdir)/libtool.m4
84	-rm -f $@ $@T
85	cat $(srcdir)/libtool.m4 > $@T
86	mv $@T $@
87
88.PHONY: configure-subdirs
89configure-subdirs distdir: $(DIST_MAKEFILE_LIST)
90@DIST_MAKEFILE_LIST@:
91	dir=`echo $@ | sed 's,^[^/]*$$,.,;s,/[^/]*$$,,'`; \
92	test -d $$dir || mkdir $$dir || exit 1; \
93	abs_srcdir=`cd $(top_srcdir) && pwd`; \
94	(cd $$dir && $$abs_srcdir/$$dir/configure) || exit 1
95
96# Create and install libltdl
97install-data-hook:
98	chmod +x $(DESTDIR)$(pkgdatadir)/config.guess
99	chmod +x $(DESTDIR)$(pkgdatadir)/config.sub
100	chmod +x $(DESTDIR)$(pkgdatadir)/install-sh
101	chmod +x $(DESTDIR)$(pkgdatadir)/libltdl/config.guess
102	chmod +x $(DESTDIR)$(pkgdatadir)/libltdl/config.sub
103	chmod +x $(DESTDIR)$(pkgdatadir)/libltdl/install-sh
104	chmod +x $(DESTDIR)$(pkgdatadir)/libltdl/configure
105	chmod +x $(DESTDIR)$(pkgdatadir)/libltdl/missing
106
107# Uninstall libltdl
108uninstall-local:
109	-rm -rf $(DESTDIR)$(pkgdatadir)/libltdl
110
111
112## ---------------------------------------------------------------- ##
113##  Everything past here is useful to the maintainer, but probably  ##
114##  not to anybody else (inspiration from automake/Makefile.am).    ##
115## ---------------------------------------------------------------- ##
116
117MAKEINFO = makeinfo
118
119.PHONY: cvs-release
120cvs-release: version-check prev-tarball cvs-news fetch cvs-commit cvs-dist deltas web-manual
121	@tarname="$(PACKAGE)-$(VERSION).tar.gz"; \
122	diffname="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).diff.gz"; \
123	xdeltaname="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).xdelta"; \
124	echo " *** Upload $$tarname, $$tarname.sig,";\
125	echo " *** $$tarname.directive.asc, $$diffname,"; \
126	echo " *** $$diffname.sig, $$diffname.directive.asc,"; \
127	echo " *** $$xdeltaname, $$xdeltaname.sig and";\
128	echo " *** $$xdeltaname.directive.asc to either"
129	echo " *** /incoming/alpha or /incoming/ftp on ftp-upload.gnu.org."
130	echo " *** You might need to upload manual.html to webcvs/libtool."
131
132.PHONY: version-check
133version-check:
134	@case $(VERSION) in \
135	*[acegikmoqsuwy]) \
136	  echo "Version \`$(VERSION)' is not a releasable version, please read:"; \
137	  echo "    http://www.gnu.org/software/libtool/contribute.html"; \
138	  exit 1; \
139	  ;; \
140	esac
141
142.PHONY: prev-tarball
143prev-tarball:
144## Make sure we have the previous release tarball in the tree.
145	@if test -z "$(LASTRELEASE)"; \
146		then echo "LASTRELEASE is not set"; exit 1; fi
147	@ofile="$(PACKAGE)-$(LASTRELEASE).tar.gz"; \
148	if test -f $$ofile; then :; \
149	else echo "Cannot make deltas without $$ofile"; exit 1; fi
150
151# TSDEPS will be defined to TSDEPS_DIST at `make dist' time
152TSDEPS =
153TSDEPS_DIST = ChangeLog libtool.m4
154CVS = cvs # set it to `:' to avoid CVS operations
155
156.PHONY: timestamps update-timestamps
157timestamps: update-timestamps
158update-timestamps:
159	@if (cd $(srcdir) && test -d CVS && \
160	    $(CVS) -n update $(TSDEPS_DIST) | grep '^M'); then \
161		echo "Cannot make cvs-dist before commit"; exit 1; else :; fi
162
163
164.PHONY: cvs-news
165cvs-news:
166## Make sure the NEWS file is up-to-date:
167	@if sed '1,2d;3q' $(srcdir)/NEWS | grep -e "$(VERSION)" >/dev/null; \
168	then :; \
169	else \
170	  echo "NEWS not updated; not releasing" 1>&2; \
171	  exit 1; \
172	fi
173
174## Program to use to fetch files.
175WGET = wget
176WGETSGO = $(WGET) http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
177
178## Files that we fetch and which we compare against.
179## FIXME should be a lot more here
180FETCHFILES = \
181./INSTALL \
182./config.guess \
183libltdl/config.guess \
184./config.sub \
185libltdl/config.sub \
186./install-sh \
187libltdl/install-sh \
188doc/texinfo.tex
189
190## Fetch the latest versions of files we care about.
191.PHONY: fetch
192fetch:
193	rm -rf Fetchdir > /dev/null 2>&1
194	mkdir Fetchdir
195## If a get fails then that is a problem.
196	(cd Fetchdir && \
197	$(WGETSGO)/autoconf/autoconf/INSTALL; \
198	$(WGETSGO)/automake/automake/lib/install-sh; \
199	$(WGETSGO)/config/config/config.guess; \
200	$(WGETSGO)/config/config/config.sub; \
201	$(WGETSGO)/texinfo/texinfo/doc/texinfo.tex )
202## Don't exit after test because we want to give as many errors as
203## possible.
204	@stat=0; for file in $(FETCHFILES); do \
205	  fetchedfile=Fetchdir/`echo $$file | sed 's,.*/,,g'`; \
206	  if diff -u $(srcdir)/$$file $$fetchedfile \
207	    >>Fetchdir/update.patch 2>/dev/null; then :; \
208	  else \
209	    stat=1; \
210	    echo "Updating $(srcdir)/$$file..."; \
211	    cp $$fetchedfile $(srcdir)/$$file; \
212	  fi; \
213	done; \
214	test $$stat = 1 && \
215	  echo "See Fetchdir/update.patch for a log of the changes."; \
216	exit $$stat
217
218
219GPG = gpg # set it to `:' to avoid gpg operations
220
221.PHONY: cvs-commit
222cvs-commit: cvs-news
223	cd $(srcdir) && $(SHELL) ./commit
224
225.PHONY: cvs-dist
226cvs-dist: cvs-news timestamps
227## Build the distribution:
228	$(MAKE) distcheck
229## Finally, if everything was successful, tag the release
230	cd $(srcdir) \
231	  && $(CVS) -q tag -c `echo "release-$(VERSION)" | sed 's/\./-/g'`
232## Generate signatures and directives for FSF ftp-upload:
233	ofile="$(PACKAGE)-$(VERSION).tar.gz"; \
234	$(GPG) --detach-sign $$ofile \
235	&& echo "directory: libtool" > $$ofile.directive \
236	&& $(GPG) --clearsign $$ofile.directive \
237	&& rm -f $$ofile.directive
238
239.PHONY: new-tarball
240new-tarball:
241## Make sure we have the new release tarball in the tree.
242	@ofile="$(PACKAGE)-$(VERSION).tar.gz"; \
243	if test -f $$ofile; then :; \
244	else echo "Cannot make deltas without $$ofile"; exit 1; fi
245
246.PHONY: got-xdelta
247got-xdelta:
248## Make sure xdelta exists;
249	@if ($(XDELTA) --version 2>&1 | grep version)>/dev/null 2>/dev/null; \
250	then :;\
251	else \
252	  echo "Get xdelta from http://sourceforge.net/projects/xdelta."; \
253	  exit 1; \
254	fi
255
256.PHONY: deltas
257deltas: delta-diff delta-xdelta
258
259DIFF = diff
260DIFF_OPTIONS = -ruNp
261
262.PHONY: delta-diff
263delta-diff: prev-tarball new-tarball
264## Unpack the tarballs somewhere to diff them
265	rm -rf delta-diff
266	mkdir delta-diff
267	ofile="../$(PACKAGE)-$(LASTRELEASE)-$(VERSION).diff.gz"; \
268	cd delta-diff \
269	&& tar xzf "../$(PACKAGE)-$(LASTRELEASE).tar.gz" \
270	&& tar xzf "../$(PACKAGE)-$(VERSION).tar.gz" \
271	&& $(DIFF) $(DIFF_OPTIONS) \
272		$(PACKAGE)-$(LASTRELEASE) $(PACKAGE)-$(VERSION) \
273		| GZIP=$(GZIP_ENV) gzip -c > $$ofile \
274	&& $(GPG) --detach-sign $$ofile \
275	&& echo "directory: libtool" > $$ofile.directive \
276	&& $(GPG) --clearsign $$ofile.directive \
277	&& rm -f $$ofile.directive
278	rm -rf delta-diff
279
280XDELTA = xdelta
281XDELTA_OPTIONS = -9
282
283.PHONY: delta-xdelta
284delta-xdelta: prev-tarball new-tarball got-xdelta
285## Generate the delta file (xdelta has wierd exit statuses, so we need to
286## add some shell code to keep make happy), and then generate the signatures
287## for FSF ftp-upload:
288	ofile="$(PACKAGE)-$(LASTRELEASE)-$(VERSION).xdelta"; \
289	( test -z `$(XDELTA) delta $(XDELTA_OPTIONS) \
290	    $(PACKAGE)-$(LASTRELEASE).tar.gz $(PACKAGE)-$(VERSION).tar.gz \
291	    $$ofile 2>&1` \
292	  && : ) \
293	&& $(GPG) --detach-sign $$ofile \
294	&& echo "directory: libtool" > $$ofile.directive \
295	&& $(GPG) --clearsign $$ofile.directive \
296	&& rm -f $$ofile.directive
297
298.PHONY: web-manual
299web-manual:
300	$(MAKEINFO) -I $(top_srcdir)/doc --html --no-split -o manual.html \
301	$(top_srcdir)/doc/libtool.texi
302
303