991e36a955ca8cd15e0cdf8d1279c8ea181ebd92
[oweals/gnunet.git] / 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   consensus.conf
12
13 if MINGW
14  WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
15 endif
16
17 if USE_COVERAGE
18   AM_CFLAGS = -fprofile-arcs -ftest-coverage
19 endif
20
21
22 libexec_PROGRAMS = \
23  gnunet-service-consensus
24
25 if ENABLE_MALICIOUS
26 libexec_PROGRAMS += \
27  gnunet-service-evil-consensus
28 endif
29
30 do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g'
31
32 SUFFIXES = .py.in .py
33
34 .py.in.py:
35         $(do_subst) < $< > $@
36         chmod +x $@
37
38 check-python-style:
39         flake8 consensus-simulation.py.in
40
41 lib_LTLIBRARIES = \
42   libgnunetconsensus.la
43
44 gnunet_consensus_profiler_SOURCES = \
45  gnunet-consensus-profiler.c
46 gnunet_consensus_profiler_LDADD = \
47   $(top_builddir)/src/util/libgnunetutil.la \
48   libgnunetconsensus.la \
49   $(top_builddir)/src/testbed/libgnunettestbed.la \
50   $(GN_LIBINTL)
51
52 gnunet_service_consensus_SOURCES = \
53  gnunet-service-consensus.c
54 gnunet_service_consensus_LDADD = \
55   $(top_builddir)/src/util/libgnunetutil.la \
56   $(top_builddir)/src/core/libgnunetcore.la \
57   $(top_builddir)/src/set/libgnunetset.la \
58   $(top_builddir)/src/statistics/libgnunetstatistics.la \
59   $(GN_LIBINTL)
60
61 gnunet_service_evil_consensus_SOURCES = \
62  gnunet-service-consensus.c \
63  consensus_protocol.h
64 gnunet_service_evil_consensus_LDADD = \
65   $(top_builddir)/src/util/libgnunetutil.la \
66   $(top_builddir)/src/core/libgnunetcore.la \
67   $(top_builddir)/src/set/libgnunetset.la \
68   $(top_builddir)/src/statistics/libgnunetstatistics.la \
69   $(GN_LIBINTL)
70 gnunet_service_evil_consensus_CFLAGS = -DEVIL
71
72 libgnunetconsensus_la_SOURCES = \
73   consensus_api.c \
74   consensus.h
75 libgnunetconsensus_la_LIBADD = \
76   $(top_builddir)/src/util/libgnunetutil.la \
77   $(LTLIBINTL)
78 libgnunetconsensus_la_LDFLAGS = \
79   $(GN_LIB_LDFLAGS)
80
81
82 plugin_LTLIBRARIES = \
83   libgnunet_plugin_block_consensus.la
84
85 libgnunet_plugin_block_consensus_la_SOURCES = \
86   plugin_block_consensus.c
87 libgnunet_plugin_block_consensus_la_LIBADD = \
88   $(top_builddir)/src/block/libgnunetblock.la \
89   $(top_builddir)/src/block/libgnunetblockgroup.la \
90   $(top_builddir)/src/util/libgnunetutil.la \
91   $(LTLIBINTL)
92 libgnunet_plugin_block_consensus_la_LDFLAGS = \
93  $(GN_PLUGIN_LDFLAGS)
94
95
96
97 if HAVE_TESTING
98 bin_PROGRAMS = \
99  gnunet-consensus-profiler
100
101 check_PROGRAMS = \
102  test_consensus_api
103
104 if ENABLE_TEST_RUN
105 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
106 TESTS = $(check_PROGRAMS)
107 endif
108 endif
109
110 test_consensus_api_SOURCES = \
111  test_consensus_api.c
112 test_consensus_api_LDADD = \
113   $(top_builddir)/src/util/libgnunetutil.la \
114   $(top_builddir)/src/testing/libgnunettesting.la \
115   libgnunetconsensus.la
116
117 noinst_SCRIPTS = \
118         consensus-simulation.py
119
120 CLEANFILES = \
121         $(noinst_SCRIPTS)
122
123 EXTRA_DIST = \
124   test_consensus.conf \
125   consensus-simulation.py.in