Use Suffix Extensions in Makefiles (doc, src/{arm,dht,integration,statistics}) for...
[oweals/gnunet.git] / src / dht / Makefile.am
1 # This Makefile.am is in the public domain
2 AM_CPPFLAGS = -I$(top_srcdir)/src/include
3 if MINGW
4  WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols -lole32 -lshell32 -liconv -lstdc++ -lcomdlg32 -lgdi32
5 endif
6
7 plugindir = $(libdir)/gnunet
8
9 pkgcfgdir= $(pkgdatadir)/config.d/
10
11 libexecdir= $(pkglibdir)/libexec/
12
13 pkgcfg_DATA = \
14   dht.conf
15
16 if USE_COVERAGE
17   AM_CFLAGS = --coverage -O0
18   XLIB = -lgcov
19 endif
20
21 lib_LTLIBRARIES = \
22  libgnunetdht.la
23
24 libgnunetdht_la_SOURCES = \
25   dht_api.c dht.h
26 libgnunetdht_la_LIBADD = \
27   $(top_builddir)/src/util/libgnunetutil.la \
28   $(XLIB) \
29   $(LTLIBINTL)
30 libgnunetdht_la_LDFLAGS = \
31   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
32   -version-info 3:0:0
33
34
35 plugin_LTLIBRARIES = \
36   libgnunet_plugin_block_dht.la
37
38 libgnunet_plugin_block_dht_la_SOURCES = \
39   plugin_block_dht.c
40 libgnunet_plugin_block_dht_la_LIBADD = \
41   $(top_builddir)/src/hello/libgnunethello.la \
42   $(top_builddir)/src/block/libgnunetblock.la \
43   $(top_builddir)/src/block/libgnunetblockgroup.la \
44   $(top_builddir)/src/util/libgnunetutil.la \
45   $(LTLIBINTL)
46 libgnunet_plugin_block_dht_la_LDFLAGS = \
47  $(GN_PLUGIN_LDFLAGS)
48
49
50 libexec_PROGRAMS = \
51  gnunet-service-dht
52
53 bin_PROGRAMS = \
54  gnunet-dht-monitor \
55  gnunet-dht-get \
56  gnunet-dht-put
57
58 if HAVE_TESTING
59 noinst_PROGRAMS = \
60  gnunet-dht-profiler
61 endif
62
63 gnunet_service_dht_SOURCES = \
64  gnunet-service-dht.c gnunet-service-dht.h \
65  gnunet-service-dht_datacache.c gnunet-service-dht_datacache.h \
66  gnunet-service-dht_hello.c gnunet-service-dht_hello.h \
67  gnunet-service-dht_nse.c gnunet-service-dht_nse.h \
68  gnunet-service-dht_neighbours.c gnunet-service-dht_neighbours.h \
69  gnunet-service-dht_routing.c gnunet-service-dht_routing.h
70 gnunet_service_dht_LDADD = \
71   $(top_builddir)/src/statistics/libgnunetstatistics.la \
72   $(top_builddir)/src/core/libgnunetcore.la \
73   $(top_builddir)/src/nse/libgnunetnse.la \
74   $(top_builddir)/src/ats/libgnunetats.la \
75   $(top_builddir)/src/transport/libgnunettransport.la \
76   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
77   $(top_builddir)/src/hello/libgnunethello.la \
78   $(top_builddir)/src/block/libgnunetblock.la \
79   $(top_builddir)/src/datacache/libgnunetdatacache.la \
80   $(top_builddir)/src/util/libgnunetutil.la \
81   -lm
82
83 gnunet_dht_get_SOURCES = \
84  gnunet-dht-get.c
85 gnunet_dht_get_LDADD = \
86   libgnunetdht.la \
87   $(top_builddir)/src/core/libgnunetcore.la \
88   $(top_builddir)/src/util/libgnunetutil.la
89
90 gnunet_dht_put_SOURCES = \
91  gnunet-dht-put.c
92 gnunet_dht_put_LDADD = \
93   libgnunetdht.la \
94   $(top_builddir)/src/core/libgnunetcore.la \
95   $(top_builddir)/src/util/libgnunetutil.la
96
97 gnunet_dht_monitor_SOURCES = \
98  gnunet-dht-monitor.c
99 gnunet_dht_monitor_LDADD = \
100   libgnunetdht.la \
101   $(top_builddir)/src/core/libgnunetcore.la \
102   $(top_builddir)/src/util/libgnunetutil.la
103
104 gnunet_dht_profiler_SOURCES = \
105   gnunet_dht_profiler.c
106 gnunet_dht_profiler_LDADD = \
107   libgnunetdht.la \
108   $(top_builddir)/src/core/libgnunetcore.la \
109   $(top_builddir)/src/util/libgnunetutil.la \
110  $(top_builddir)/src/testbed/libgnunettestbed.la
111
112 if HAVE_TESTING
113 noinst_LIBRARIES = libgnunetdhttest.a
114 endif
115
116 libgnunetdhttest_a_SOURCES = \
117   dht_test_lib.c dht_test_lib.h
118 libgnunetdhttest_a_LIBADD = \
119  $(top_builddir)/src/util/libgnunetutil.la \
120  $(top_builddir)/src/testbed/libgnunettestbed.la \
121  libgnunetdht.la
122
123 if HAVE_TESTING
124 check_PROGRAMS = \
125  test_dht_api \
126  test_dht_twopeer \
127  test_dht_multipeer \
128  test_dht_line \
129  test_dht_2dtorus \
130  test_dht_monitor
131 endif
132
133 if HAVE_EXPERIMENTAL
134 # These tests still do not work as testbed does
135 # not support the respective topology op
136  NEW_TESTS = test_dht_2dtorus test_dht_multipeer
137 endif
138
139 if ENABLE_TEST_RUN
140 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
141 TESTS = test_dht_api $(check_SCRIPTS) \
142  test_dht_twopeer \
143  test_dht_line \
144  test_dht_monitor \
145  $(NEW_TESTS)
146 endif
147
148 test_dht_api_SOURCES = \
149  test_dht_api.c
150 test_dht_api_LDADD = \
151  $(top_builddir)/src/util/libgnunetutil.la \
152  $(top_builddir)/src/testing/libgnunettesting.la \
153  $(top_builddir)/src/hello/libgnunethello.la \
154  libgnunetdht.la
155
156 test_dht_twopeer_SOURCES = \
157  test_dht_topo.c
158 test_dht_twopeer_LDADD = \
159  libgnunetdhttest.a \
160  $(top_builddir)/src/util/libgnunetutil.la \
161  libgnunetdhttest.a \
162  $(top_builddir)/src/testbed/libgnunettestbed.la \
163  libgnunetdht.la
164
165 test_dht_2dtorus_SOURCES = \
166  test_dht_topo.c
167 test_dht_2dtorus_LDADD = \
168  libgnunetdhttest.a \
169  $(top_builddir)/src/util/libgnunetutil.la \
170  $(top_builddir)/src/testbed/libgnunettestbed.la \
171  libgnunetdht.la
172
173 test_dht_line_SOURCES = \
174  test_dht_topo.c
175 test_dht_line_LDADD = \
176  libgnunetdhttest.a \
177  $(top_builddir)/src/util/libgnunetutil.la \
178  $(top_builddir)/src/testbed/libgnunettestbed.la \
179  libgnunetdht.la
180
181 test_dht_multipeer_SOURCES = \
182  test_dht_topo.c
183 test_dht_multipeer_LDADD = \
184  libgnunetdhttest.a \
185  $(top_builddir)/src/util/libgnunetutil.la \
186  $(top_builddir)/src/statistics/libgnunetstatistics.la \
187  $(top_builddir)/src/testbed/libgnunettestbed.la \
188  libgnunetdht.la
189
190 test_dht_monitor_SOURCES = \
191   test_dht_monitor.c
192 test_dht_monitor_LDADD = \
193  libgnunetdhttest.a \
194  $(top_builddir)/src/util/libgnunetutil.la \
195  $(top_builddir)/src/testbed/libgnunettestbed.la \
196  libgnunetdht.la
197
198 EXTRA_DIST = \
199   $(check_SCRIPTS) \
200   test_dht_api_data.conf \
201   test_dht_api_peer1.conf \
202   test_dht_monitor.conf \
203   test_dht_multipeer.conf \
204   test_dht_2dtorus.conf \
205   test_dht_line.conf \
206   test_dht_tools.py.in \
207   test_dht_multipeer_topology.dat
208
209 if HAVE_PYTHON
210 check_SCRIPTS = \
211   test_dht_tools.py
212 endif
213
214 do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g' -e 's,[@]bindir[@],$(bindir),g'
215
216 SUFFIXES = .py.in .py
217 .py.in.py:
218         $(do_subst) < $(srcdir)/$< > $@
219         chmod +x $@
220
221 test_dht_tools.py: test_dht_tools.py.in Makefile
222         $(do_subst) < $(srcdir)/test_dht_tools.py.in > test_dht_tools.py
223         chmod +x test_dht_tools.py