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