e27611ba9114f3284e65e07aca60876f3489c549
[oweals/gnunet.git] / src / nat / Makefile.am
1 INCLUDES = -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 install-exec-hook:
25 endif
26
27 bin_PROGRAMS = \
28  gnunet-nat-server 
29
30 libexec_PROGRAMS = \
31  $(NATBIN) 
32
33 gnunet_nat_server_SOURCES = \
34  gnunet-nat-server.c nat.h
35 gnunet_nat_server_LDADD = \
36   $(top_builddir)/src/nat/libgnunetnat.la \
37   $(top_builddir)/src/util/libgnunetutil.la
38 gnunet_nat_server_DEPENDENCIES = \
39   libgnunetnat.la
40
41 gnunet_helper_nat_server_SOURCES = \
42  $(NATSERVER)
43
44 gnunet_helper_nat_client_SOURCES = \
45  $(NATCLIENT)         
46
47
48
49 if USE_COVERAGE
50   AM_CFLAGS = -fprofile-arcs -ftest-coverage
51 endif
52
53 lib_LTLIBRARIES = libgnunetnat.la
54
55 libgnunetnat_la_SOURCES = \
56   nat.c nat.h \
57   nat_auto.c \
58   nat_test.c \
59   nat_mini.c 
60
61 libgnunetnat_la_LIBADD = \
62   $(top_builddir)/src/util/libgnunetutil.la \
63   $(GN_LIBINTL) @EXT_LIBS@ 
64
65 libgnunetnat_la_LDFLAGS = \
66   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
67   -version-info 1:0:1
68
69 check_PROGRAMS = \
70   test_nat \
71   test_nat_mini \
72   test_nat_test
73
74 if ENABLE_TEST_RUN
75  TESTS = $(check_PROGRAMS)
76 endif
77
78 test_nat_SOURCES = \
79   test_nat.c
80 test_nat_LDADD = \
81  $(top_builddir)/src/nat/libgnunetnat.la \
82  $(top_builddir)/src/util/libgnunetutil.la 
83
84 test_nat_mini_SOURCES = \
85   test_nat_mini.c
86 test_nat_mini_LDADD = \
87  $(top_builddir)/src/nat/libgnunetnat.la \
88  $(top_builddir)/src/util/libgnunetutil.la 
89
90
91 test_nat_test_SOURCES = \
92   test_nat_test.c
93 test_nat_test_LDADD = \
94  $(top_builddir)/src/nat/libgnunetnat.la \
95  $(top_builddir)/src/util/libgnunetutil.la 
96
97
98 EXTRA_DIST = \
99  test_nat_data.conf \
100  test_nat_test_data.conf