Merge branch 'master' of gnunet.org:gnunet
[oweals/gnunet.git] / src / rps / Makefile.am
1 # This Makefile.am is in the public domain
2 AM_CPPFLAGS = -I$(top_srcdir)/src/include
3
4 if MINGW
5  WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
6 endif
7
8 if USE_COVERAGE
9   AM_CFLAGS = --coverage -O0
10   XLIB = -lgcov
11 endif
12
13 pkgcfgdir= $(pkgdatadir)/config.d/
14
15 libexecdir= $(pkglibdir)/libexec/
16
17 pkgcfg_DATA = \
18   rps.conf
19
20 bin_PROGRAMS = gnunet-rps
21
22 gnunet_rps_SOURCES = \
23   gnunet-rps.c
24
25 gnunet_rps_LDADD = \
26   libgnunetrps.la \
27   $(top_builddir)/src/util/libgnunetutil.la \
28   $(XLIB) $(GN_LIBINTL)
29
30 lib_LTLIBRARIES = libgnunetrps.la
31
32 libgnunetrps_la_SOURCES = \
33  gnunet-service-rps_sampler_elem.h gnunet-service-rps_sampler_elem.c \
34   rps-test_util.h rps-test_util.c \
35   rps-sampler_common.h rps-sampler_common.c \
36   rps-sampler_client.h rps-sampler_client.c \
37   rps_api.c rps.h
38 libgnunetrps_la_LIBADD = \
39   $(top_builddir)/src/nse/libgnunetnse.la \
40   $(top_builddir)/src/util/libgnunetutil.la \
41   $(GN_LIBINTL) $(XLIB)
42 libgnunetrps_la_LDFLAGS = \
43   $(GN_LIB_LDFLAGS)  $(WINFLAGS) \
44   -version-info 0:0:0
45 # Fix 'created both with libtool and without' error:
46 libgnunetrps_la_CFLAGS = $(AM_CFLAGS)
47
48
49 libexec_PROGRAMS = \
50  gnunet-service-rps
51
52 if HAVE_TESTING
53 noinst_PROGRAMS = \
54  gnunet-rps-profiler
55 endif
56
57
58 gnunet_service_rps_SOURCES = \
59  gnunet-service-rps_sampler_elem.h gnunet-service-rps_sampler_elem.c \
60  rps-sampler_common.h rps-sampler_common.c \
61  gnunet-service-rps_sampler.h gnunet-service-rps_sampler.c \
62  gnunet-service-rps_custommap.h gnunet-service-rps_custommap.c \
63  gnunet-service-rps_view.h gnunet-service-rps_view.c \
64  gnunet-service-rps.c
65
66
67 gnunet_service_rps_LDADD = \
68   libgnunetrps.la \
69   $(top_builddir)/src/util/libgnunetutil.la \
70   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
71   $(top_builddir)/src/cadet/libgnunetcadet.la \
72   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
73   $(top_builddir)/src/nse/libgnunetnse.la \
74   $(top_builddir)/src/statistics/libgnunetstatistics.la \
75   $(top_builddir)/src/core/libgnunetcore.la \
76   $(LIBGCRYPT_LIBS) \
77   -lm -lgcrypt \
78   $(GN_LIBINTL)
79
80
81 if HAVE_TESTING
82 check_PROGRAMS = \
83  test_service_rps_view \
84  test_service_rps_custommap \
85  test_service_rps_sampler_elem \
86  test_rps_single_req \
87  test_rps_req_cancel \
88  test_rps_sub \
89  test_rps_seed_request \
90  test_rps_seed_big \
91  test_rps_churn
92 if ENABLE_MALICIOUS
93 check_PROGRAMS += \
94  test_rps_malicious_1 \
95  test_rps_malicious_2 \
96  test_rps_malicious_3
97 endif
98 endif
99
100 rps_test_src = \
101         test_rps.c \
102         rps-test_util.h rps-test_util.c \
103  gnunet-service-rps_sampler_elem.h gnunet-service-rps_sampler_elem.c \
104  rps-sampler_common.h rps-sampler_common.c \
105  gnunet-service-rps_sampler.h gnunet-service-rps_sampler.c
106
107 ld_rps_test_lib = \
108         libgnunetrps.la \
109   $(top_builddir)/src/util/libgnunetutil.la \
110   $(top_builddir)/src/statistics/libgnunetstatistics.la \
111   $(top_builddir)/src/testbed/libgnunettestbed.la \
112   -lm
113
114 if ENABLE_TEST_RUN
115 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
116 TESTS = $(check_PROGRAMS)
117 endif
118
119 test_service_rps_view_SOURCES = \
120   gnunet-service-rps_view.h gnunet-service-rps_view.c \
121   test_service_rps_view.c
122 test_service_rps_view_LDADD = $(top_builddir)/src/util/libgnunetutil.la
123
124 test_service_rps_custommap_SOURCES = \
125   gnunet-service-rps_custommap.h gnunet-service-rps_custommap.c \
126   test_service_rps_custommap.c
127 test_service_rps_custommap_LDADD = \
128   $(top_builddir)/src/util/libgnunetutil.la
129
130 test_service_rps_sampler_elem_SOURCES = \
131   gnunet-service-rps_sampler_elem.h gnunet-service-rps_sampler_elem.c \
132   rps-test_util.h rps-test_util.c \
133   test_service_rps_sampler_elem.c
134 test_service_rps_sampler_elem_LDADD = $(top_builddir)/src/util/libgnunetutil.la
135
136 test_rps_single_req_SOURCES = $(rps_test_src)
137 test_rps_single_req_LDADD = $(ld_rps_test_lib)
138
139 test_rps_seed_request_SOURCES = $(rps_test_src)
140 test_rps_seed_request_LDADD = $(ld_rps_test_lib)
141
142 test_rps_req_cancel_SOURCES = $(rps_test_src)
143 test_rps_req_cancel_LDADD = $(ld_rps_test_lib)
144
145 test_rps_sub_SOURCES = $(rps_test_src)
146 test_rps_sub_LDADD = $(ld_rps_test_lib)
147
148 test_rps_seed_big_SOURCES = $(rps_test_src)
149 test_rps_seed_big_LDADD = $(ld_rps_test_lib)
150
151 test_rps_churn_SOURCES = $(rps_test_src)
152 test_rps_churn_LDADD = $(ld_rps_test_lib)
153
154 test_rps_malicious_1_SOURCES = $(rps_test_src)
155 test_rps_malicious_1_LDADD = $(ld_rps_test_lib)
156
157 test_rps_malicious_2_SOURCES = $(rps_test_src)
158 test_rps_malicious_2_LDADD = $(ld_rps_test_lib)
159
160 test_rps_malicious_3_SOURCES = $(rps_test_src)
161 test_rps_malicious_3_LDADD = $(ld_rps_test_lib)
162
163 gnunet_rps_profiler_SOURCES = \
164  gnunet-service-rps_sampler_elem.h gnunet-service-rps_sampler_elem.c \
165  rps-sampler_common.h rps-sampler_common.c \
166  gnunet-service-rps_sampler.h gnunet-service-rps_sampler.c \
167  rps-test_util.h rps-test_util.c \
168  gnunet-rps-profiler.c
169
170
171 gnunet_rps_profiler_LDADD = \
172   $(top_builddir)/src/statistics/libgnunetstatistics.la \
173   libgnunetrps.la \
174   $(top_builddir)/src/util/libgnunetutil.la \
175   $(top_builddir)/src/testbed/libgnunettestbed.la \
176   -lm
177
178
179 EXTRA_DIST = \
180   test_rps.conf