Link namesotre to libgnunetgnsrecord too
[oweals/gnunet.git] / src / namecache / Makefile.am
1 AM_CPPFLAGS = -I$(top_srcdir)/src/include
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_POSTGRES
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 TESTS = \
51   $(check_PROGRAMS)
52 endif
53
54 lib_LTLIBRARIES = \
55   libgnunetnamecache.la
56
57
58 libgnunetnamecache_la_SOURCES = \
59   namecache_api.c \
60   namecache.h
61 libgnunetnamecache_la_LIBADD = \
62   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
63   $(top_builddir)/src/util/libgnunetutil.la \
64   $(GN_LIBINTL)
65 libgnunetnamecache_la_LDFLAGS = \
66   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
67   -version-info 0:0:0
68
69
70 libexec_PROGRAMS = \
71  gnunet-service-namecache
72
73 bin_PROGRAMS = \
74  gnunet-namecache
75
76 gnunet_namecache_SOURCES = \
77  gnunet-namecache.c
78 gnunet_namecache_LDADD = \
79   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
80   $(top_builddir)/src/util/libgnunetutil.la \
81   libgnunetnamecache.la \
82   $(GN_LIBINTL)
83 gnunet_namecache_DEPENDENCIES = \
84   $(top_builddir)/src/identity/libgnunetidentity.la \
85   $(top_builddir)/src/util/libgnunetutil.la \
86   libgnunetnamecache.la
87
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   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   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   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)
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   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   test_namecache_defaults.conf
164