syncevolution/Makefile-gen.am

189 lines
7.4 KiB
Plaintext
Raw Normal View History

## Process this file with automake to produce Makefile.in
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src po test
2009-05-07 16:15:42 +02:00
EXTRA_DIST = \
HACKING \
LICENSE.txt \
LICENSE.LGPL-21 \
description \
configure-pre.in \
configure-post.in \
autogen.sh \
Makefile-gen.am \
Doxyfile
MAINTAINERCLEANFILES = Makefile.in config.h.in config.guess config.sub configure depcomp install-sh ltmain.sh missing mkinstalldirs
CLEANFILES =
TEST_README_FILES = $(wildcard $(srcdir)/test/README.*)
# binary distribution as .tar.gz
if COND_DBUS
# when building with D-Bus, we have no choice: the service has to go into /usr
# in order to be found
distbin : README NEWS COPYING $(TEST_README_FILES) INSTALL-tar-gz all
@ [ "$(BINSUFFIX)" ] || (echo "please invoke with e.g. 'make distbin BINSUFFIX=debian-3.1'"; exit 1 )
@ [ "$(prefix)" == "/usr" ] || (echo "please reconfigure with --prefix=/usr"; exit 1 )
rm -rf $(distdir)
$(MAKE) DESTDIR=`pwd`/$(distdir) install
rm -rf $(distdir)/usr/etc
mkdir -p $(distdir)/usr/share/doc/syncevolution
cp $(srcdir)/INSTALL-tar-gz $(distdir)/INSTALL
cp $(srcdir)/README $(srcdir)/NEWS $(srcdir)/COPYING $(TEST_README_FILES) $(distdir)/usr/share/doc/syncevolution
tar zcf $(distdir)-$(BINSUFFIX).tar.gz $(distdir)
rm -rf $(distdir)
else
# without D-Bus, we can simply create an archive with a bin directory
# and everything works
distbin : README NEWS COPYING all
@ [ "$(BINSUFFIX)" ] || (echo "please invoke with e.g. 'make distbin BINSUFFIX=debian-3.1'"; exit 1 )
rm -rf $(distdir)
$(MAKE) prefix=`pwd`/$(distdir) install
cp $(srcdir)/README $(srcdir)/NEWS $(srcdir)/COPYING $(TEST_README_FILES) $(distdir)
tar zcf $(distdir)-$(BINSUFFIX).tar.gz $(distdir)
rm -rf $(distdir)
endif
iphone : SyncEvolution.plist
IPHONE_FILENAME = syncevolution-$(VERSION)-iphone.zip
SyncEvolution.plist : SyncEvolution.plist.in $(IPHONE_FILENAME)
sed -e 's/__FILENAME__/$(IPHONE_FILENAME)/' \
-e 's/__VERSION__/$(VERSION)/' \
-e 's/__SIZE__/$(shell ls -l $(IPHONE_FILENAME) | sed -e 's/ */ /g' | cut -d ' ' -f 5)/' \
$< >$@
$(IPHONE_FILENAME) : all
rm -rf syncevolution-iphone $@
$(MAKE) DESTDIR=`pwd`/syncevolution-iphone install
rm -rf `ls -1 -d syncevolution-iphone/usr/share/doc/syncevolution/*/spds/sources/* | grep -v addressbook`
perl -pi -e 's;SyncEvolution test #1;;;' \
-e 's;^type = text/(x-)?vcard;type = addressbook;m;' \
syncevolution-iphone/usr/share/doc/syncevolution/*/spds/sources/addressbook/config.txt
cd syncevolution-iphone && zip -r ../$(IPHONE_FILENAME) .
TYPE_deb = -D
TYPE_rpm = -R
# Dependency calculation is intentionally incomplete:
# - don't force dependency on specific EDS libs via backends, their versions change too much (handled via --enable-evolution-compatibility and dynamic loading of the backends)
# - ignore client-test dependencies (because users typically don't run it)
REQUIRES_deb = --requires="'$(shell set -x; cd dist; LD_LIBRARY_PATH=$(distdir)/usr/lib:$(distdir)/usr/lib/syncevolution dpkg-shlibdeps -L$(srcdir)/src/shlibs.local --ignore-missing-info -O $$(for i in $$(find $(distdir) -type f -perm /u+x | grep -v -e client-test -e lib/syncevolution/sync); do if file $$i | grep ELF >/dev/null; then echo $$i; fi; done) | sed -e 's/[^=]*=//')'"
VERSION_deb = `echo 1:$(VERSION) | perl -p -e 's/(\d+\.\d+)([-a-z0-9]+)/sprintf("%0.1f+$$1$$2", ($$1 - 0.1))/e'`
VERSION_rpm = `echo $(VERSION) | sed -e s/-/_/g`
RELEASE = 2
# The package name: BINSUFFIX is used to distinguish binaries
# for different Evolution releases.
PKGNAME=syncevolution$(patsubst %,-%,$(BINSUFFIX))
# This is a list of packages (potentially) provided on estamos.de.
# The current package conflicts with any of them, but not itself.
PKGS = $(addprefix syncevolution-evolution-, 2.6 2.8 2.12)
# When calling checkinstall we cannot install into /tmp
# because any file created there will be excluded: that makes
# sense, because "make install" might create temporary files
# there. The current directory might be in /tmp, so use $HOME.
#
# --replaces is necessary for migrating from syncevolution-evolution-<evover>
# to syncevolution-evolution (as per http://wiki.debian.org/Renaming_a_Package)
deb rpm : dist/$(distdir) dist/debian/control doc-pak description-pak
tmpdir=`mktemp -d $$HOME/syncevolution.XXXXXXXXXX` && \
trap "rm -rf $$tmpdir" EXIT && \
docdir="$(docdir)" && \
if [ ! "$$docdir" ]; then docdir="$(datadir)/doc/$(PACKAGE)"; fi && \
fakeroot checkinstall </dev/null \
$(TYPE_$@) \
$(REQUIRES_$@) \
--fstrans=yes \
--strip=no \
--pkgversion=$(VERSION_$@) \
--pkgrelease=$(RELEASE) \
--pkgname=$(PKGNAME) \
--pkgarch=$(PKGARCH) \
--provides=syncevolution \
--replaces="'syncevolution, `echo $(filter-out $(PKGNAME), $(PKGS)) | sed -e 's/ */ (<< 1:0.8.1-2), /g'` (<< 1:0.8.1-2)'" \
--conflicts="'syncevolution, `echo $(filter-out $(PKGNAME), $(PKGS)) | sed -e 's/ */ (<< 1:0.8.1-2), /g'` (<< 1:0.8.1-2)'" \
--maintainer="'Patrick Ohly <patrick.ohly@gmx.de>'" \
--pkgsource='http://sourceforge.net/project/showfiles.php?group_id=146288' \
--pkgaltsource='http://www.estamos.de/projects/SyncML/' \
--pkggroup='gnome' \
--docdir=":$$docdir" cp -r `pwd`/$</usr/* /usr
.PHONY: dist/$(distdir) clean_dist
dist/$(distdir): all
rm -rf $@
$(MAKE) install DESTDIR=`pwd`/$@
rm -rf $@/usr/etc $@/usr/include
find $@ -name *.la -o -name *.so -delete
clean-local: clean_dist
clean_dist:
rm -rf dist doc-pak description-pak
# required by dpkg-shlibdeps
dist/debian/control:
mkdir -p ${@D}
touch $@
doc-pak : README NEWS COPYING $(TEST_README_FILES)
rm -rf $@
mkdir $@
cp $+ $@
description-pak : description
cp $< $@
# Build "html" inside the build dir, using source files
# from the SyncEvolution source directory and (if built)
# the installed client-api.build directory.
.PHONY: doc clean-html
doc:
rm -rf html
export VERSION="SyncEvolution $(VERSION)"; \
export OUTPUT_DIRECTORY="`pwd`"; \
export PREDEFINED="@BACKEND_DEFINES@ ENABLE_UNIT_TESTS ENABLE_INTEGRATION_TESTS"; \
export CLIENT_LIBRARY="@FUNAMBOL_SUBDIR@/test @FUNAMBOL_SUBDIR@/include "; \
export STRIP_FROM_PATH="$(srcdir) `dirname @FUNAMBOL_SUBDIR@`"; \
cd $(srcdir); doxygen
clean-local: clean-html
clean-html:
rm -rf html
# Because backend-related variables need to be substituted in
# Makefile-gen.am and configure.in we need an explicit rule to redo that work
# so that "make" rebuilds derived files correctly.
CONFIG_SUBS = @CONFIG_SUBS@
$(srcdir)/configure.in: configure-pre.in configure-post.in $(CONFIG_SUBS)
rm -f $@
cat $(srcdir)/configure-pre.in >>$@
for sub in $(srcdir)/src/backends/*/configure-sub.in; do \
echo "# vvvvvvvvvvvvvv $$sub vvvvvvvvvvvvvv" >>$@; \
cat $$sub >>$@; \
echo "AC_CONFIG_FILES(`echo $$sub | sed -e 's;^$(srcdir)/;;' -e s/configure-sub.in/Makefile/`)" >>$@; \
echo "# ^^^^^^^^^^^^^^ $$sub ^^^^^^^^^^^^^^" >>$@; \
echo >>$@; \
done
cat $(srcdir)/configure-post.in >>$@
$(srcdir)/Makefile.am: Makefile-gen.am
sed -e 's;[@]CONFIG_SUBS[@];$(CONFIG_SUBS);' \
$< >$@
dist-hook:
@if test -d "$(srcdir)/.git"; \
then \
echo Creating ChangeLog && \
( cd "$(top_srcdir)" && \
echo '# Generated by configure. Do no edit.'; echo; \
$(top_srcdir)/missing --run perl $(top_srcdir)/build/gen-changelog.pl ) > ChangeLog.tmp \
&& mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
|| ( rm -f ChangeLog.tmp ; \
echo Failed to generate ChangeLog >&2 ); \
else \
echo A git checkout is required to generate a ChangeLog >&2; \
fi