Fix TESTS_ENVIRONMENT setting (allow GNUNET_PREFIX to be overriden, allow TESTS_ENVIR...
[oweals/gnunet.git] / src / nse / Makefile.am
1 AM_CPPFLAGS = -I$(top_srcdir)/src/include
2
3 if MINGW
4  WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
5 endif
6
7 if USE_COVERAGE
8   AM_CFLAGS = --coverage -O0
9   XLIB = -lgcov
10 endif
11
12 pkgcfgdir= $(pkgdatadir)/config.d/
13
14 libexecdir= $(pkglibdir)/libexec/
15
16 pkgcfg_DATA = \
17   nse.conf
18
19
20 lib_LTLIBRARIES = libgnunetnse.la
21
22 libgnunetnse_la_SOURCES = \
23   nse_api.c nse.h
24 libgnunetnse_la_LIBADD = \
25   $(top_builddir)/src/util/libgnunetutil.la \
26   $(GN_LIBINTL) $(XLIB)
27 libgnunetnse_la_LDFLAGS = \
28   $(GN_LIB_LDFLAGS)  $(WINFLAGS) \
29   -version-info 0:0:0
30
31
32 libexec_PROGRAMS = \
33  gnunet-service-nse
34
35 if HAVE_TESTING
36 noinst_PROGRAMS = \
37  gnunet-nse-profiler
38 endif
39
40 gnunet_nse_profiler_SOURCES = \
41  gnunet-nse-profiler.c
42 gnunet_nse_profiler_LDADD = -lm \
43   $(top_builddir)/src/nse/libgnunetnse.la \
44   $(top_builddir)/src/util/libgnunetutil.la \
45   $(top_builddir)/src/statistics/libgnunetstatistics.la \
46   $(top_builddir)/src/testbed/libgnunettestbed.la \
47   $(GN_LIBINTL)
48 gnunet_nse_profiler_DEPENDENCIES = \
49   libgnunetnse.la
50
51 gnunet_service_nse_SOURCES = \
52  gnunet-service-nse.c
53 gnunet_service_nse_LDADD = \
54   $(top_builddir)/src/nse/libgnunetnse.la \
55   $(top_builddir)/src/util/libgnunetutil.la \
56   $(top_builddir)/src/core/libgnunetcore.la \
57   $(top_builddir)/src/statistics/libgnunetstatistics.la \
58   $(LIBGCRYPT_LIBS) \
59   -lm -lgcrypt \
60   $(GN_LIBINTL)
61 gnunet_service_nse_DEPENDENCIES = \
62   libgnunetnse.la
63 if ENABLE_NSE_HISTOGRAM
64   gnunet_service_nse_LDADD += \
65     $(top_builddir)/src/testbed/libgnunettestbedlogger.la
66   gnunet_service_nse_DEPENDENCIES += \
67     $(top_builddir)/src/testbed/libgnunettestbedlogger.la
68 endif
69
70
71 if HAVE_BENCHMARKS
72   MULTIPEER_TEST = test_nse_multipeer
73 endif
74
75 if HAVE_TESTING
76 check_PROGRAMS = \
77  test_nse_api \
78  perf_kdf \
79  $(MULTIPEER_TEST)
80 endif
81
82 if ENABLE_TEST_RUN
83 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;
84 TESTS = $(check_PROGRAMS)
85 endif
86
87 test_nse_api_SOURCES = \
88  test_nse_api.c
89 test_nse_api_LDADD = \
90   $(top_builddir)/src/nse/libgnunetnse.la \
91   $(top_builddir)/src/testing/libgnunettesting.la \
92   $(top_builddir)/src/util/libgnunetutil.la
93
94 test_nse_multipeer_SOURCES = \
95  test_nse_multipeer.c
96 test_nse_multipeer_LDADD = \
97   $(top_builddir)/src/nse/libgnunetnse.la \
98   $(top_builddir)/src/util/libgnunetutil.la \
99   $(top_builddir)/src/testbed/libgnunettestbed.la \
100   -lm
101
102 perf_kdf_SOURCES = \
103  perf_kdf.c
104 perf_kdf_LDADD = \
105   $(top_builddir)/src/util/libgnunetutil.la \
106   $(LIBGCRYPT_LIBS) \
107   -lgcrypt
108
109 EXTRA_DIST = \
110   test_nse.conf \
111   nse_profiler_test.conf
112
113