toxcore/testing/Makefile.inc
jin-eld 50c8a820e5 Implemented autotools based build scripts
supported options:

--with-dependency-search=DIR    will tell configure to look for various
dependencies in DIR/include and DIR/lib

Alternatively you can also specify libsodium header and libs location
with --with-libsodium-headers and --with-libsodium-libs if it is
installed elsewhere.

Ncurses and libconfig are handled via the default pkg-config way, see
./configure --help=short for detailed information.

The tox library is compiled as libtoxcore in shared and static variants,
public headers are installed to ${prefix}/include/tox

A pkg-config libtoxcore.pc configuration file is provided.

Use ./configure --help for a full list of configure options or
./configure --help=short for the options that I added.

To generate the configure script after pulling from git use:
autoreconf -i

To generate a release tarball use:
make dist

Unit tests are handled by the libcheck library integration that is provided
by autotools, use:
make check

to compile and run the tests.

Unit tests are currently optional, i.e. - if the check library is not
found on the system, then tests will be disabled. Same goes for nTox and
DHT bootstrap daemon - they will be enabled or disabled depending on the
availability of ncurses (for nTox) or libconfig (for DHT bootstrap
daemon).

The above can be also tuned by:
--enable-tests / --disable-tests
--enable-ntox / --disable-ntox
--enable-dht-bootstrap-daemon / --disable-dht-bootstrap-daemon
2013-08-24 03:25:07 +03:00

98 lines
3.2 KiB
Makefile

if BUILD_NTOX
bin_PROGRAMS += nTox
nTox_SOURCES = $(top_srcdir)/testing/misc_tools.h \
$(top_srcdir)/testing/misc_tools.c \
$(top_srcdir)/testing/nTox.h \
$(top_srcdir)/testing/nTox.c
nTox_CFLAGS = $(LIBSODIUM_CFLAGS) \
$(NCURSES_CFLAGS)
nTox_LDADD = $(LIBSODIUM_LDFLAGS) \
libtoxcore.la \
$(LIBSODIUM_LIBS) \
$(NCURSES_LIBS)
endif
noinst_PROGRAMS += DHT_test \
Lossless_UDP_testclient \
Lossless_UDP_testserver \
Messenger_test \
crypto_speed_test
DHT_test_SOURCES = $(top_srcdir)/testing/DHT_test.c \
$(top_srcdir)/testing/misc_tools.h \
$(top_srcdir)/testing/misc_tools.c
DHT_test_CFLAGS = $(LIBSODIUM_CFLAGS)
DHT_test_LDADD = $(LIBSODIUM_LDFLAGS) \
libtoxcore.la \
$(LIBSODIUM_LIBS) \
$(WINSOCK2_LIBS)
Lossless_UDP_testclient_SOURCES = \
$(top_srcdir)/testing/Lossless_UDP_testclient.c
Lossless_UDP_testclient_CFLAGS = \
$(LIBSODIUM_CFLAGS)
Lossless_UDP_testclient_LDADD = \
$(LIBSODIUM_LDFLAGS) \
libtoxcore.la \
$(LIBSODIUM_LIBS) \
$(WINSOCK2_LIBS)
Lossless_UDP_testserver_SOURCES = \
$(top_srcdir)/testing/Lossless_UDP_testserver.c
Lossless_UDP_testserver_CFLAGS = \
$(LIBSODIUM_CFLAGS)
Lossless_UDP_testserver_LDADD = \
$(LIBSODIUM_LDFLAGS) \
libtoxcore.la \
$(LIBSODIUM_LIBS) \
$(WINSOCK2_LIBS)
Messenger_test_SOURCES = \
$(top_srcdir)/testing/Messenger_test.c \
$(top_srcdir)/testing/misc_tools.h \
$(top_srcdir)/testing/misc_tools.c
Messenger_test_CFLAGS = $(LIBSODIUM_CFLAGS)
Messenger_test_LDADD = $(LIBSODIUM_LDFLAGS) \
libtoxcore.la \
$(LIBSODIUM_LIBS) \
$(WINSOCK2_LIBS)
crypto_speed_test_SOURCES = \
$(top_srcdir)/testing/crypto_speed_test.c
crypto_speed_test_CFLAGS = \
$(LIBSODIUM_CFLAGS)
crypto_speed_test_LDADD = \
$(LIBSODIUM_LDFLAGS) \
libtoxcore.la \
$(LIBSODIUM_LIBS) \
$(WINSOCK2_LIBS)
EXTRA_DIST += $(top_srcdir)/testing/cmake/Messenger_test.cmake \
$(top_srcdir)/testing/cmake/DHT_test.cmake \
$(top_srcdir)/testing/cmake/Lossless_UDP_testclient.cmake \
$(top_srcdir)/testing/cmake/Lossless_UDP_testserver.cmake \
$(top_srcdir)/testing/cmake/nTox.cmake \
$(top_srcdir)/testing/cmake/crypto_speed_test.cmake \
$(top_srcdir)/testing/CMakeLists.txt