- debug
[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/util/libgnunetutil.la \
63   $(GN_LIBINTL)
64 libgnunetnamecache_la_LDFLAGS = \
65   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
66   -version-info 0:0:0
67
68
69 libexec_PROGRAMS = \
70  gnunet-service-namecache
71
72 bin_PROGRAMS = \
73  gnunet-namecache
74
75 gnunet_namecache_SOURCES = \
76  gnunet-namecache.c
77 gnunet_namecache_LDADD = \
78   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
79   $(top_builddir)/src/util/libgnunetutil.la \
80   libgnunetnamecache.la \
81   $(GN_LIBINTL)
82 gnunet_namecache_DEPENDENCIES = \
83   $(top_builddir)/src/identity/libgnunetidentity.la \
84   $(top_builddir)/src/util/libgnunetutil.la \
85   libgnunetnamecache.la
86
87
88 gnunet_service_namecache_SOURCES = \
89  gnunet-service-namecache.c
90
91 gnunet_service_namecache_LDADD = \
92   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
93   $(top_builddir)/src/statistics/libgnunetstatistics.la \
94   $(top_builddir)/src/util/libgnunetutil.la \
95   libgnunetnamecache.la \
96   $(GN_LIBINTL)
97 gnunet_service_namecache_DEPENDENCIES = \
98   $(top_builddir)/src/statistics/libgnunetstatistics.la \
99   $(top_builddir)/src/util/libgnunetutil.la \
100   libgnunetnamecache.la
101
102
103 plugin_LTLIBRARIES = \
104   $(SQLITE_PLUGIN) \
105   $(POSTGRES_PLUGIN)
106
107 libgnunet_plugin_namecache_sqlite_la_SOURCES = \
108   plugin_namecache_sqlite.c
109 libgnunet_plugin_namecache_sqlite_la_LIBADD = \
110   $(top_builddir)/src/namecache/libgnunetnamecache.la  \
111   $(top_builddir)/src/statistics/libgnunetstatistics.la \
112   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
113   $(LTLIBINTL)
114 libgnunet_plugin_namecache_sqlite_la_LDFLAGS = \
115  $(GN_PLUGIN_LDFLAGS)
116 libgnunet_plugin_namecache_sqlite_la_DEPENDENCIES = \
117   $(top_builddir)/src/statistics/libgnunetstatistics.la \
118   $(top_builddir)/src/util/libgnunetutil.la \
119   libgnunetnamecache.la
120
121
122 libgnunet_plugin_namecache_postgres_la_SOURCES = \
123   plugin_namecache_postgres.c
124 libgnunet_plugin_namecache_postgres_la_LIBADD = \
125   $(top_builddir)/src/namecache/libgnunetnamecache.la  \
126   $(top_builddir)/src/postgres/libgnunetpostgres.la  \
127   $(top_builddir)/src/statistics/libgnunetstatistics.la \
128   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq \
129   $(LTLIBINTL)
130 libgnunet_plugin_namecache_postgres_la_LDFLAGS = \
131  $(GN_PLUGIN_LDFLAGS)
132 libgnunet_plugin_namecache_postgres_la_DEPENDENCIES = \
133   $(top_builddir)/src/postgres/libgnunetpostgres.la  \
134   $(top_builddir)/src/statistics/libgnunetstatistics.la \
135   $(top_builddir)/src/util/libgnunetutil.la \
136   libgnunetnamecache.la
137
138 test_namecache_api_cache_block_SOURCES = \
139  test_namecache_api_cache_block.c
140 test_namecache_api_cache_block_LDADD = \
141   $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \
142   $(top_builddir)/src/namecache/libgnunetnamecache.la \
143   $(top_builddir)/src/testing/libgnunettesting.la \
144   $(top_builddir)/src/util/libgnunetutil.la
145
146 test_plugin_namecache_sqlite_SOURCES = \
147  test_plugin_namecache.c
148 test_plugin_namecache_sqlite_LDADD = \
149  $(top_builddir)/src/testing/libgnunettesting.la \
150  $(top_builddir)/src/util/libgnunetutil.la
151
152 test_plugin_namecache_postgres_SOURCES = \
153  test_plugin_namecache.c
154 test_plugin_namecache_postgres_LDADD = \
155  $(top_builddir)/src/testing/libgnunettesting.la \
156  $(top_builddir)/src/util/libgnunetutil.la
157
158 EXTRA_DIST = \
159   test_namecache_api.conf \
160   test_plugin_namecache_sqlite.conf \
161   test_plugin_namecache_postgres.conf \
162   test_namecache_defaults.conf
163