(no commit message)
[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
11 if ENABLE_TEST_RUN
12  nattest = $(bindir)/gnunet-nat-server
13 endif
14
15
16 if LINUX
17 NATBIN = gnunet-helper-nat-server gnunet-helper-nat-client
18 NATSERVER = gnunet-helper-nat-server.c
19 NATCLIENT = gnunet-helper-nat-client.c
20 install-exec-hook:
21         chown root:root $(bindir)/gnunet-helper-nat-server $(bindir)/gnunet-helper-nat-client $(nattest) || true
22         chmod u+s $(bindir)/gnunet-helper-nat-server $(bindir)/gnunet-helper-nat-client $(nattest) || true
23 else
24 install-exec-hook:
25 endif
26
27 bin_PROGRAMS = \
28  gnunet-nat-server \
29  $(NATBIN) 
30
31 gnunet_nat_server_SOURCES = \
32  gnunet-nat-server.c nat.h
33 gnunet_nat_server_LDADD = \
34   $(top_builddir)/src/nat/libgnunetnat.la \
35   $(top_builddir)/src/util/libgnunetutil.la
36 gnunet_nat_server_DEPENDENCIES = \
37   libgnunetnat.la
38
39 gnunet_helper_nat_server_SOURCES = \
40  $(NATSERVER)
41
42 gnunet_helper_nat_client_SOURCES = \
43  $(NATCLIENT)         
44
45
46
47 if USE_COVERAGE
48   AM_CFLAGS = -fprofile-arcs -ftest-coverage
49 endif
50
51 lib_LTLIBRARIES = libgnunetnat.la
52
53 libgnunetnat_la_SOURCES = \
54   nat.c nat.h \
55   nat_test.c \
56   nat_mini.c
57
58 libgnunetnat_la_LIBADD = \
59   $(top_builddir)/src/util/libgnunetutil.la \
60   $(GN_LIBINTL) @EXT_LIBS@ 
61
62 libgnunetnat_la_LDFLAGS = \
63   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
64   -version-info 0:0:0           
65
66 check_PROGRAMS = \
67   test_nat \
68   test_nat_mini \
69   test_nat_test
70
71 if ENABLE_TEST_RUN
72  TESTS = $(check_PROGRAMS)
73 endif
74
75 test_nat_SOURCES = \
76   test_nat.c
77 test_nat_LDADD = \
78  $(top_builddir)/src/nat/libgnunetnat.la \
79  $(top_builddir)/src/util/libgnunetutil.la 
80
81 test_nat_mini_SOURCES = \
82   test_nat_mini.c
83 test_nat_mini_LDADD = \
84  $(top_builddir)/src/nat/libgnunetnat.la \
85  $(top_builddir)/src/util/libgnunetutil.la 
86
87
88 test_nat_test_SOURCES = \
89   test_nat_test.c
90 test_nat_test_LDADD = \
91  $(top_builddir)/src/nat/libgnunetnat.la \
92  $(top_builddir)/src/util/libgnunetutil.la 
93
94
95 EXTRA_DIST = \
96  test_nat_data.conf \
97  test_nat_test_data.conf