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