Merge branch 'master' of ssh://gnunet.org/gnunet
[oweals/gnunet.git] / src / psycstore / 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 pkgcfg_DATA = \
11   psycstore.conf
12
13
14 if MINGW
15  WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
16 endif
17
18 if USE_COVERAGE
19   AM_CFLAGS = --coverage -O0
20   XLIB = -lgcov
21 endif
22
23 if HAVE_MYSQL
24 MYSQL_PLUGIN = libgnunet_plugin_psycstore_mysql.la
25 if HAVE_TESTING
26 MYSQL_TESTS = test_plugin_psycstore_mysql
27 endif
28 endif
29
30 if HAVE_POSTGRESQL
31 POSTGRES_PLUGIN = libgnunet_plugin_psycstore_postgres.la
32 if HAVE_TESTING
33 POSTGRES_TESTS = test_plugin_psycstore_postgres
34 endif
35 endif
36
37 if HAVE_SQLITE
38 SQLITE_PLUGIN = libgnunet_plugin_psycstore_sqlite.la
39 if HAVE_TESTING
40 SQLITE_TESTS = test_plugin_psycstore_sqlite
41 endif
42 endif
43
44 lib_LTLIBRARIES = libgnunetpsycstore.la
45
46 libgnunetpsycstore_la_SOURCES = \
47   psycstore_api.c \
48   psycstore.h
49 libgnunetpsycstore_la_LIBADD = \
50   $(top_builddir)/src/util/libgnunetutil.la \
51   $(GN_LIBINTL) $(XLIB)
52 libgnunetpsycstore_la_LDFLAGS = \
53   $(GN_LIB_LDFLAGS)  $(WINFLAGS) \
54   -version-info 0:0:0
55
56 bin_PROGRAMS =
57
58 libexec_PROGRAMS = \
59  gnunet-service-psycstore
60
61 gnunet_service_psycstore_SOURCES = \
62  gnunet-service-psycstore.c
63 gnunet_service_psycstore_LDADD = \
64   $(top_builddir)/src/statistics/libgnunetstatistics.la \
65   $(top_builddir)/src/util/libgnunetutil.la \
66   $(top_builddir)/src/psycutil/libgnunetpsycutil.la \
67   $(GN_LIBINTL)
68
69 plugin_LTLIBRARIES = \
70   $(SQLITE_PLUGIN) \
71   $(MYSQL_PLUGIN) \
72   $(POSTGRES_PLUGIN)
73
74
75 libgnunet_plugin_psycstore_mysql_la_SOURCES = \
76   plugin_psycstore_mysql.c
77 libgnunet_plugin_psycstore_mysql_la_LIBADD = \
78   libgnunetpsycstore.la  \
79   $(top_builddir)/src/my/libgnunetmy.la \
80   $(top_builddir)/src/mysql/libgnunetmysql.la \
81   $(top_builddir)/src/statistics/libgnunetstatistics.la \
82   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
83   $(LTLIBINTL)
84 libgnunet_plugin_psycstore_mysql_la_LDFLAGS = \
85  $(GN_PLUGIN_LDFLAGS)
86
87 libgnunet_plugin_psycstore_postgres_la_SOURCES = \
88   plugin_psycstore_postgres.c
89 libgnunet_plugin_psycstore_postgres_la_LIBADD = \
90   libgnunetpsycstore.la  \
91   $(top_builddir)/src/postgres/libgnunetpostgres.la  \
92   $(top_builddir)/src/pq/libgnunetpq.la  \
93   $(top_builddir)/src/statistics/libgnunetstatistics.la \
94   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq \
95   $(LTLIBINTL)
96 libgnunet_plugin_psycstore_postgres_la_LDFLAGS = \
97   $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
98 libgnunet_plugin_psycstore_postgres_la_CPPFLAGS = \
99   $(POSTGRESQL_CPPFLAGS) $(AM_CPPFLAGS)
100
101
102 libgnunet_plugin_psycstore_sqlite_la_SOURCES = \
103   plugin_psycstore_sqlite.c
104 libgnunet_plugin_psycstore_sqlite_la_LIBADD = \
105   libgnunetpsycstore.la  \
106   $(top_builddir)/src/statistics/libgnunetstatistics.la \
107   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
108   $(LTLIBINTL)
109 libgnunet_plugin_psycstore_sqlite_la_LDFLAGS = \
110  $(GN_PLUGIN_LDFLAGS)
111
112
113 if HAVE_SQLITE
114 if HAVE_TESTING
115 check_PROGRAMS = \
116  $(SQLITE_TESTS) \
117  $(MYSQL_TESTS) \
118  $(POSTGRES_TESTS) \
119  test_psycstore
120 endif
121 endif
122
123 if ENABLE_TEST_RUN
124 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
125 TESTS = $(check_PROGRAMS)
126 endif
127
128 test_psycstore_SOURCES = \
129  test_psycstore.c
130 test_psycstore_LDADD = \
131   libgnunetpsycstore.la \
132   $(top_builddir)/src/testing/libgnunettesting.la \
133   $(top_builddir)/src/util/libgnunetutil.la
134
135 EXTRA_DIST = \
136   test_psycstore.conf
137
138
139 test_plugin_psycstore_sqlite_SOURCES = \
140  test_plugin_psycstore.c
141 test_plugin_psycstore_sqlite_LDADD = \
142   $(top_builddir)/src/testing/libgnunettesting.la \
143   $(top_builddir)/src/util/libgnunetutil.la
144
145 test_plugin_psycstore_mysql_SOURCES = \
146  test_plugin_psycstore.c
147 test_plugin_psycstore_mysql_LDADD = \
148   $(top_builddir)/src/testing/libgnunettesting.la \
149   $(top_builddir)/src/util/libgnunetutil.la
150
151 test_plugin_psycstore_postgres_SOURCES = \
152  test_plugin_psycstore.c
153 test_plugin_psycstore_postgres_LDADD = \
154  $(top_builddir)/src/testing/libgnunettesting.la \
155  $(top_builddir)/src/util/libgnunetutil.la
156