largely completing gnunet-nat tool, using new service API (but untested)
[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  gnunet-service-nat
43
44
45 gnunet_nat_server_SOURCES = \
46  gnunet-nat-server.c nat.h
47 gnunet_nat_server_LDADD = \
48   libgnunetnat.la \
49   $(top_builddir)/src/util/libgnunetutil.la
50
51 gnunet_helper_nat_server_SOURCES = \
52  $(NATSERVER)
53
54 gnunet_helper_nat_client_SOURCES = \
55  $(NATCLIENT)         
56
57
58 gnunet_nat_SOURCES = \
59   gnunet-nat.c nat.h
60 gnunet_nat_LDADD = \
61   libgnunetnatnew.la \
62   $(top_builddir)/src/util/libgnunetutil.la
63
64
65 if USE_COVERAGE
66   AM_CFLAGS = -fprofile-arcs -ftest-coverage
67 endif
68
69 lib_LTLIBRARIES = \
70   libgnunetnat.la \
71   libgnunetnatnew.la 
72
73 libgnunetnat_la_SOURCES = \
74   nat.c nat.h \
75   nat_auto.c \
76   nat_test.c \
77   nat_mini.c \
78   nat_stun.c
79 libgnunetnat_la_LIBADD = \
80   $(top_builddir)/src/util/libgnunetutil.la \
81   $(GN_LIBINTL) @EXT_LIBS@ 
82 libgnunetnat_la_LDFLAGS = \
83   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
84   -version-info 1:1:1
85
86 libgnunetnatnew_la_SOURCES = \
87   nat_api.c nat.h
88 libgnunetnatnew_la_LIBADD = \
89   $(top_builddir)/src/util/libgnunetutil.la \
90   $(GN_LIBINTL) @EXT_LIBS@ 
91 libgnunetnatnew_la_LDFLAGS = \
92   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
93   -version-info 2:0:0
94
95 gnunet_service_nat_SOURCES = \
96  gnunet-service-nat.c
97 gnunet_service_nat_LDADD = \
98   $(top_builddir)/src/util/libgnunetutil.la \
99   $(top_builddir)/src/statistics/libgnunetstatistics.la \
100   $(LIBGCRYPT_LIBS) \
101   -lgcrypt \
102   $(GN_LIBINTL)
103
104 check_PROGRAMS = \
105   test_nat \
106   test_nat_mini \
107   test_nat_test \
108   test_stun
109
110 if ENABLE_TEST_RUN
111  AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;
112  TESTS = $(check_PROGRAMS)
113 endif
114
115 test_nat_SOURCES = \
116   test_nat.c
117 test_nat_LDADD = \
118  libgnunetnat.la \
119  $(top_builddir)/src/util/libgnunetutil.la 
120
121 test_nat_mini_SOURCES = \
122   test_nat_mini.c
123 test_nat_mini_LDADD = \
124  libgnunetnat.la \
125  $(top_builddir)/src/util/libgnunetutil.la 
126
127 test_nat_test_SOURCES = \
128   test_nat_test.c
129 test_nat_test_LDADD = \
130  libgnunetnat.la \
131  $(top_builddir)/src/util/libgnunetutil.la 
132
133 test_stun_SOURCES = \
134   test_stun.c
135 test_stun_LDADD = \
136  libgnunetnat.la \
137  $(top_builddir)/src/util/libgnunetutil.la 
138
139 EXTRA_DIST = \
140  test_nat_data.conf \
141  test_nat_test_data.conf \
142  test_stun.conf