ftbfs
[oweals/gnunet.git] / src / peerinfo-tool / Makefile.am
index b9e6d7d076e1e7ca75090eb025b8cdd4981bba63..a5fd602465de1e90d791b08240cf0c43b15b70b4 100644 (file)
@@ -1,7 +1,8 @@
-INCLUDES = -I$(top_srcdir)/src/include
+# This Makefile.am is in the public domain
+AM_CPPFLAGS = -I$(top_srcdir)/src/include
 
 if MINGW
- WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols -lole32 -lshell32 -luuid -liconv -lstdc++ -lcomdlg32 -lgdi32
+ WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols -lole32 -lshell32 -liconv -lstdc++ -lcomdlg32 -lgdi32
 endif
 
 if USE_COVERAGE
@@ -9,16 +10,62 @@ if USE_COVERAGE
   XLIB = -lgcov
 endif
 
+if HAVE_MHD
+if HAVE_JSON
+REST_PLUGIN = libgnunet_plugin_rest_peerinfo.la
+endif
+endif
+
+plugindir = $(libdir)/gnunet
+
+plugin_LTLIBRARIES = $(REST_PLUGIN)
+
 bin_PROGRAMS = \
- gnunet-peerinfo 
+ gnunet-peerinfo
+
+libgnunet_plugin_rest_peerinfo_la_SOURCES = \
+  plugin_rest_peerinfo.c
+libgnunet_plugin_rest_peerinfo_la_LIBADD = \
+  $(top_builddir)/src/hello/libgnunethello.la \
+  $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
+  $(top_builddir)/src/transport/libgnunettransport.la \
+  $(top_builddir)/src/rest/libgnunetrest.la \
+  $(top_builddir)/src/json/libgnunetjson.la \
+  $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
+  $(LTLIBINTL) -ljansson -lmicrohttpd
+libgnunet_plugin_rest_peerinfo_la_LDFLAGS = \
+ $(GN_PLUGIN_LDFLAGS)
+
 
 gnunet_peerinfo_SOURCES = \
- gnunet-peerinfo.c         
+ gnunet-peerinfo.c \
+ gnunet-peerinfo_plugins.c gnunet-peerinfo_plugins.h
+
 gnunet_peerinfo_LDADD = \
   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
   $(top_builddir)/src/transport/libgnunettransport.la \
-  $(top_builddir)/src/util/libgnunetutil.la 
+  $(top_builddir)/src/hello/libgnunethello.la \
+  $(top_builddir)/src/statistics/libgnunetstatistics.la \
+  $(top_builddir)/src/util/libgnunetutil.la
+
+if HAVE_PYTHON
+check_SCRIPTS = \
+ test_gnunet_peerinfo.py
+endif
+
+if ENABLE_TEST_RUN
+AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
+TESTS = $(check_SCRIPTS)
+endif
+
+do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g'
+
+test_gnunet_peerinfo.py: test_gnunet_peerinfo.py.in Makefile
+       $(do_subst) < $(srcdir)/test_gnunet_peerinfo.py.in > test_gnunet_peerinfo.py
+       chmod +x test_gnunet_peerinfo.py
 
+EXTRA_DIST = \
+  test_gnunet_peerinfo.py.in \
+  test_gnunet_peerinfo_data.conf
 
-#check_SCRIPTS = \
-#  test_gnunet_peerinfo.sh
+CLEANFILES = $(check_SCRIPTS)