# This Makefile.am is in the public domain
AM_CPPFLAGS = -I$(top_srcdir)/src/include

plugindir = $(libdir)/gnunet

pkgcfgdir= $(pkgdatadir)/config.d/

libexecdir= $(pkglibdir)/libexec/

pkgcfg_DATA = \
  ats.conf

if USE_COVERAGE
  AM_CFLAGS = -fprofile-arcs -ftest-coverage
endif

lib_LTLIBRARIES = \
  libgnunetats.la

plugin_LTLIBRARIES = \
  libgnunet_plugin_ats_proportional.la

libgnunetats_la_SOURCES = \
  ats_api_connectivity.c \
  ats_api_scheduling.c \
  ats_api_scanner.c \
  ats_api_performance.c
libgnunetats_la_LIBADD = \
 $(top_builddir)/src/hello/libgnunethello.la \
 $(top_builddir)/src/util/libgnunetutil.la \
 $(LTLIBINTL)
libgnunetats_la_LDFLAGS = \
  $(GN_LIB_LDFLAGS)   \
  -version-info 4:0:0

libgnunet_plugin_ats_proportional_la_SOURCES = \
  plugin_ats_proportional.c
libgnunet_plugin_ats_proportional_la_LIBADD = \
  libgnunetats.la \
  $(top_builddir)/src/statistics/libgnunetstatistics.la \
  $(top_builddir)/src/util/libgnunetutil.la \
  $(top_builddir)/src/nt/libgnunetnt.la \
  $(LTLIBINTL)
libgnunet_plugin_ats_proportional_la_LDFLAGS = \
  $(GN_PLUGIN_LDFLAGS)


libexec_PROGRAMS = \
 gnunet-service-ats

gnunet_service_ats_SOURCES = \
 gnunet-service-ats.c gnunet-service-ats.h \
 gnunet-service-ats_addresses.c gnunet-service-ats_addresses.h \
 gnunet-service-ats_connectivity.c gnunet-service-ats_connectivity.h \
 gnunet-service-ats_normalization.c gnunet-service-ats_normalization.h \
 gnunet-service-ats_performance.c gnunet-service-ats_performance.h \
 gnunet-service-ats_plugins.c gnunet-service-ats_plugins.h \
 gnunet-service-ats_preferences.c gnunet-service-ats_preferences.h \
 gnunet-service-ats_scheduling.c gnunet-service-ats_scheduling.h \
 gnunet-service-ats_reservations.c gnunet-service-ats_reservations.h
gnunet_service_ats_LDADD = \
  $(top_builddir)/src/nt/libgnunetnt.la \
  $(top_builddir)/src/statistics/libgnunetstatistics.la \
  $(top_builddir)/src/util/libgnunetutil.la \
  libgnunetats.la \
  $(GN_LIBINTL)

TESTING_TESTS = \
 test_ats_api_proportional \
 test_ats_reservation_api_proportional

check_PROGRAMS = \
 $(TESTING_TESTS)

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_PROGRAMS)
endif

test_ats_api_proportional_SOURCES = \
 test_ats_api.c \
 test_ats_lib.c test_ats_lib.h
test_ats_api_proportional_LDADD = \
  $(top_builddir)/src/util/libgnunetutil.la \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/testing/libgnunettesting.la \
  libgnunetats.la

test_ats_reservation_api_proportional_SOURCES = \
 test_ats_reservation_api.c \
 test_ats_lib.c test_ats_lib.h
test_ats_reservation_api_proportional_LDADD = \
  $(top_builddir)/src/util/libgnunetutil.la \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/testing/libgnunettesting.la \
  libgnunetats.la

EXTRA_DIST = \
  ats.h \
  test_delay \
  test_ats_api.conf \
  test_ats_api_proportional.conf
