fix #4546
[oweals/gnunet.git] / src / nat / 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   NATBIN = gnunet-helper-nat-server gnunet-helper-nat-client
7   NATSERVER = gnunet-helper-nat-server-windows.c
8   NATCLIENT = gnunet-helper-nat-client-windows.c
9 endif
10
11 libexecdir= $(pkglibdir)/libexec/
12
13 pkgcfgdir= $(pkgdatadir)/config.d/
14
15 dist_pkgcfg_DATA = \
16   nat.conf
17
18 if LINUX
19   NATBIN = gnunet-helper-nat-server gnunet-helper-nat-client
20   NATSERVER = gnunet-helper-nat-server.c
21   NATCLIENT = gnunet-helper-nat-client.c
22 install-exec-hook:
23         $(top_srcdir)/src/nat/install-nat-helper.sh $(DESTDIR)$(libexecdir) $(SUDO_BINARY) || true
24 else
25 if XFREEBSD
26   NATBIN = gnunet-helper-nat-server gnunet-helper-nat-client
27   NATSERVER = gnunet-helper-nat-server.c
28   NATCLIENT = gnunet-helper-nat-client.c
29 install-exec-hook:
30         $(top_srcdir)/src/nat/install-nat-helper.sh $(DESTDIR)$(libexecdir) $(SUDO_BINARY) || true
31 endif
32 else
33 install-exec-hook:
34 endif
35
36 bin_PROGRAMS = \
37  gnunet-nat-server \
38  gnunet-nat
39
40 libexec_PROGRAMS = \
41  $(NATBIN) 
42
43 gnunet_nat_server_SOURCES = \
44  gnunet-nat-server.c nat.h
45 gnunet_nat_server_LDADD = \
46   libgnunetnat.la \
47   $(top_builddir)/src/util/libgnunetutil.la
48
49 gnunet_helper_nat_server_SOURCES = \
50  $(NATSERVER)
51
52 gnunet_helper_nat_client_SOURCES = \
53  $(NATCLIENT)         
54
55  
56 gnunet_nat_SOURCES = \
57 gnunet-nat.c nat.h
58 gnunet_nat_LDADD = \
59   libgnunetnat.la \
60   $(top_builddir)/src/util/libgnunetutil.la
61
62
63 if USE_COVERAGE
64   AM_CFLAGS = -fprofile-arcs -ftest-coverage
65 endif
66
67 lib_LTLIBRARIES = libgnunetnat.la
68
69 libgnunetnat_la_SOURCES = \
70   nat.c nat.h \
71   nat_auto.c \
72   nat_test.c \
73   nat_mini.c \
74   nat_stun.c
75
76 libgnunetnat_la_LIBADD = \
77   $(top_builddir)/src/util/libgnunetutil.la \
78   $(GN_LIBINTL) @EXT_LIBS@ 
79
80 libgnunetnat_la_LDFLAGS = \
81   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
82   -version-info 1:1:1
83
84 check_PROGRAMS = \
85   test_nat \
86   test_nat_mini \
87   test_nat_test \
88   test_stun
89
90 if ENABLE_TEST_RUN
91  AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;
92  TESTS = $(check_PROGRAMS)
93 endif
94
95 test_nat_SOURCES = \
96   test_nat.c
97 test_nat_LDADD = \
98  libgnunetnat.la \
99  $(top_builddir)/src/util/libgnunetutil.la 
100
101 test_nat_mini_SOURCES = \
102   test_nat_mini.c
103 test_nat_mini_LDADD = \
104  libgnunetnat.la \
105  $(top_builddir)/src/util/libgnunetutil.la 
106
107
108 test_nat_test_SOURCES = \
109   test_nat_test.c
110 test_nat_test_LDADD = \
111  libgnunetnat.la \
112  $(top_builddir)/src/util/libgnunetutil.la 
113
114 test_stun_SOURCES = \
115   test_stun.c
116 test_stun_LDADD = \
117  libgnunetnat.la \
118  $(top_builddir)/src/util/libgnunetutil.la 
119
120 EXTRA_DIST = \
121  test_nat_data.conf \
122  test_nat_test_data.conf \
123  test_stun.conf