Merge branch 'master' of git+ssh://gnunet.org/gnunet
[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 \
88   nat_api_stun.c nat_stun.h \
89   nat_api_test.c \
90   nat.h
91 libgnunetnatnew_la_LIBADD = \
92   $(top_builddir)/src/util/libgnunetutil.la \
93   $(GN_LIBINTL) @EXT_LIBS@ 
94 libgnunetnatnew_la_LDFLAGS = \
95   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
96   -version-info 2:0:0
97
98 gnunet_service_nat_SOURCES = \
99  gnunet-service-nat.c \
100  gnunet-service-nat_stun.c gnunet-service-nat_stun.h \
101  gnunet-service-nat_helper.c gnunet-service-nat_helper.h
102 gnunet_service_nat_LDADD = \
103   $(top_builddir)/src/util/libgnunetutil.la \
104   $(top_builddir)/src/statistics/libgnunetstatistics.la \
105   $(LIBGCRYPT_LIBS) \
106   -lgcrypt \
107   $(GN_LIBINTL)
108
109 check_PROGRAMS = \
110   test_nat \
111   test_nat_mini \
112   test_nat_test \
113   test_stun
114
115 if ENABLE_TEST_RUN
116  AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;
117  TESTS = $(check_PROGRAMS)
118 endif
119
120 test_nat_SOURCES = \
121   test_nat.c
122 test_nat_LDADD = \
123  libgnunetnat.la \
124  $(top_builddir)/src/util/libgnunetutil.la 
125
126 test_nat_mini_SOURCES = \
127   test_nat_mini.c
128 test_nat_mini_LDADD = \
129  libgnunetnat.la \
130  $(top_builddir)/src/util/libgnunetutil.la 
131
132 test_nat_test_SOURCES = \
133   test_nat_test.c
134 test_nat_test_LDADD = \
135  libgnunetnat.la \
136  $(top_builddir)/src/util/libgnunetutil.la 
137
138 test_stun_SOURCES = \
139   test_stun.c
140 test_stun_LDADD = \
141  libgnunetnat.la \
142  $(top_builddir)/src/util/libgnunetutil.la 
143
144 EXTRA_DIST = \
145  test_nat_data.conf \
146  test_nat_test_data.conf \
147  test_stun.conf