indent
[oweals/gnunet.git] / src / nat / Makefile.am
index dc881a30216d491f3c29c6b24a7f7f9e9d39e716..7b738df4e8e19e824ffb45ff0cdc40c95f27e069 100644 (file)
@@ -1,11 +1,41 @@
-SUBDIRS = miniupnp libnatpmp
-
 INCLUDES = -I$(top_srcdir)/src/include
 
 if MINGW
   WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
+  NATBIN = gnunet-helper-nat-server gnunet-helper-nat-client
+  NATSERVER = gnunet-helper-nat-server-windows.c
+  NATCLIENT = gnunet-helper-nat-client-windows.c
+endif
+
+if LINUX
+NATBIN = gnunet-helper-nat-server gnunet-helper-nat-client
+NATSERVER = gnunet-helper-nat-server.c
+NATCLIENT = gnunet-helper-nat-client.c
+install-exec-hook:
+       chown root:root $(bindir)/gnunet-helper-nat-server $(bindir)/gnunet-helper-nat-client || true
+       chmod u+s $(bindir)/gnunet-helper-nat-server $(bindir)/gnunet-helper-nat-client || true
+else
+install-exec-hook:
 endif
 
+bin_PROGRAMS = \
+ gnunet-nat-server \
+ $(NATBIN) 
+
+gnunet_nat_server_SOURCES = \
+ gnunet-nat-server.c nat.h
+gnunet_nat_server_LDADD = \
+  $(top_builddir)/src/nat/libgnunetnat.la \
+  $(top_builddir)/src/util/libgnunetutil.la
+
+gnunet_helper_nat_server_SOURCES = \
+ $(NATSERVER)
+
+gnunet_helper_nat_client_SOURCES = \
+ $(NATCLIENT)         
+
+
+
 if USE_COVERAGE
   AM_CFLAGS = -fprofile-arcs -ftest-coverage
 endif
@@ -13,25 +43,22 @@ endif
 lib_LTLIBRARIES = libgnunetnat.la
 
 libgnunetnat_la_SOURCES = \
-  upnp.c upnp.h \
-  natpmp.c natpmp.h \
-  nat.c nat.h
-
-libgnunetnat_la_CFLAGS = \
- -I$(top_scrdir)/include
+  nat.c nat_test.c nat.h
 
 libgnunetnat_la_LIBADD = \
   $(top_builddir)/src/util/libgnunetutil.la \
-  $(GN_LIBINTL) @EXT_LIBS@
+  $(GN_LIBINTL) @EXT_LIBS@ 
 
 libgnunetnat_la_LDFLAGS = \
   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
-  -version-info 0:0:0
+  -version-info 0:0:0          
 
 check_PROGRAMS = \
   test-nat
 
-TESTS = $(check_PROGRAMS)
+if ENABLE_TEST_RUN
+ TESTS = $(check_PROGRAMS)
+endif
 
 test_nat_SOURCES = \
   test_nat.c
@@ -39,6 +66,7 @@ test_nat_SOURCES = \
 test_nat_LDADD = \
  $(top_builddir)/src/nat/libgnunetnat.la \
  $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/nat/miniupnp/libminiupnp.a \
- $(top_builddir)/src/nat/libnatpmp/libnatpmp.a
+ @LIBCURL@
 
+EXTRA_DIST = \
+ test_nat_data.conf