69424ffb9ce50e77f8f1c641eb6c87e40ad1bc3e
[oweals/gnunet.git] / src / peerinfo / Makefile.am
1 # This Makefile.am is in the public domain
2 AM_CPPFLAGS = -I$(top_srcdir)/src/include
3
4 pkgcfgdir= $(pkgdatadir)/config.d/
5
6 libexecdir= $(pkglibdir)/libexec/
7
8 plugindir = $(libdir)/gnunet
9
10 pkgcfg_DATA = \
11   peerinfo.conf
12
13 if MINGW
14  WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols -lole32 -lshell32 -liconv -lstdc++ -lcomdlg32 -lgdi32
15 endif
16
17 if USE_COVERAGE
18   AM_CFLAGS = --coverage -O0
19   XLIB = -lgcov
20 endif
21
22 if HAVE_MHD
23 if HAVE_JSON
24 REST_PLUGIN = libgnunet_plugin_rest_peerinfo.la
25 endif
26 endif
27
28 lib_LTLIBRARIES = libgnunetpeerinfo.la
29
30 plugin_LTLIBRARIES = $(REST_PLUGIN)
31
32 libgnunet_plugin_rest_peerinfo_la_SOURCES = \
33   plugin_rest_peerinfo.c
34 libgnunet_plugin_rest_peerinfo_la_LIBADD = \
35   $(top_builddir)/src/hello/libgnunethello.la \
36   libgnunetpeerinfo.la \
37   $(top_builddir)/src/rest/libgnunetrest.la \
38   $(top_builddir)/src/json/libgnunetjson.la \
39   $(top_builddir)/src/transport/libgnunettransport.la \
40   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
41   $(LTLIBINTL) -ljansson -lmicrohttpd
42 libgnunet_plugin_rest_peerinfo_la_LDFLAGS = \
43  $(GN_PLUGIN_LDFLAGS)
44
45
46 libgnunetpeerinfo_la_SOURCES = \
47   peerinfo_api.c peerinfo.h \
48   peerinfo_api_notify.c
49 libgnunetpeerinfo_la_LIBADD = \
50   $(top_builddir)/src/hello/libgnunethello.la \
51   $(top_builddir)/src/util/libgnunetutil.la \
52   $(XLIB) \
53   $(LTLIBINTL)
54 libgnunetpeerinfo_la_LDFLAGS = \
55   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
56   -version-info 0:0:0
57
58
59 libexec_PROGRAMS = \
60  gnunet-service-peerinfo
61
62 gnunet_service_peerinfo_SOURCES = \
63   gnunet-service-peerinfo.c
64 gnunet_service_peerinfo_LDADD = \
65   $(top_builddir)/src/hello/libgnunethello.la \
66   $(top_builddir)/src/statistics/libgnunetstatistics.la \
67   $(top_builddir)/src/util/libgnunetutil.la
68
69 if HAVE_BENCHMARKS
70  PEERINFO_BENCHMARKS = \
71  perf_peerinfo_api
72 endif
73
74 if HAVE_TESTING
75 check_PROGRAMS = \
76  test_peerinfo_shipped_hellos \
77  test_peerinfo_api \
78  test_peerinfo_api_friend_only \
79  test_peerinfo_api_notify_friend_only \
80  $(PEERINFO_BENCHMARKS)
81 endif
82
83
84 if ENABLE_TEST_RUN
85 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
86 TESTS = $(check_PROGRAMS)
87 endif
88
89 test_peerinfo_shipped_hellos_SOURCES = \
90  test_peerinfo_shipped_hellos.c
91 test_peerinfo_shipped_hellos_LDADD = \
92  $(top_builddir)/src/hello/libgnunethello.la \
93  libgnunetpeerinfo.la \
94  $(top_builddir)/src/testing/libgnunettesting.la \
95  $(top_builddir)/src/util/libgnunetutil.la
96
97 test_peerinfo_api_SOURCES = \
98  test_peerinfo_api.c
99 test_peerinfo_api_LDADD = \
100  $(top_builddir)/src/hello/libgnunethello.la \
101  libgnunetpeerinfo.la \
102  $(top_builddir)/src/testing/libgnunettesting.la \
103  $(top_builddir)/src/util/libgnunetutil.la
104
105 test_peerinfo_api_friend_only_SOURCES = \
106  test_peerinfo_api_friend_only.c
107 test_peerinfo_api_friend_only_LDADD = \
108  $(top_builddir)/src/hello/libgnunethello.la \
109  libgnunetpeerinfo.la \
110  $(top_builddir)/src/testing/libgnunettesting.la \
111  $(top_builddir)/src/util/libgnunetutil.la
112
113 test_peerinfo_api_notify_friend_only_SOURCES = \
114  test_peerinfo_api_notify_friend_only.c
115 test_peerinfo_api_notify_friend_only_LDADD = \
116  $(top_builddir)/src/hello/libgnunethello.la \
117  libgnunetpeerinfo.la \
118  $(top_builddir)/src/testing/libgnunettesting.la \
119  $(top_builddir)/src/util/libgnunetutil.la
120
121 perf_peerinfo_api_SOURCES = \
122  perf_peerinfo_api.c
123 perf_peerinfo_api_LDADD = \
124  $(top_builddir)/src/hello/libgnunethello.la \
125  libgnunetpeerinfo.la \
126  $(top_builddir)/src/testing/libgnunettesting.la \
127  $(top_builddir)/src/util/libgnunetutil.la
128
129 EXTRA_DIST = \
130   test_peerinfo_api_data.conf