trying to do something about #3540
[oweals/gnunet.git] / src / namecache / Makefile.am
1 AM_CPPFLAGS = -I$(top_srcdir)/src/include $(POSTGRESQL_CPPFLAGS)
2
3 plugindir = $(libdir)/gnunet
4
5 pkgcfgdir= $(pkgdatadir)/config.d/
6
7 libexecdir= $(pkglibdir)/libexec/
8
9 pkgcfg_DATA = \
10    namecache.conf
11
12
13 if MINGW
14   WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
15 endif
16
17 if USE_COVERAGE
18   AM_CFLAGS = --coverage -O0
19   XLIBS = -lgcov
20 endif
21
22 if HAVE_SQLITE
23 SQLITE_PLUGIN = libgnunet_plugin_namecache_sqlite.la
24 if HAVE_TESTING
25 SQLITE_TESTS = test_plugin_namecache_sqlite
26 endif
27 endif
28
29 if HAVE_POSTGRESQL
30 POSTGRES_PLUGIN = libgnunet_plugin_namecache_postgres.la
31 if HAVE_TESTING
32 POSTGRES_TESTS = test_plugin_namecache_postgres
33 endif
34 endif
35
36 # testcases do not even build yet; thus: experimental!
37 if HAVE_TESTING
38 TESTING_TESTS = \
39  test_namecache_api_cache_block
40 endif
41
42 if HAVE_SQLITE
43 check_PROGRAMS = \
44  $(SQLITE_TESTS) \
45  $(POSTGRES_TESTS) \
46  $(TESTING_TESTS)
47 endif
48
49 if ENABLE_TEST_RUN
50 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;
51 TESTS = \
52   $(check_PROGRAMS)
53 endif
54
55 lib_LTLIBRARIES = \
56   libgnunetnamecache.la
57
58
59 libgnunetnamecache_la_SOURCES = \
60   namecache_api.c \
61   namecache.h
62 libgnunetnamecache_la_LIBADD = \
63   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
64   $(top_builddir)/src/util/libgnunetutil.la \
65   $(GN_LIBINTL)
66 libgnunetnamecache_la_LDFLAGS = \
67   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
68   -version-info 0:0:0
69
70
71 libexec_PROGRAMS = \
72  gnunet-service-namecache
73
74 bin_PROGRAMS = \
75  gnunet-namecache
76
77 gnunet_namecache_SOURCES = \
78  gnunet-namecache.c
79 gnunet_namecache_LDADD = \
80   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
81   $(top_builddir)/src/util/libgnunetutil.la \
82   $(top_builddir)/src/namecache/libgnunetnamecache.la \
83   $(GN_LIBINTL)
84 gnunet_namecache_DEPENDENCIES = \
85   $(top_builddir)/src/identity/libgnunetidentity.la \
86   $(top_builddir)/src/util/libgnunetutil.la \
87   $(top_builddir)/src/namecache/libgnunetnamecache.la 
88
89 gnunet_service_namecache_SOURCES = \
90  gnunet-service-namecache.c
91
92 gnunet_service_namecache_LDADD = \
93   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
94   $(top_builddir)/src/statistics/libgnunetstatistics.la \
95   $(top_builddir)/src/util/libgnunetutil.la \
96   $(top_builddir)/src/namecache/libgnunetnamecache.la \
97   $(GN_LIBINTL)
98 gnunet_service_namecache_DEPENDENCIES = \
99   $(top_builddir)/src/statistics/libgnunetstatistics.la \
100   $(top_builddir)/src/util/libgnunetutil.la \
101   $(top_builddir)/src/namecache/libgnunetnamecache.la 
102
103
104 plugin_LTLIBRARIES = \
105   $(SQLITE_PLUGIN) \
106   $(POSTGRES_PLUGIN)
107
108 libgnunet_plugin_namecache_sqlite_la_SOURCES = \
109   plugin_namecache_sqlite.c
110 libgnunet_plugin_namecache_sqlite_la_LIBADD = \
111   $(top_builddir)/src/namecache/libgnunetnamecache.la  \
112   $(top_builddir)/src/statistics/libgnunetstatistics.la \
113   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
114   $(LTLIBINTL)
115 libgnunet_plugin_namecache_sqlite_la_LDFLAGS = \
116  $(GN_PLUGIN_LDFLAGS)
117 libgnunet_plugin_namecache_sqlite_la_DEPENDENCIES = \
118   $(top_builddir)/src/statistics/libgnunetstatistics.la \
119   $(top_builddir)/src/util/libgnunetutil.la \
120   $(top_builddir)/src/namecache/libgnunetnamecache.la 
121
122
123 libgnunet_plugin_namecache_postgres_la_SOURCES = \
124   plugin_namecache_postgres.c
125 libgnunet_plugin_namecache_postgres_la_LIBADD = \
126   $(top_builddir)/src/namecache/libgnunetnamecache.la  \
127   $(top_builddir)/src/postgres/libgnunetpostgres.la  \
128   $(top_builddir)/src/statistics/libgnunetstatistics.la \
129   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq \
130   $(LTLIBINTL)
131 libgnunet_plugin_namecache_postgres_la_LDFLAGS = \
132  $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
133 libgnunet_plugin_namecache_postgres_la_DEPENDENCIES = \
134   $(top_builddir)/src/postgres/libgnunetpostgres.la  \
135   $(top_builddir)/src/statistics/libgnunetstatistics.la \
136   $(top_builddir)/src/util/libgnunetutil.la \
137   $(top_builddir)/src/namecache/libgnunetnamecache.la 
138
139 test_namecache_api_cache_block_SOURCES = \
140  test_namecache_api_cache_block.c
141 test_namecache_api_cache_block_LDADD = \
142   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
143   $(top_builddir)/src/namecache/libgnunetnamecache.la \
144   $(top_builddir)/src/testing/libgnunettesting.la \
145   $(top_builddir)/src/util/libgnunetutil.la
146
147 test_plugin_namecache_sqlite_SOURCES = \
148  test_plugin_namecache.c
149 test_plugin_namecache_sqlite_LDADD = \
150  $(top_builddir)/src/testing/libgnunettesting.la \
151  $(top_builddir)/src/util/libgnunetutil.la
152
153 test_plugin_namecache_postgres_SOURCES = \
154  test_plugin_namecache.c
155 test_plugin_namecache_postgres_LDADD = \
156  $(top_builddir)/src/testing/libgnunettesting.la \
157  $(top_builddir)/src/util/libgnunetutil.la
158
159 EXTRA_DIST = \
160   test_namecache_api.conf \
161   test_plugin_namecache_sqlite.conf \
162   test_plugin_namecache_postgres.conf 
163