unset XDG environment variable during testcases, as they can screw things up badly
[oweals/gnunet.git] / src / peerstore / Makefile.am
1 # This Makefile.am is in the public domain
2 AM_CPPFLAGS = -I$(top_srcdir)/src/include
3
4 plugindir = $(libdir)/gnunet
5
6 pkgcfgdir= $(pkgdatadir)/config.d/
7
8 libexecdir= $(pkglibdir)/libexec/
9
10 dist_pkgcfg_DATA = \
11   peerstore.conf
12
13 if MINGW
14  WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
15 endif
16
17 if USE_COVERAGE
18   AM_CFLAGS = -fprofile-arcs -ftest-coverage
19 endif
20
21 bin_PROGRAMS = \
22  gnunet-peerstore
23
24 libexec_PROGRAMS = \
25  gnunet-service-peerstore
26
27 lib_LTLIBRARIES = \
28  libgnunetpeerstore.la
29
30 gnunet_peerstore_SOURCES = \
31  gnunet-peerstore.c
32 gnunet_peerstore_LDADD = \
33   $(top_builddir)/src/util/libgnunetutil.la \
34   libgnunetpeerstore.la \
35   $(GN_LIBINTL)
36
37 gnunet_service_peerstore_SOURCES = \
38  gnunet-service-peerstore.c \
39  peerstore_common.c peerstore_common.h \
40  peerstore.h
41 gnunet_service_peerstore_CFLAGS = $(AM_CFLAGS)
42 gnunet_service_peerstore_LDADD = \
43   $(top_builddir)/src/util/libgnunetutil.la \
44   $(GN_LIBINTL)
45
46 libgnunetpeerstore_la_SOURCES = \
47   peerstore_api.c \
48   peerstore_common.c
49 libgnunetpeerstore_la_LIBADD = \
50   $(top_builddir)/src/util/libgnunetutil.la
51 libgnunetpeerstore_la_LDFLAGS = \
52   $(GN_LIB_LDFLAGS)
53
54 if HAVE_EXPERIMENTAL
55 FLAT_PLUGIN = libgnunet_plugin_peerstore_flat.la
56 FLAT_TESTS = test_plugin_peerstore_flat
57 libgnunet_plugin_peerstore_flat_la_SOURCES = \
58   plugin_peerstore_flat.c
59 libgnunet_plugin_peerstore_flat_la_LIBADD = \
60   libgnunetpeerstore.la  \
61   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
62   $(LTLIBINTL)
63 libgnunet_plugin_peerstore_flat_la_LDFLAGS = \
64  $(GN_PLUGIN_LDFLAGS)
65 endif
66
67 if HAVE_SQLITE
68 SQLITE_PLUGIN = libgnunet_plugin_peerstore_sqlite.la
69 if HAVE_TESTING
70 SQLITE_TESTS = test_plugin_peerstore_sqlite
71 endif
72 libgnunet_plugin_peerstore_sqlite_la_SOURCES = \
73   plugin_peerstore_sqlite.c
74 libgnunet_plugin_peerstore_sqlite_la_LIBADD = \
75   libgnunetpeerstore.la  \
76   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
77   $(LTLIBINTL)
78 libgnunet_plugin_peerstore_sqlite_la_LDFLAGS = \
79  $(GN_PLUGIN_LDFLAGS)
80 endif
81
82 plugin_LTLIBRARIES = \
83   $(SQLITE_PLUGIN) \
84         $(FLAT_PLUGIN)
85
86 test_plugin_peerstore_sqlite_SOURCES = \
87   test_plugin_peerstore.c
88 test_plugin_peerstore_sqlite_LDADD = \
89         $(top_builddir)/src/testing/libgnunettesting.la \
90         $(top_builddir)/src/util/libgnunetutil.la
91
92 test_plugin_peerstore_flat_SOURCES = \
93   test_plugin_peerstore.c
94 test_plugin_peerstore_flat_LDADD = \
95         $(top_builddir)/src/testing/libgnunettesting.la \
96         $(top_builddir)/src/util/libgnunetutil.la
97
98 check_PROGRAMS = \
99  test_peerstore_api_store \
100  test_peerstore_api_iterate \
101  test_peerstore_api_watch \
102  test_peerstore_api_sync \
103  perf_peerstore_store \
104  $(SQLITE_TESTS) \
105  $(FLAT_TESTS)
106
107 EXTRA_DIST = \
108  test_peerstore_api_data.conf
109
110 if ENABLE_TEST_RUN
111 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
112 TESTS = $(check_PROGRAMS)
113 endif
114
115 test_peerstore_api_store_SOURCES = \
116  test_peerstore_api_store.c
117 test_peerstore_api_store_LDADD = \
118   libgnunetpeerstore.la  \
119   $(top_builddir)/src/testing/libgnunettesting.la \
120   $(top_builddir)/src/util/libgnunetutil.la
121
122 test_peerstore_api_iterate_SOURCES = \
123  test_peerstore_api_iterate.c
124 test_peerstore_api_iterate_LDADD = \
125   libgnunetpeerstore.la  \
126   $(top_builddir)/src/testing/libgnunettesting.la \
127   $(top_builddir)/src/util/libgnunetutil.la
128
129 test_peerstore_api_watch_SOURCES = \
130  test_peerstore_api_watch.c
131 test_peerstore_api_watch_LDADD = \
132   libgnunetpeerstore.la  \
133   $(top_builddir)/src/testing/libgnunettesting.la \
134   $(top_builddir)/src/util/libgnunetutil.la
135
136 test_peerstore_api_sync_SOURCES = \
137  test_peerstore_api_sync.c
138 test_peerstore_api_sync_LDADD = \
139   libgnunetpeerstore.la  \
140   $(top_builddir)/src/testing/libgnunettesting.la \
141   $(top_builddir)/src/util/libgnunetutil.la
142
143 perf_peerstore_store_SOURCES = \
144  perf_peerstore_store.c
145 perf_peerstore_store_LDADD = \
146   libgnunetpeerstore.la  \
147   $(top_builddir)/src/testing/libgnunettesting.la \
148   $(top_builddir)/src/util/libgnunetutil.la