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