syncevolution/src/Makefile-gen.am
Patrick Ohly d71a296525 dist: fixed distcheck, bundle Synthesis
When --with-synthesis-src is used, then the Synthesis source code is compiled
automatically and included in a .tar.gz.

Added some missing EXTRA_DIST files.
2009-03-25 14:43:44 +01:00

139 lines
5.5 KiB
Text

BACKENDS = @BACKENDS@
SUBDIRS = $(SYNTHESIS_SUBDIR) core $(BACKENDS)
DIST_SUBDIRS = core $(BACKENDS)
AM_CPPFLAGS = $(SUBDIRS:%=-I$(srcdir)/%) -I$(srcdir)/../test $(BACKEND_CPPFLAGS) $(GLIB_CFLAGS)
bin_PROGRAMS = syncevolution
bin_SCRIPTS = synccompare
SYNCEVOLUTION_DEP =
if ENABLE_MODULES
else
SYNCEVOLUTION_LDADD += $(SYNCSOURCES)
SYNCEVOLUTION_DEP += $(SYNCSOURCES)
endif
EXTRA_PROGRAMS = client-test
EXTRA_DIST = shlibs.local Makefile-gen.am syncevolution.xml
check_PROGRAMS = @CPPUNIT_TESTS@
TESTS = @CPPUNIT_TESTS@
DISTCLEANFILES = synccompare
MAINTAINERCLEANFILES = Makefile.in
CLEANFILES = libstdc++.a client-test $(CLIENT_LIB_TEST_FILES)
# synccompare is created by replacing its 'import Algorithm::Diff;'
# with a simplified copy of Diff.pm.
synccompare : ../test/Algorithm/Diff.pm ../test/synccompare.pl
perl -e '$$diff = shift; open(DIFF, "<$$diff"); ($$_) = split(/__END__/, join("", <DIFF>)); s/\*import.*//m; s/require +Exporter;//; s/^#.*\n//mg; s/ +#.*\n//mg; $$diff = $$_;' -e 'while(<>) {' @MODIFY_SYNCCOMPARE@ -e 's/use +Algorithm::Diff;/"# embedded version of Algorithm::Diff follows, copyright by the original authors\n" . $$diff . "# end of embedded Algorithm::Diff\n"/e; print;}' $+ >$@
chmod u+x $@
CORE_SOURCES =
# The files which register backends have to be compiled into
# "client-test" and "syncevolution" in order to pull in the
# code from the libs which implement the backends.
#
# Unit testing also goes there.
#
# When using modules the registration is done inside the
# module and the register file is unnecessary. However, they
# still need to be included in "make dist".
BACKEND_REGISTRIES = @BACKEND_REGISTRIES@
if ENABLE_MODULES
EXTRA_DIST += $(BACKEND_REGISTRIES)
else
CORE_SOURCES += $(BACKEND_REGISTRIES)
endif
CORE_CXXFLAGS = $(SYNTHESIS_CFLAGS)
CORE_LDADD = $(SYNCEVOLUTION_LDADD) core/libsyncevolution.la $(GLIB_LIBS) $(LIBS)
CORE_DEP = $(SYNCEVOLUTION_DEP) core/libsyncevolution.la $(SYNTHESIS_DEP)
CORE_LDFLAGS = -uSyncEvolution_Module_Version -Wl,--export-dynamic
# put link to static c++ library into current directory, needed if compiling with --enable-static-c++
libstdc++.a :
path=`$(CXX) $(CORE_LDADD) $(LD_FLAGS) -print-file-name=libstdc++.a` && ln -s $$path .
syncevolution_SOURCES = \
syncevolution.cpp \
$(CORE_SOURCES)
# SYNCEVOLUTION_LDADD will be replaced with libsyncebook.la/libsyncecal.la/libsyncsqlite.la
# if linking statically against them, empty otherwise;
# either way this does not lead to a dependency on those libs - done explicitly
syncevolution_LDADD = $(CORE_LDADD)
syncevolution_LDFLAGS = $(CORE_LDFLAGS)
syncevolution_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS)
syncevolution_DEPENDENCIES = $(EXTRA_LTLIBRARIES) $(CORE_DEP) # $(SYNTHESIS_DEP)
# rule which is only relevant when compiling Synthesis in subdirectory
#$(SYNTHESIS_LIB) : $(SYNTHESIS_SUBDIR)/all
#$(SYNTHESIS_SUBDIR)/% :
# [ ! "$(SYNTHESIS_SUBDIR)" ] || ( cd ${@D} && $(MAKE) ${@F} )
# include Synthesis in distribution
dist-hook:
[ ! "$(SYNTHESIS_SUBDIR)" ] || mkdir -p $(distdir)/synthesis && cp -a $(SYNTHESIS_SRC)/* $(distdir)/synthesis
find $(distdir) -name .libs -o -name "*~" -o -name ".*" -o -name "*.o" -o -name "*.lo" -o -name CVS -o -name .svn -o -name .git -o -name autom4te.cache | xargs rm -rf
clean-local: testclean
rm -rf testcases
# files created during testing
testclean:
rm -rf *.test.vcf *.log *.tests *.diff *.dat *Client_Sync_*client.*
distclean-local:
rm -rf $(SYNTHESIS_SUBDIR)
rm -rf $(CLEAN_CLIENT_SRC)
# With --disable-shared autotools links against libfunambol.a which does not
# pull any of the test suites into the test binary, so they would not be
# executed. The workaround is to explicitly set them as undefined on the
# link line.
client_test_SOURCES = \
client-test-app.cpp \
../test/ClientTest.cpp \
../test/ClientTest.h \
../test/client-test-main.cpp \
$(CORE_SOURCES)
CLIENT_LIB_TEST_FILES = \
testcases/vcard21.vcf \
testcases/vcard30.vcf \
testcases/ical20.ics \
testcases/imemo20.ics \
testcases/itodo20.ics
nodist_client_test_SOURCES = $(CLIENT_LIB_TEST_FILES)
client_test_CPPFLAGS = -DHAVE_CONFIG_H -DENABLE_INTEGRATION_TESTS -DENABLE_UNIT_TESTS $(AM_CPPFLAGS)
client_test_CXXFLAGS = `cppunit-config --cflags` $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS)
client_test_LDFLAGS = `cppunit-config --libs` `nm core/.libs/libsyncevolution.a | grep funambolAutoRegisterRegistry | sed -e 's/.* /-u /'` $(CORE_LDFLAGS)
client_test_LDADD = $(CORE_LDADD)
client_test_DEPENDENCIES = # $(SYNTHESIS_DEP)
# These dependencies are intentionally a bit too broad:
# they ensure that all files are in place to *run* client-test,
# but in particular the "all" dependency causes a rebuild
# even if the actual input files haven't changed.
client_test_DEPENDENCIES = all $(EXTRA_LTLIBRARIES) $(CORE_DEP) $(CLIENT_LIB_TEST_FILES) synccompare
# copy test files because client-test expects them here
LOCAL_TEST_FILES=$(subst $(srcdir)/../test/,,$(wildcard $(srcdir)/../test/* $(srcdir)/../test/testcases/*))
$(filter testcases/%, $(filter $(LOCAL_TEST_FILES), $(CLIENT_LIB_TEST_FILES))) : % : $(srcdir)/../test/%
mkdir -p testcases
cp $< $@
# special target for testing with valgrind
valgrind : test
valgrind --leak-check=yes --suppressions=valgrind.supp ./test
# Because backend-related variables need to be substituted in
# Makefile-gen.am we need an explicit rule to redo that work
# so that "make" rebuilds derived files correctly.
$(srcdir)/Makefile.am: Makefile-gen.am
sed -e 's;[@]BACKEND_REGISTRIES[@];$(BACKEND_REGISTRIES);' \
-e 's;[@]BACKENDS[@];$(BACKENDS);' \
$< >$@
# old-style name for test program(s)
.PHONY: test
test: client-test