2016-10-25 05:46:08 +00:00
# Makefile.in for Serval DNA daemon and libraries
2017-12-15 06:40:56 +00:00
# nnnn
2014-05-28 08:10:47 +00:00
# vim: noet ts=8 sts=0 sw=8
2013-10-13 08:09:17 +00:00
prefix = @prefix@
2013-12-03 03:59:13 +00:00
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
2014-03-26 05:05:43 +00:00
sysconfdir = @sysconfdir@
localstatedir = @localstatedir@
2017-10-23 07:18:40 +00:00
srcdir = @srcdir@
2017-12-15 06:40:56 +00:00
abs_srcdir = @abs_srcdir@
abs_builddir = @abs_builddir@
2013-10-13 08:09:17 +00:00
2016-10-20 06:22:53 +00:00
CC = @CC@
AR = @AR@
RANLIB = @RANLIB@
JAVAC = @JAVAC@
2017-12-15 06:40:56 +00:00
SWIFTC = @SWIFTC@
SWIFTCFLAGS = @SWIFTCFLAGS@ -I$( abs_builddir) -I$( abs_srcdir)
2016-10-20 06:22:53 +00:00
SWIFTLIBS = @LIBS@
2017-12-15 06:40:56 +00:00
SWIFT_BUILD = @SWIFT_BUILD@
SWIFT_BUILD_FLAGS = $( addprefix -Xswiftc , $( SWIFTCFLAGS) )
2016-10-20 06:22:53 +00:00
SWIFT_MODULE_NAME = ServalDNA
2017-12-15 06:40:56 +00:00
SWIFT_PACKAGE_DIR = $( srcdir) /swift-daemon-api
SWIFT_BUILD_DIR = $( abs_builddir) /swift-daemon-api/build
2016-10-20 06:22:53 +00:00
INSTALL = install
INSTALL_PROGRAM = $( INSTALL)
INSTALL_DATA = $( INSTALL) -m 644
Add iOS Framework Bundle build
The new ios/configure script performs a separate ../configure for each of
the following iOS targets:
iPhoneOS on armv7
iPhoneOS on arm64
iPhoneSimulator on i386
iPhoneSimulator on x86_64
The script then creates ios/Makefile that builds a static iOS Framework
Bundle suitable for inclusion in an Xcode iOS project.
Add the --xcode-sdk=SDK option to configure.ac, to support cross
compiling using Apple Xcode. It prefixes all compile/link toolchain
commands with the "xcrun --sdk SDK" command, ie, CC, AS, LD, AR, RANLIB,
etc.
Re-structure headerfiles.mk to separate "public" from "private" headers,
because the Framework module only exposes the public ones. Moves the
SQLITE3_AMALGAMATION definition from Makefile.in into headerfiles.mk.
Update INSTALL.md and add a technical document for Apple iOS.
This enables development of Serval DNA within the context of an Xcode
iOS project using the standard edit-make-test cycle: after modifying a
Serval DNA source file, "cd ios; make" will recompile the changed file
for all the target architectures and update the Framework Bundle.
Rebuilding the Xcode project will then incorporate the changes, which
can be tested immediately.
2016-10-25 02:22:21 +00:00
i n c l u d e $( srcdir ) / h e a d e r f i l e s . m k # sets SQLITE3_AMALGAMATION
i n c l u d e $( srcdir ) / s o u r c e f i l e s . m k # depends on SQLITE3_AMALGAMATION
2012-03-14 22:54:31 +00:00
2017-10-23 07:18:40 +00:00
LIBSODIUM_SUBDIR = libsodium/
2017-09-12 06:08:21 +00:00
LIBSODIUM_DEV = libsodium-dev
LIBSODIUM_HEADERS = $( LIBSODIUM_DEV) /include/sodium.h
LIBSODIUM_A = $( LIBSODIUM_DEV) /lib/libsodium.a
LIBSODIUM_SO = $( LIBSODIUM_DEV) /lib/libsodium.so
2014-05-28 08:10:47 +00:00
OBJSDIR_SERVALD = objs_servald
OBJSDIR_LIB = objs_lib
OBJSDIR_TOOLS = objs
OBJSDIRS = $( OBJSDIR_SERVALD) $( OBJSDIR_LIB) $( OBJSDIR_TOOLS)
2014-05-23 08:19:00 +00:00
SERVAL_DAEMON_OBJS = \
2014-05-28 08:10:47 +00:00
$( addprefix $( OBJSDIR_SERVALD) /, $( SERVAL_CLIENT_SOURCES:.c= .o) ) \
$( addprefix $( OBJSDIR_SERVALD) /, $( MDP_CLIENT_SOURCES:.c= .o) ) \
Switch to feature-driven linking
This introduces a new way of linking Serval executables and dynamic
libraries from static libraries like libservald.a -- called
"feature-driven" linking.
The Makefile now links servald and serval-tests from libservald.a,
rather than from an explicit list of object (.o) files. Thanks to the
section-based method for registering functions such as HTTP handlers,
CLI commands and MDP handlers, these object files had become
"stand-alone" and hence were no longer included in the link because
there was no unresolved reference that required them to be linked in.
The new "feature.h" provides the DECLARE_FEATURE(name) macro that each
stand-alone source file uses to declare the named feature(s) it
provides. Each executable can call the USE_FEATURE(name) macro in any
of its explicitly-linked source files to cause the corresponding
object(s) to be included in the link, eg, servald_features.c.
The DEFINE_BINDING() macro has been extended so that every individual
MDP binding is given a feature name based on its port number macro, eg,
"mdp_binding_MDP_PORT_ECHO".
Some features have been factored into their own separate source files so
they can be omitted or included in a build independently of each other:
- the MDP bindings for MDP_PORT_DNALOOKUP, MDP_PORT_ECHO,
MDP_PORT_TRACE, MDP_PORT_KEYMAPREQUEST, MDP_PORT_RHIZOME_xxx,
MDP_PORT_PROBE, MDP_PORT_STUN, MDP_PORT_STUNREQ
- the CLI "log" and "echo" commands
- the CLI "rhizome direct" command
The JNI source files are only compiled if the <jni.h> header is present,
otherwise they are omitted from libservald.so.
2016-10-13 02:58:23 +00:00
$( addprefix $( OBJSDIR_SERVALD) /, $( SERVAL_DAEMON_SOURCES:.c= .o) )
2016-10-19 05:56:00 +00:00
2016-10-24 05:43:55 +00:00
i f e q ( @ H A V E _ J N I _ H @ , y e s )
2018-04-03 06:55:22 +00:00
SERVAL_DAEMON_JNI_OBJS = $( OBJSDIR_SERVALD) /servald_jni_features.o
2016-10-19 05:56:00 +00:00
2018-04-03 06:55:22 +00:00
SERVAL_DAEMON_OBJS += \
$( addprefix $( OBJSDIR_SERVALD) /, $( SERVAL_DAEMON_JNI_SOURCES:.c= .o) )
2016-10-24 05:43:55 +00:00
Switch to feature-driven linking
This introduces a new way of linking Serval executables and dynamic
libraries from static libraries like libservald.a -- called
"feature-driven" linking.
The Makefile now links servald and serval-tests from libservald.a,
rather than from an explicit list of object (.o) files. Thanks to the
section-based method for registering functions such as HTTP handlers,
CLI commands and MDP handlers, these object files had become
"stand-alone" and hence were no longer included in the link because
there was no unresolved reference that required them to be linked in.
The new "feature.h" provides the DECLARE_FEATURE(name) macro that each
stand-alone source file uses to declare the named feature(s) it
provides. Each executable can call the USE_FEATURE(name) macro in any
of its explicitly-linked source files to cause the corresponding
object(s) to be included in the link, eg, servald_features.c.
The DEFINE_BINDING() macro has been extended so that every individual
MDP binding is given a feature name based on its port number macro, eg,
"mdp_binding_MDP_PORT_ECHO".
Some features have been factored into their own separate source files so
they can be omitted or included in a build independently of each other:
- the MDP bindings for MDP_PORT_DNALOOKUP, MDP_PORT_ECHO,
MDP_PORT_TRACE, MDP_PORT_KEYMAPREQUEST, MDP_PORT_RHIZOME_xxx,
MDP_PORT_PROBE, MDP_PORT_STUN, MDP_PORT_STUNREQ
- the CLI "log" and "echo" commands
- the CLI "rhizome direct" command
The JNI source files are only compiled if the <jni.h> header is present,
otherwise they are omitted from libservald.so.
2016-10-13 02:58:23 +00:00
e n d i f
2016-10-19 05:56:00 +00:00
2016-09-19 02:51:57 +00:00
SQLITE3_OBJS = \
$( addprefix $( OBJSDIR_SERVALD) /, $( notdir $( SQLITE3_SOURCES:.c= .o) ) )
2016-10-19 05:56:00 +00:00
2014-05-23 08:19:00 +00:00
SERVALD_OBJS = \
2016-09-19 02:51:57 +00:00
$( SQLITE3_OBJS) \
2014-05-28 08:10:47 +00:00
$( SERVAL_DAEMON_OBJS)
2016-10-19 05:56:00 +00:00
2014-05-23 08:19:00 +00:00
LIB_SERVAL_OBJS = \
2014-05-28 08:10:47 +00:00
$( addprefix $( OBJSDIR_LIB) /, $( SERVAL_CLIENT_SOURCES:.c= .o) ) \
2016-10-17 07:10:28 +00:00
$( addprefix $( OBJSDIR_LIB) /, $( CLIENT_ONLY_SOURCES:.c= .o) ) \
2014-05-28 08:10:47 +00:00
$( addprefix $( OBJSDIR_LIB) /, $( MDP_CLIENT_SOURCES:.c= .o) )
2016-10-19 05:56:00 +00:00
2014-05-23 08:19:00 +00:00
MONITOR_CLIENT_OBJS = \
2014-05-28 08:10:47 +00:00
$( addprefix $( OBJSDIR_LIB) /, $( SERVAL_CLIENT_SOURCES:.c= .o) ) \
2016-10-17 07:10:28 +00:00
$( addprefix $( OBJSDIR_LIB) /, $( CLIENT_ONLY_SOURCES:.c= .o) ) \
2014-05-28 08:10:47 +00:00
$( addprefix $( OBJSDIR_LIB) /, $( MONITOR_CLIENT_SRCS:.c= .o) )
2016-10-19 05:56:00 +00:00
2014-05-23 08:19:00 +00:00
SIMULATOR_OBJS = \
2014-05-28 08:10:47 +00:00
$( addprefix $( OBJSDIR_TOOLS) /, $( SIMULATOR_SOURCES:.c= .o) )
Add iOS Framework Bundle build
The new ios/configure script performs a separate ../configure for each of
the following iOS targets:
iPhoneOS on armv7
iPhoneOS on arm64
iPhoneSimulator on i386
iPhoneSimulator on x86_64
The script then creates ios/Makefile that builds a static iOS Framework
Bundle suitable for inclusion in an Xcode iOS project.
Add the --xcode-sdk=SDK option to configure.ac, to support cross
compiling using Apple Xcode. It prefixes all compile/link toolchain
commands with the "xcrun --sdk SDK" command, ie, CC, AS, LD, AR, RANLIB,
etc.
Re-structure headerfiles.mk to separate "public" from "private" headers,
because the Framework module only exposes the public ones. Moves the
SQLITE3_AMALGAMATION definition from Makefile.in into headerfiles.mk.
Update INSTALL.md and add a technical document for Apple iOS.
This enables development of Serval DNA within the context of an Xcode
iOS project using the standard edit-make-test cycle: after modifying a
Serval DNA source file, "cd ios; make" will recompile the changed file
for all the target architectures and update the Framework Bundle.
Rebuilding the Xcode project will then incorporate the changes, which
can be tested immediately.
2016-10-25 02:22:21 +00:00
PREFIXED_HEADERS = $( addprefix $( srcdir) /, $( ALL_HDRS) )
2017-10-23 07:18:40 +00:00
PREFIXED_SOURCES = $( addprefix $( srcdir) /, $( ALL_SOURCES) )
2016-09-27 07:26:04 +00:00
2014-06-11 10:42:56 +00:00
LDFLAGS = @LDFLAGS@ @LIBS@
2012-03-14 22:54:31 +00:00
2017-10-23 07:18:40 +00:00
CFLAGS = -I. -I$( srcdir) /$( SQLITE3_AMALGAMATION) @CPPFLAGS@ @CFLAGS@
2014-06-30 00:44:12 +00:00
CFLAGS += -DSYSCONFDIR= " \" $( sysconfdir) \" " -DLOCALSTATEDIR= " \" $( localstatedir) \" "
2016-09-19 02:51:57 +00:00
CFLAGS += -DSQLITE_THREADSAFE= 0 \
-DSQLITE_OMIT_DATETIME_FUNCS \
-DSQLITE_OMIT_COMPILEOPTION_DIAGS \
-DSQLITE_OMIT_DEPRECATED \
-DSQLITE_OMIT_LOAD_EXTENSION \
-DSQLITE_OMIT_VIRTUALTABLE \
-DSQLITE_OMIT_AUTHORIZATION
2016-11-07 03:46:51 +00:00
CFLAGS += -fPIC -DSERVAL_ENABLE_DEBUG= 1 -Wall -Werror -Wextra -Wformat -Werror= format-security -D_FORTIFY_SOURCE= 2
2012-09-05 09:23:22 +00:00
# Solaris magic
CFLAGS += -DSHA2_USE_INTTYPES_H -D_XOPEN_SOURCE= 600 -D_XOPEN_SOURCE_EXTENDED= 1 -D__EXTENSIONS__= 1
2012-09-06 05:02:17 +00:00
# OSX magic to compensate for the Solaris magic
CFLAGS += -D_DARWIN_C_SOURCE
Add iOS Framework Bundle build
The new ios/configure script performs a separate ../configure for each of
the following iOS targets:
iPhoneOS on armv7
iPhoneOS on arm64
iPhoneSimulator on i386
iPhoneSimulator on x86_64
The script then creates ios/Makefile that builds a static iOS Framework
Bundle suitable for inclusion in an Xcode iOS project.
Add the --xcode-sdk=SDK option to configure.ac, to support cross
compiling using Apple Xcode. It prefixes all compile/link toolchain
commands with the "xcrun --sdk SDK" command, ie, CC, AS, LD, AR, RANLIB,
etc.
Re-structure headerfiles.mk to separate "public" from "private" headers,
because the Framework module only exposes the public ones. Moves the
SQLITE3_AMALGAMATION definition from Makefile.in into headerfiles.mk.
Update INSTALL.md and add a technical document for Apple iOS.
This enables development of Serval DNA within the context of an Xcode
iOS project using the standard edit-make-test cycle: after modifying a
Serval DNA source file, "cd ios; make" will recompile the changed file
for all the target architectures and update the Framework Bundle.
Rebuilding the Xcode project will then incorporate the changes, which
can be tested immediately.
2016-10-25 02:22:21 +00:00
CFLAGS_SQLITE = @CFLAGS_SQLITE@
2013-12-03 03:59:13 +00:00
2017-10-23 07:18:40 +00:00
- i n c l u d e $( srcdir ) / M a k e f i l e . d b g
2012-06-15 05:31:14 +00:00
2016-10-20 06:22:53 +00:00
# More warnings, discover problems that only happen on some archs
CFLAGS += -Wextra
# Security enhancements from Debian
CFLAGS += -Wformat -Werror= format-security -D_FORTIFY_SOURCE= 2
2016-10-25 02:23:17 +00:00
2016-10-20 06:22:53 +00:00
CONFIG_H = @CONFIG_H@
DEFS = @DEFS@
SWIFTDEFS = $( addprefix -Xcc , $( DEFS) )
2012-04-23 10:47:11 +00:00
2017-09-12 06:08:21 +00:00
# Usage: $(call MERGE_STATIC_LIBS, libdest.a, libsrcfoo.a libsrcbar.a)
MERGE_STATIC_LIBS = echo MERGE $( 1) = $( 2) ; \
tmp = " $$ (mktemp -d) " && \
( cd " $$ tmp " $( foreach LIB, $( 2) , && $( AR) -x $( abspath $( LIB) ) ) ) && \
2016-10-20 06:22:53 +00:00
$( RM) $( 1) && \
$( AR) -cr $( 1) " $$ tmp " /*.o && \
$( RANLIB) $( 1) && \
2017-09-12 06:08:21 +00:00
$( RM) -r " $$ tmp "
2016-09-27 07:26:04 +00:00
.PHONY : all libs test install uninstall clean
2016-10-20 06:22:53 +00:00
all : libs servald directory_service test
2013-08-19 07:29:10 +00:00
2016-10-20 06:22:53 +00:00
libs : libservaldaemon .so libservaldaemon .a \
2016-09-27 07:26:04 +00:00
libservalclient.so libservalclient.a \
libmonitorclient.so libmonitorclient.a
2013-08-19 04:05:58 +00:00
2016-10-20 06:22:53 +00:00
test : servaldwrap serval -tests \
fakeradio simulator \
tfw_createfile
2012-03-14 22:54:31 +00:00
2016-09-27 07:26:04 +00:00
install : servald
$( INSTALL_PROGRAM) -D servald $( DESTDIR) $( sbindir) /servald
uninstall :
$( RM) $( DESTDIR) $( sbindir) /servald
clean :
2017-09-12 06:08:21 +00:00
$( RM) -r $( LIBSODIUM_DEV) \
$( OBJSDIRS:%= %/*) \
servald \
libservaldaemon.so libservaldaemon.a \
libservalclient.so libservalclient.a \
libmonitorclient.so libmonitorclient.a \
tfw_createfile directory_service fakeradio simulator serval-tests \
tags
Add iOS Framework Bundle build
The new ios/configure script performs a separate ../configure for each of
the following iOS targets:
iPhoneOS on armv7
iPhoneOS on arm64
iPhoneSimulator on i386
iPhoneSimulator on x86_64
The script then creates ios/Makefile that builds a static iOS Framework
Bundle suitable for inclusion in an Xcode iOS project.
Add the --xcode-sdk=SDK option to configure.ac, to support cross
compiling using Apple Xcode. It prefixes all compile/link toolchain
commands with the "xcrun --sdk SDK" command, ie, CC, AS, LD, AR, RANLIB,
etc.
Re-structure headerfiles.mk to separate "public" from "private" headers,
because the Framework module only exposes the public ones. Moves the
SQLITE3_AMALGAMATION definition from Makefile.in into headerfiles.mk.
Update INSTALL.md and add a technical document for Apple iOS.
This enables development of Serval DNA within the context of an Xcode
iOS project using the standard edit-make-test cycle: after modifying a
Serval DNA source file, "cd ios; make" will recompile the changed file
for all the target architectures and update the Framework Bundle.
Rebuilding the Xcode project will then incorporate the changes, which
can be tested immediately.
2016-10-25 02:22:21 +00:00
cd $( LIBSODIUM_SUBDIR) && $( MAKE) clean
distclean : clean
$( RM) config.h config.status config.log testconfig.sh
cd $( LIBSODIUM_SUBDIR) && $( MAKE) distclean
2016-09-27 07:26:04 +00:00
2016-11-08 04:21:15 +00:00
# Only provide Java targets if the Java compiler is available.
i f n e q ( $( JAVAC ) , )
all : java -api
clean : java -api -clean
.PHONY : java -api java -api -clean
java-api :
@mkdir -p java-api
2017-10-23 07:18:40 +00:00
@cd java-api && $( MAKE) all
2016-11-08 04:21:15 +00:00
java-api-clean :
2017-10-23 07:18:40 +00:00
@cd java-api 2>/dev/null && $( MAKE) clean
2016-11-08 04:21:15 +00:00
e n d i f # $(JAVAC)
2016-10-25 05:46:08 +00:00
i f n e q ( $( SWIFTC ) , ) # Only provide Swift targets if the Swift compiler is available.
2017-12-15 06:40:56 +00:00
all : swift -daemon -api swift -client -api
2016-10-25 05:46:08 +00:00
test : servaldswift
2017-12-15 06:40:56 +00:00
clean : swift -daemon -api -clean swift -client -api -clean
2016-10-25 05:46:08 +00:00
2017-12-15 06:40:56 +00:00
.PHONY : swift -daemon -api swift -daemon -api -clean swift -client -api swift -client -api -clean
libServalDNA.a $(SWIFT_MODULE_NAME).swiftmodule $(SWIFT_MODULE_NAME).swiftdoc : swift -daemon -api
cp $( SWIFT_BUILD_DIR) /debug/$( notdir $@ ) $@
swift-daemon-api :
mkdir -p $( SWIFT_BUILD_DIR) && \
cd $( SWIFT_PACKAGE_DIR) && \
$( SWIFT_BUILD) --build-path $( SWIFT_BUILD_DIR) $( SWIFT_BUILD_FLAGS) $( SWIFTDEFS)
swift-daemon-api-clean :
$( RM) -r $( SWIFT_BUILD_DIR) \
$( SWIFT_MODULE_NAME) .swiftmodule \
$( SWIFT_MODULE_NAME) .swiftdoc
2016-10-25 05:46:08 +00:00
swift-client-api :
@mkdir -p swift-client-api
cd swift-client-api && $( MAKE) all
swift-client-api-clean :
cd swift-client-api 2>/dev/null && $( MAKE) clean
e n d i f # $(SWIFTC)
2017-09-12 06:08:21 +00:00
# Build the Sodium elliptic curve encryption library within its 'libsodium'
# subtree, and install its development files (headers and libraries) into our
# $(LIBSODIUM_DEV) subdirectory. Then use the contents of this subdirectory to
# provide system headers, eg <sodium.h>, and libraries, eg, libsodium.a, to
# compile and link Serval DNA. This completely avoids any dependency on the
# system's installed libsodium run-time and development packages.
CFLAGS += -isystem $( LIBSODIUM_DEV) /include
Add iOS Framework Bundle build
The new ios/configure script performs a separate ../configure for each of
the following iOS targets:
iPhoneOS on armv7
iPhoneOS on arm64
iPhoneSimulator on i386
iPhoneSimulator on x86_64
The script then creates ios/Makefile that builds a static iOS Framework
Bundle suitable for inclusion in an Xcode iOS project.
Add the --xcode-sdk=SDK option to configure.ac, to support cross
compiling using Apple Xcode. It prefixes all compile/link toolchain
commands with the "xcrun --sdk SDK" command, ie, CC, AS, LD, AR, RANLIB,
etc.
Re-structure headerfiles.mk to separate "public" from "private" headers,
because the Framework module only exposes the public ones. Moves the
SQLITE3_AMALGAMATION definition from Makefile.in into headerfiles.mk.
Update INSTALL.md and add a technical document for Apple iOS.
This enables development of Serval DNA within the context of an Xcode
iOS project using the standard edit-make-test cycle: after modifying a
Serval DNA source file, "cd ios; make" will recompile the changed file
for all the target architectures and update the Framework Bundle.
Rebuilding the Xcode project will then incorporate the changes, which
can be tested immediately.
2016-10-25 02:22:21 +00:00
.PHONY : libsodium -dev
libsodium-dev $(LIBSODIUM_HEADERS) $(LIBSODIUM_A) : $( LIBSODIUM_DEV ) /.installed
2017-09-12 06:08:21 +00:00
# The libsodium package uses libtool, so by default its static libraries get
# compiled without the -fPIC option. This prevents the libsodium static
# library from being linked into a shared library. However, this Makefile
# needs to do exactly that, to make libservaldaemon.so, so passes the
# -prefer-pic libtool option, which causes libtool to use -fPIC even when
# compiling for static libraries.
$(LIBSODIUM_DEV)/.installed :
@echo MAKE $( LIBSODIUM_DEV)
@mkdir -p $( LIBSODIUM_DEV)
@$( RM) $@
@touch $@ .in-progress
2016-10-25 05:46:08 +00:00
@cd $( LIBSODIUM_SUBDIR) && $( MAKE) \
Add iOS Framework Bundle build
The new ios/configure script performs a separate ../configure for each of
the following iOS targets:
iPhoneOS on armv7
iPhoneOS on arm64
iPhoneSimulator on i386
iPhoneSimulator on x86_64
The script then creates ios/Makefile that builds a static iOS Framework
Bundle suitable for inclusion in an Xcode iOS project.
Add the --xcode-sdk=SDK option to configure.ac, to support cross
compiling using Apple Xcode. It prefixes all compile/link toolchain
commands with the "xcrun --sdk SDK" command, ie, CC, AS, LD, AR, RANLIB,
etc.
Re-structure headerfiles.mk to separate "public" from "private" headers,
because the Framework module only exposes the public ones. Moves the
SQLITE3_AMALGAMATION definition from Makefile.in into headerfiles.mk.
Update INSTALL.md and add a technical document for Apple iOS.
This enables development of Serval DNA within the context of an Xcode
iOS project using the standard edit-make-test cycle: after modifying a
Serval DNA source file, "cd ios; make" will recompile the changed file
for all the target architectures and update the Framework Bundle.
Rebuilding the Xcode project will then incorporate the changes, which
can be tested immediately.
2016-10-25 02:22:21 +00:00
CFLAGS += "-prefer-pic" \
2018-04-18 07:14:19 +00:00
exec_prefix = $( abspath $( LIBSODIUM_DEV) ) \
2016-10-25 05:46:08 +00:00
prefix = $( abspath $( LIBSODIUM_DEV) ) \
install
2017-09-12 06:08:21 +00:00
@mv -f $@ .in-progress $@
2016-09-27 07:26:04 +00:00
# Source code test coverage support -- see doc/Testing.md
.PHONY : covzero covinit covhtml is_built_with_coverage has_coverage_data
2014-05-28 08:10:47 +00:00
covzero : | is_built_with_coverage
@echo REMOVE all .gcda files
@find $( OBJSDIRS) -type f -name '*.gcda' -print0 | xargs -0 $( RM)
covinit : servald -initial .info
covhtml : coverage_html /index .html
is_built_with_coverage :
@for obj in $( SERVALD_OBJS) ; do \
gcno = " $$ {obj%.o}.gcno " ; \
if [ ! -r " $$ gcno " ] ; then \
echo " ERROR: servald has not been compiled for code coverage; missing $$ gcno " ; \
exit 1 ; \
fi ; \
done
has_coverage_data : | is_built_with_coverage
@count= 0; for obj in $( SERVALD_OBJS) ; do \
gcda = " $$ {obj%.o}.gcda " ; \
[ -s " $$ gcda " ] && count = $$ ( ( $$ count + 1) ) ; \
done ; \
if [ $$ count -eq 0 ] ; then \
echo "ERROR: no code coverage data; run some tests" ; \
exit 1 ; \
fi
2016-10-25 02:23:17 +00:00
servald-initial.info : Makefile servald | is_built_with_coverage
2014-05-28 08:10:47 +00:00
geninfo --quiet --initial --checksum --base-directory= $( abspath .) --no-external $( OBJSDIR_SERVALD) -o $@
2016-10-25 02:23:17 +00:00
servald-coverage.info : Makefile servald $( shell find $ ( OBJSDIR_SERVALD ) -type f -name '*.gcda ' 2>/dev /null ) | has_coverage_data
2014-05-28 08:10:47 +00:00
geninfo --quiet --checksum --base-directory= $( abspath .) --no-external $( OBJSDIR_SERVALD) -o $@ 2>& 1 | { grep -v 'WARNING: no data found for .*\.h$$' || true; }
@[ -s $@ ]
2016-10-25 02:23:17 +00:00
coverage_html/index.html : Makefile servald -initial .info servald -coverage .info
2014-05-28 08:10:47 +00:00
$( RM) -r coverage_html
genhtml --quiet servald-initial.info servald-coverage.info -o coverage_html
2016-09-27 07:26:04 +00:00
# Autconf support -- helpful messages to help avoid some common build mistakes.
2017-10-23 07:18:40 +00:00
.PRECIOUS : Makefile config .status $( srcdir ) /configure
2016-09-27 07:26:04 +00:00
2017-10-23 07:18:40 +00:00
Makefile : $( srcdir ) /Makefile .in config .status
2014-11-30 23:49:09 +00:00
$( warning Makefile may be out of date, please run ./config.status)
2012-04-20 07:40:38 +00:00
2017-10-23 07:18:40 +00:00
config.status : $( srcdir ) /configure
2017-11-10 01:01:25 +00:00
$( warning config.status may be out of date, please run $( srcdir) /configure)
2014-11-30 23:49:09 +00:00
2017-10-23 07:18:40 +00:00
$(srcdir)/configure : $( srcdir ) /configure .ac
$( warning $( srcdir) configure may be out of date, please run $( if $( srcdir:.= ) ,cd $( srcdir) && ,) autoreconf -f -i -I m4)
2014-05-23 08:19:00 +00:00
2016-09-27 07:26:04 +00:00
# Embed Serval DNA's version into libraries and executables.
2017-09-12 06:08:21 +00:00
$(OBJSDIR_TOOLS)/version.o : $( PREFIXED_SOURCES ) \
2016-09-27 07:26:04 +00:00
$( PREFIXED_HEADERS) \
2017-10-23 07:18:40 +00:00
$( srcdir) /version_servald.c \
$( srcdir) /version_string.sh \
2016-09-27 07:26:04 +00:00
$( wildcard VERSION.txt) \
2017-10-23 07:18:40 +00:00
$( srcdir) /COPYRIGHT.txt
2013-08-19 04:05:58 +00:00
@echo CC version_servald.c
2014-07-02 00:39:13 +00:00
@mkdir -p $( dir $@ )
2014-05-28 08:10:47 +00:00
@$( RM) $( @:.o= .gcno) $( @:.o= .gcda)
2017-10-23 07:18:40 +00:00
@V= ` $( srcdir) /version_string.sh --repository= $( srcdir) --ignore-untracked` \
&& C = " `sed -e :a -e N -e ' $$ !ba' -e 's/[\\\\ " ] /\\ \\ & /g' -e ' s/\\ n/\\ \\ n/g' $( srcdir) /COPYRIGHT.txt` " \
&& $( CC) $( CFLAGS) $( DEFS) -c $( srcdir) /version_servald.c -o $@ -DSERVALD_VERSION= " \" $$ V\" " -DSERVALD_COPYRIGHT= " \" $$ C\" "
2013-08-19 04:05:58 +00:00
2014-05-23 08:19:00 +00:00
#' <-- fixes vim syntax highlighting
2014-05-09 05:57:23 +00:00
2016-02-01 03:12:38 +00:00
# Compile SQLITE as a special case, because it is imported source code.
# Instead of fixing warnings case-by-case in the sqlite.c source code, simply
# suppress the classes of warnings that cause compilation errors with
# -Werror.
2017-10-23 07:18:40 +00:00
$(SQLITE3_OBJS) : $( OBJSDIR_SERVALD ) /%.o : $( srcdir ) /$( SQLITE 3_AMALGAMATION ) /%.c
2014-05-23 08:19:00 +00:00
@echo SERVALD CC $<
@mkdir -p $( dir $@ )
2014-05-28 08:10:47 +00:00
@$( RM) $( @:.o= .gcno) $( @:.o= .gcda)
2016-09-19 02:51:57 +00:00
@$( CC) $( CFLAGS) $( CFLAGS_SQLITE) $( DEFS) -c $< -o $@
2014-05-23 08:19:00 +00:00
# No object files in source directory!
2017-10-23 07:18:40 +00:00
%.o : $( srcdir ) /%.c
2014-05-09 05:57:23 +00:00
2017-10-23 07:18:40 +00:00
$(OBJSDIR_TOOLS)/%.o : $( srcdir ) /%.c
2012-05-10 03:53:06 +00:00
@echo CC $<
2014-05-23 08:19:00 +00:00
@mkdir -p $( dir $@ )
2014-05-29 01:34:09 +00:00
@$( RM) $( @:.o= .gcno) $( @:.o= .gcda)
2014-05-23 08:19:00 +00:00
@$( CC) $( CFLAGS) $( DEFS) -c $< -o $@
2017-10-23 07:18:40 +00:00
$(OBJSDIR_SERVALD)/%.o : $( srcdir ) /%.c
2014-05-23 08:19:00 +00:00
@echo SERVALD CC $<
@mkdir -p $( dir $@ )
2014-05-29 01:34:09 +00:00
@$( RM) $( @:.o= .gcno) $( @:.o= .gcda)
2014-05-23 08:19:00 +00:00
@$( CC) $( CFLAGS) $( DEFS) -c $< -o $@
2017-10-23 07:18:40 +00:00
$(OBJSDIR_LIB)/%.o : $( srcdir ) /%.c
2014-05-23 08:19:00 +00:00
@echo LIB CC $<
@mkdir -p $( dir $@ )
2014-05-29 01:34:09 +00:00
@$( RM) $( @:.o= .gcno) $( @:.o= .gcda)
2012-10-18 06:40:45 +00:00
@$( CC) $( CFLAGS) $( DEFS) -c $< -o $@
2012-03-14 22:54:31 +00:00
2016-09-27 07:26:04 +00:00
# Dependencies on header files. The following list of dependencies is too
# broad so it sometimes results in unnecessary re-compilation, but that is
# better than too narrow, which can result in missed re-compilation.
2017-09-12 06:08:21 +00:00
$(SERVAL_DAEMON_OBJS) : Makefile $( CONFIG_H ) $( PREFIXED_HEADERS ) $( LIBSODIUM_HEADERS )
$(SERVALD_OBJS) : Makefile $( LIBSODIUM_HEADERS )
$(LIB_SERVAL_OBJS) : Makefile $( CONFIG_H ) $( PREFIXED_HEADERS ) $( LIBSODIUM_HEADERS )
2017-10-23 07:18:40 +00:00
$(OBJSDIR_TOOLS)/tfw_createfile.o : Makefile $( srcdir ) /str .h
2017-09-12 06:08:21 +00:00
$(OBJSDIR_TOOLS)/directory_service.o : Makefile $( CONFIG_H ) $( PREFIXED_HEADERS ) $( LIBSODIUM_HEADERS )
$(MONITOR_CLIENT_OBJS) : Makefile $( CONFIG_H ) $( PREFIXED_HEADERS ) $( LIBSODIUM_HEADERS )
$(SIMULATOR_OBJS) : Makefile $( CONFIG_H ) $( PREFIXED_HEADERS ) $( LIBSODIUM_HEADERS )
2016-09-27 07:26:04 +00:00
# Rules for main targets.
2012-11-22 07:48:00 +00:00
2017-09-12 06:08:21 +00:00
.INTERMEDIATE : _servald .a
_servald.a : $( SERVALD_OBJS ) $( OBJSDIR_TOOLS ) /version .o
Switch to feature-driven linking
This introduces a new way of linking Serval executables and dynamic
libraries from static libraries like libservald.a -- called
"feature-driven" linking.
The Makefile now links servald and serval-tests from libservald.a,
rather than from an explicit list of object (.o) files. Thanks to the
section-based method for registering functions such as HTTP handlers,
CLI commands and MDP handlers, these object files had become
"stand-alone" and hence were no longer included in the link because
there was no unresolved reference that required them to be linked in.
The new "feature.h" provides the DECLARE_FEATURE(name) macro that each
stand-alone source file uses to declare the named feature(s) it
provides. Each executable can call the USE_FEATURE(name) macro in any
of its explicitly-linked source files to cause the corresponding
object(s) to be included in the link, eg, servald_features.c.
The DEFINE_BINDING() macro has been extended so that every individual
MDP binding is given a feature name based on its port number macro, eg,
"mdp_binding_MDP_PORT_ECHO".
Some features have been factored into their own separate source files so
they can be omitted or included in a build independently of each other:
- the MDP bindings for MDP_PORT_DNALOOKUP, MDP_PORT_ECHO,
MDP_PORT_TRACE, MDP_PORT_KEYMAPREQUEST, MDP_PORT_RHIZOME_xxx,
MDP_PORT_PROBE, MDP_PORT_STUN, MDP_PORT_STUNREQ
- the CLI "log" and "echo" commands
- the CLI "rhizome direct" command
The JNI source files are only compiled if the <jni.h> header is present,
otherwise they are omitted from libservald.so.
2016-10-13 02:58:23 +00:00
@echo AR $@
2017-09-12 06:08:21 +00:00
@$( RM) $@
Switch to feature-driven linking
This introduces a new way of linking Serval executables and dynamic
libraries from static libraries like libservald.a -- called
"feature-driven" linking.
The Makefile now links servald and serval-tests from libservald.a,
rather than from an explicit list of object (.o) files. Thanks to the
section-based method for registering functions such as HTTP handlers,
CLI commands and MDP handlers, these object files had become
"stand-alone" and hence were no longer included in the link because
there was no unresolved reference that required them to be linked in.
The new "feature.h" provides the DECLARE_FEATURE(name) macro that each
stand-alone source file uses to declare the named feature(s) it
provides. Each executable can call the USE_FEATURE(name) macro in any
of its explicitly-linked source files to cause the corresponding
object(s) to be included in the link, eg, servald_features.c.
The DEFINE_BINDING() macro has been extended so that every individual
MDP binding is given a feature name based on its port number macro, eg,
"mdp_binding_MDP_PORT_ECHO".
Some features have been factored into their own separate source files so
they can be omitted or included in a build independently of each other:
- the MDP bindings for MDP_PORT_DNALOOKUP, MDP_PORT_ECHO,
MDP_PORT_TRACE, MDP_PORT_KEYMAPREQUEST, MDP_PORT_RHIZOME_xxx,
MDP_PORT_PROBE, MDP_PORT_STUN, MDP_PORT_STUNREQ
- the CLI "log" and "echo" commands
- the CLI "rhizome direct" command
The JNI source files are only compiled if the <jni.h> header is present,
otherwise they are omitted from libservald.so.
2016-10-13 02:58:23 +00:00
@$( AR) -cr $@ $^
2017-09-12 06:08:21 +00:00
libservaldaemon.a : _servald .a $( LIBSODIUM_A )
@$( call MERGE_STATIC_LIBS, $@ , $^)
2016-10-20 02:49:26 +00:00
libservaldaemon.so : \
Switch to feature-driven linking
This introduces a new way of linking Serval executables and dynamic
libraries from static libraries like libservald.a -- called
"feature-driven" linking.
The Makefile now links servald and serval-tests from libservald.a,
rather than from an explicit list of object (.o) files. Thanks to the
section-based method for registering functions such as HTTP handlers,
CLI commands and MDP handlers, these object files had become
"stand-alone" and hence were no longer included in the link because
there was no unresolved reference that required them to be linked in.
The new "feature.h" provides the DECLARE_FEATURE(name) macro that each
stand-alone source file uses to declare the named feature(s) it
provides. Each executable can call the USE_FEATURE(name) macro in any
of its explicitly-linked source files to cause the corresponding
object(s) to be included in the link, eg, servald_features.c.
The DEFINE_BINDING() macro has been extended so that every individual
MDP binding is given a feature name based on its port number macro, eg,
"mdp_binding_MDP_PORT_ECHO".
Some features have been factored into their own separate source files so
they can be omitted or included in a build independently of each other:
- the MDP bindings for MDP_PORT_DNALOOKUP, MDP_PORT_ECHO,
MDP_PORT_TRACE, MDP_PORT_KEYMAPREQUEST, MDP_PORT_RHIZOME_xxx,
MDP_PORT_PROBE, MDP_PORT_STUN, MDP_PORT_STUNREQ
- the CLI "log" and "echo" commands
- the CLI "rhizome direct" command
The JNI source files are only compiled if the <jni.h> header is present,
otherwise they are omitted from libservald.so.
2016-10-13 02:58:23 +00:00
$( OBJSDIR_SERVALD) /servald_features.o \
Rewrite logging system
Rename the logging primitive functions and utility functions, prefixing
all with 'serval_log', eg: logMessage() -> serval_logf() etc.
Add an XPRINTF xhexdump() function and use it to implement the
serval_log_hexdump() utility, renamed from dump(). Add macros
WHY_dump(), WARN_dump(), HINT_dump() and DEBUG_dump(), and use them
everywhere.
Remove the 'log.console.dump_config' and 'log.file.dump_config'
configuration options; configuration is now dumped in every log prolog.
The logging system now constructs the log prolog by invoking the new
'log_prolog' trigger, so that it no longer depends on the version string
and configuration system. Any system that wants to present a message in
the log prolog can define its own trigger, which calls standard log
primitives to print the message.
Split the logging system into a front-end (log.c) that provides the
logging primitives and is independent of the configuration system, and a
set of back-end "outputters" (log_output_console.c, log_output_file.c,
log_output_android.c) that may depend on the configuration system and
are decoupled from the front-end using the 'logoutput' link section.
These log outputters are explicitly linked into executables by the
Makefile rules, but could also be linked in using USE_FEATURE(). The
USE_FEATURE() calls have _not_ been added to servald_features.c, so that
different daemon executables can be built with the same feature set but
different log outputs.
2017-11-29 13:34:54 +00:00
$( OBJSDIR_SERVALD) /log_output_console.o \
2016-10-19 05:56:00 +00:00
$( SERVAL_DAEMON_JNI_OBJS) \
2017-09-12 06:08:21 +00:00
_servald.a \
$( LIBSODIUM_A)
2012-05-10 03:53:06 +00:00
@echo LINK $@
2017-09-12 06:08:21 +00:00
@$( CC) -Wall -shared -o $@ $( LDFLAGS) $( filter %.o, $^) $( filter %.a, $^)
Switch to feature-driven linking
This introduces a new way of linking Serval executables and dynamic
libraries from static libraries like libservald.a -- called
"feature-driven" linking.
The Makefile now links servald and serval-tests from libservald.a,
rather than from an explicit list of object (.o) files. Thanks to the
section-based method for registering functions such as HTTP handlers,
CLI commands and MDP handlers, these object files had become
"stand-alone" and hence were no longer included in the link because
there was no unresolved reference that required them to be linked in.
The new "feature.h" provides the DECLARE_FEATURE(name) macro that each
stand-alone source file uses to declare the named feature(s) it
provides. Each executable can call the USE_FEATURE(name) macro in any
of its explicitly-linked source files to cause the corresponding
object(s) to be included in the link, eg, servald_features.c.
The DEFINE_BINDING() macro has been extended so that every individual
MDP binding is given a feature name based on its port number macro, eg,
"mdp_binding_MDP_PORT_ECHO".
Some features have been factored into their own separate source files so
they can be omitted or included in a build independently of each other:
- the MDP bindings for MDP_PORT_DNALOOKUP, MDP_PORT_ECHO,
MDP_PORT_TRACE, MDP_PORT_KEYMAPREQUEST, MDP_PORT_RHIZOME_xxx,
MDP_PORT_PROBE, MDP_PORT_STUN, MDP_PORT_STUNREQ
- the CLI "log" and "echo" commands
- the CLI "rhizome direct" command
The JNI source files are only compiled if the <jni.h> header is present,
otherwise they are omitted from libservald.so.
2016-10-13 02:58:23 +00:00
Rewrite logging system
Rename the logging primitive functions and utility functions, prefixing
all with 'serval_log', eg: logMessage() -> serval_logf() etc.
Add an XPRINTF xhexdump() function and use it to implement the
serval_log_hexdump() utility, renamed from dump(). Add macros
WHY_dump(), WARN_dump(), HINT_dump() and DEBUG_dump(), and use them
everywhere.
Remove the 'log.console.dump_config' and 'log.file.dump_config'
configuration options; configuration is now dumped in every log prolog.
The logging system now constructs the log prolog by invoking the new
'log_prolog' trigger, so that it no longer depends on the version string
and configuration system. Any system that wants to present a message in
the log prolog can define its own trigger, which calls standard log
primitives to print the message.
Split the logging system into a front-end (log.c) that provides the
logging primitives and is independent of the configuration system, and a
set of back-end "outputters" (log_output_console.c, log_output_file.c,
log_output_android.c) that may depend on the configuration system and
are decoupled from the front-end using the 'logoutput' link section.
These log outputters are explicitly linked into executables by the
Makefile rules, but could also be linked in using USE_FEATURE(). The
USE_FEATURE() calls have _not_ been added to servald_features.c, so that
different daemon executables can be built with the same feature set but
different log outputs.
2017-11-29 13:34:54 +00:00
# The daemon executable. There is no main.o mentioned in this link line, so
# the link brings it in from libservaldaemon.a in order to resolve the 'main'
# symbol. The servald_features.o object causes all the other .o object files
# to be pulled into the link.
servald : $( OBJSDIR_SERVALD ) /servald_features .o \
$( OBJSDIR_SERVALD) /log_output_console.o \
libservaldaemon.a
Switch to feature-driven linking
This introduces a new way of linking Serval executables and dynamic
libraries from static libraries like libservald.a -- called
"feature-driven" linking.
The Makefile now links servald and serval-tests from libservald.a,
rather than from an explicit list of object (.o) files. Thanks to the
section-based method for registering functions such as HTTP handlers,
CLI commands and MDP handlers, these object files had become
"stand-alone" and hence were no longer included in the link because
there was no unresolved reference that required them to be linked in.
The new "feature.h" provides the DECLARE_FEATURE(name) macro that each
stand-alone source file uses to declare the named feature(s) it
provides. Each executable can call the USE_FEATURE(name) macro in any
of its explicitly-linked source files to cause the corresponding
object(s) to be included in the link, eg, servald_features.c.
The DEFINE_BINDING() macro has been extended so that every individual
MDP binding is given a feature name based on its port number macro, eg,
"mdp_binding_MDP_PORT_ECHO".
Some features have been factored into their own separate source files so
they can be omitted or included in a build independently of each other:
- the MDP bindings for MDP_PORT_DNALOOKUP, MDP_PORT_ECHO,
MDP_PORT_TRACE, MDP_PORT_KEYMAPREQUEST, MDP_PORT_RHIZOME_xxx,
MDP_PORT_PROBE, MDP_PORT_STUN, MDP_PORT_STUNREQ
- the CLI "log" and "echo" commands
- the CLI "rhizome direct" command
The JNI source files are only compiled if the <jni.h> header is present,
otherwise they are omitted from libservald.so.
2016-10-13 02:58:23 +00:00
@echo LINK $@
@$( CC) -Wall -o $@ $^ $( LDFLAGS)
2014-05-23 08:19:00 +00:00
2016-10-20 06:22:53 +00:00
i f n e q ( $( SWIFTC ) , ) # Only provide Swift targets if the Swift compiler is available.
# A servald equivalent whose main entry point and logging output is implemented
# in the Swift language, rather than the C entry point in main.c. This exists
# mainly to ensure that the Serval daemon library can be linked into a Swift
# program and executed. This linkage support is needed by the iOS framework
# package.
servaldswift : $( srcdir ) /servaldswift .swift \
$( OBJSDIR_SERVALD) /servald_features.o \
2017-12-15 06:40:56 +00:00
$( SWIFT_MODULE_NAME) .swiftmodule \
2018-04-04 02:48:06 +00:00
libServalDNA.a \
libservaldaemon.a
2016-10-20 06:22:53 +00:00
@echo SWIFT $@
2017-12-15 06:40:56 +00:00
@$( SWIFTC) -emit-executable -o $@ \
$( SWIFTCFLAGS) $( SWIFTDEFS) \
$( filter %.swift, $^) $( filter %.o, $^) $( filter %.a, $^) \
$( SWIFTLIBS)
2016-10-20 06:22:53 +00:00
e n d i f # $(SWIFTC)
Rewrite logging system
Rename the logging primitive functions and utility functions, prefixing
all with 'serval_log', eg: logMessage() -> serval_logf() etc.
Add an XPRINTF xhexdump() function and use it to implement the
serval_log_hexdump() utility, renamed from dump(). Add macros
WHY_dump(), WARN_dump(), HINT_dump() and DEBUG_dump(), and use them
everywhere.
Remove the 'log.console.dump_config' and 'log.file.dump_config'
configuration options; configuration is now dumped in every log prolog.
The logging system now constructs the log prolog by invoking the new
'log_prolog' trigger, so that it no longer depends on the version string
and configuration system. Any system that wants to present a message in
the log prolog can define its own trigger, which calls standard log
primitives to print the message.
Split the logging system into a front-end (log.c) that provides the
logging primitives and is independent of the configuration system, and a
set of back-end "outputters" (log_output_console.c, log_output_file.c,
log_output_android.c) that may depend on the configuration system and
are decoupled from the front-end using the 'logoutput' link section.
These log outputters are explicitly linked into executables by the
Makefile rules, but could also be linked in using USE_FEATURE(). The
USE_FEATURE() calls have _not_ been added to servald_features.c, so that
different daemon executables can be built with the same feature set but
different log outputs.
2017-11-29 13:34:54 +00:00
servaldwrap : $( OBJSDIR_SERVALD ) /servalwrap .o
2016-09-27 07:26:04 +00:00
@echo LINK $@
@$( CC) -Wall -o $@ $^ $( LDFLAGS)
2017-10-20 06:35:14 +00:00
serval-tests : $( OBJSDIR_SERVALD ) /test_features .o \
libservaldaemon.a
2014-12-01 02:18:46 +00:00
@echo LINK $@
Switch to feature-driven linking
This introduces a new way of linking Serval executables and dynamic
libraries from static libraries like libservald.a -- called
"feature-driven" linking.
The Makefile now links servald and serval-tests from libservald.a,
rather than from an explicit list of object (.o) files. Thanks to the
section-based method for registering functions such as HTTP handlers,
CLI commands and MDP handlers, these object files had become
"stand-alone" and hence were no longer included in the link because
there was no unresolved reference that required them to be linked in.
The new "feature.h" provides the DECLARE_FEATURE(name) macro that each
stand-alone source file uses to declare the named feature(s) it
provides. Each executable can call the USE_FEATURE(name) macro in any
of its explicitly-linked source files to cause the corresponding
object(s) to be included in the link, eg, servald_features.c.
The DEFINE_BINDING() macro has been extended so that every individual
MDP binding is given a feature name based on its port number macro, eg,
"mdp_binding_MDP_PORT_ECHO".
Some features have been factored into their own separate source files so
they can be omitted or included in a build independently of each other:
- the MDP bindings for MDP_PORT_DNALOOKUP, MDP_PORT_ECHO,
MDP_PORT_TRACE, MDP_PORT_KEYMAPREQUEST, MDP_PORT_RHIZOME_xxx,
MDP_PORT_PROBE, MDP_PORT_STUN, MDP_PORT_STUNREQ
- the CLI "log" and "echo" commands
- the CLI "rhizome direct" command
The JNI source files are only compiled if the <jni.h> header is present,
otherwise they are omitted from libservald.so.
2016-10-13 02:58:23 +00:00
@$( CC) -Wall -o $@ $^ $( LDFLAGS)
2014-12-01 02:18:46 +00:00
2016-09-27 07:26:04 +00:00
directory_service : $( OBJSDIR_TOOLS ) /directory_service .o libservalclient .a
2012-09-14 02:20:45 +00:00
@echo LINK $@
Switch to feature-driven linking
This introduces a new way of linking Serval executables and dynamic
libraries from static libraries like libservald.a -- called
"feature-driven" linking.
The Makefile now links servald and serval-tests from libservald.a,
rather than from an explicit list of object (.o) files. Thanks to the
section-based method for registering functions such as HTTP handlers,
CLI commands and MDP handlers, these object files had become
"stand-alone" and hence were no longer included in the link because
there was no unresolved reference that required them to be linked in.
The new "feature.h" provides the DECLARE_FEATURE(name) macro that each
stand-alone source file uses to declare the named feature(s) it
provides. Each executable can call the USE_FEATURE(name) macro in any
of its explicitly-linked source files to cause the corresponding
object(s) to be included in the link, eg, servald_features.c.
The DEFINE_BINDING() macro has been extended so that every individual
MDP binding is given a feature name based on its port number macro, eg,
"mdp_binding_MDP_PORT_ECHO".
Some features have been factored into their own separate source files so
they can be omitted or included in a build independently of each other:
- the MDP bindings for MDP_PORT_DNALOOKUP, MDP_PORT_ECHO,
MDP_PORT_TRACE, MDP_PORT_KEYMAPREQUEST, MDP_PORT_RHIZOME_xxx,
MDP_PORT_PROBE, MDP_PORT_STUN, MDP_PORT_STUNREQ
- the CLI "log" and "echo" commands
- the CLI "rhizome direct" command
The JNI source files are only compiled if the <jni.h> header is present,
otherwise they are omitted from libservald.so.
2016-10-13 02:58:23 +00:00
@$( CC) -Wall -o $@ $^ $( LDFLAGS)
2012-09-14 02:20:45 +00:00
2016-09-27 07:26:04 +00:00
tfw_createfile : $( OBJSDIR_TOOLS ) /tfw_createfile .o libservalclient .a
2012-10-31 07:43:33 +00:00
@echo LINK $@
Switch to feature-driven linking
This introduces a new way of linking Serval executables and dynamic
libraries from static libraries like libservald.a -- called
"feature-driven" linking.
The Makefile now links servald and serval-tests from libservald.a,
rather than from an explicit list of object (.o) files. Thanks to the
section-based method for registering functions such as HTTP handlers,
CLI commands and MDP handlers, these object files had become
"stand-alone" and hence were no longer included in the link because
there was no unresolved reference that required them to be linked in.
The new "feature.h" provides the DECLARE_FEATURE(name) macro that each
stand-alone source file uses to declare the named feature(s) it
provides. Each executable can call the USE_FEATURE(name) macro in any
of its explicitly-linked source files to cause the corresponding
object(s) to be included in the link, eg, servald_features.c.
The DEFINE_BINDING() macro has been extended so that every individual
MDP binding is given a feature name based on its port number macro, eg,
"mdp_binding_MDP_PORT_ECHO".
Some features have been factored into their own separate source files so
they can be omitted or included in a build independently of each other:
- the MDP bindings for MDP_PORT_DNALOOKUP, MDP_PORT_ECHO,
MDP_PORT_TRACE, MDP_PORT_KEYMAPREQUEST, MDP_PORT_RHIZOME_xxx,
MDP_PORT_PROBE, MDP_PORT_STUN, MDP_PORT_STUNREQ
- the CLI "log" and "echo" commands
- the CLI "rhizome direct" command
The JNI source files are only compiled if the <jni.h> header is present,
otherwise they are omitted from libservald.so.
2016-10-13 02:58:23 +00:00
@$( CC) -Wall -o $@ $^ $( LDFLAGS)
2012-10-31 07:43:33 +00:00
2016-09-27 07:26:04 +00:00
fakeradio : $( OBJSDIR_TOOLS ) /fakeradio .o libservalclient .a
2013-08-19 04:26:19 +00:00
@echo LINK $@
Switch to feature-driven linking
This introduces a new way of linking Serval executables and dynamic
libraries from static libraries like libservald.a -- called
"feature-driven" linking.
The Makefile now links servald and serval-tests from libservald.a,
rather than from an explicit list of object (.o) files. Thanks to the
section-based method for registering functions such as HTTP handlers,
CLI commands and MDP handlers, these object files had become
"stand-alone" and hence were no longer included in the link because
there was no unresolved reference that required them to be linked in.
The new "feature.h" provides the DECLARE_FEATURE(name) macro that each
stand-alone source file uses to declare the named feature(s) it
provides. Each executable can call the USE_FEATURE(name) macro in any
of its explicitly-linked source files to cause the corresponding
object(s) to be included in the link, eg, servald_features.c.
The DEFINE_BINDING() macro has been extended so that every individual
MDP binding is given a feature name based on its port number macro, eg,
"mdp_binding_MDP_PORT_ECHO".
Some features have been factored into their own separate source files so
they can be omitted or included in a build independently of each other:
- the MDP bindings for MDP_PORT_DNALOOKUP, MDP_PORT_ECHO,
MDP_PORT_TRACE, MDP_PORT_KEYMAPREQUEST, MDP_PORT_RHIZOME_xxx,
MDP_PORT_PROBE, MDP_PORT_STUN, MDP_PORT_STUNREQ
- the CLI "log" and "echo" commands
- the CLI "rhizome direct" command
The JNI source files are only compiled if the <jni.h> header is present,
otherwise they are omitted from libservald.so.
2016-10-13 02:58:23 +00:00
@$( CC) -Wall -o $@ $^ $( LDFLAGS)
2013-08-19 04:26:19 +00:00
2016-09-27 07:26:04 +00:00
simulator : $( SIMULATOR_OBJS ) libservalclient .a
2014-05-02 04:32:25 +00:00
@echo LINK $@
Switch to feature-driven linking
This introduces a new way of linking Serval executables and dynamic
libraries from static libraries like libservald.a -- called
"feature-driven" linking.
The Makefile now links servald and serval-tests from libservald.a,
rather than from an explicit list of object (.o) files. Thanks to the
section-based method for registering functions such as HTTP handlers,
CLI commands and MDP handlers, these object files had become
"stand-alone" and hence were no longer included in the link because
there was no unresolved reference that required them to be linked in.
The new "feature.h" provides the DECLARE_FEATURE(name) macro that each
stand-alone source file uses to declare the named feature(s) it
provides. Each executable can call the USE_FEATURE(name) macro in any
of its explicitly-linked source files to cause the corresponding
object(s) to be included in the link, eg, servald_features.c.
The DEFINE_BINDING() macro has been extended so that every individual
MDP binding is given a feature name based on its port number macro, eg,
"mdp_binding_MDP_PORT_ECHO".
Some features have been factored into their own separate source files so
they can be omitted or included in a build independently of each other:
- the MDP bindings for MDP_PORT_DNALOOKUP, MDP_PORT_ECHO,
MDP_PORT_TRACE, MDP_PORT_KEYMAPREQUEST, MDP_PORT_RHIZOME_xxx,
MDP_PORT_PROBE, MDP_PORT_STUN, MDP_PORT_STUNREQ
- the CLI "log" and "echo" commands
- the CLI "rhizome direct" command
The JNI source files are only compiled if the <jni.h> header is present,
otherwise they are omitted from libservald.so.
2016-10-13 02:58:23 +00:00
@$( CC) -Wall -o $@ $^ $( LDFLAGS)
2013-12-05 02:51:58 +00:00
2017-09-12 06:08:21 +00:00
.INTERMEDIATE : _servalclient .a
_servalclient.a : $( LIB_SERVAL_OBJS ) $( OBJSDIR_TOOLS ) /version .o
2016-09-27 07:26:04 +00:00
@echo AR $@
2017-09-12 06:08:21 +00:00
@$( RM) $@
Switch to feature-driven linking
This introduces a new way of linking Serval executables and dynamic
libraries from static libraries like libservald.a -- called
"feature-driven" linking.
The Makefile now links servald and serval-tests from libservald.a,
rather than from an explicit list of object (.o) files. Thanks to the
section-based method for registering functions such as HTTP handlers,
CLI commands and MDP handlers, these object files had become
"stand-alone" and hence were no longer included in the link because
there was no unresolved reference that required them to be linked in.
The new "feature.h" provides the DECLARE_FEATURE(name) macro that each
stand-alone source file uses to declare the named feature(s) it
provides. Each executable can call the USE_FEATURE(name) macro in any
of its explicitly-linked source files to cause the corresponding
object(s) to be included in the link, eg, servald_features.c.
The DEFINE_BINDING() macro has been extended so that every individual
MDP binding is given a feature name based on its port number macro, eg,
"mdp_binding_MDP_PORT_ECHO".
Some features have been factored into their own separate source files so
they can be omitted or included in a build independently of each other:
- the MDP bindings for MDP_PORT_DNALOOKUP, MDP_PORT_ECHO,
MDP_PORT_TRACE, MDP_PORT_KEYMAPREQUEST, MDP_PORT_RHIZOME_xxx,
MDP_PORT_PROBE, MDP_PORT_STUN, MDP_PORT_STUNREQ
- the CLI "log" and "echo" commands
- the CLI "rhizome direct" command
The JNI source files are only compiled if the <jni.h> header is present,
otherwise they are omitted from libservald.so.
2016-10-13 02:58:23 +00:00
@$( AR) -cr $@ $^
2013-12-05 02:51:58 +00:00
2017-09-12 06:08:21 +00:00
libservalclient.a : _servalclient .a $( LIBSODIUM_A )
@$( call MERGE_STATIC_LIBS, $@ , $^)
libservalclient.so : $( LIB_SERVAL_OBJS ) $( OBJSDIR_TOOLS ) /version .o $( LIBSODIUM_A )
2016-10-19 00:24:44 +00:00
@echo LINK $@
2017-12-15 06:40:56 +00:00
@$( CC) -Wall -shared -o $@ $( LDFLAGS) $( filter %.o %.a, $^) $( filter %.a, $^)
2012-03-14 22:54:31 +00:00
2017-09-12 06:08:21 +00:00
.INTERMEDIATE : _monitorclient .a
_monitorclient.a : $( MONITOR_CLIENT_OBJS ) $( OBJSDIR_TOOLS ) /version .o
2016-09-27 07:26:04 +00:00
@echo AR $@
2017-09-12 06:08:21 +00:00
@$( RM) $@
Switch to feature-driven linking
This introduces a new way of linking Serval executables and dynamic
libraries from static libraries like libservald.a -- called
"feature-driven" linking.
The Makefile now links servald and serval-tests from libservald.a,
rather than from an explicit list of object (.o) files. Thanks to the
section-based method for registering functions such as HTTP handlers,
CLI commands and MDP handlers, these object files had become
"stand-alone" and hence were no longer included in the link because
there was no unresolved reference that required them to be linked in.
The new "feature.h" provides the DECLARE_FEATURE(name) macro that each
stand-alone source file uses to declare the named feature(s) it
provides. Each executable can call the USE_FEATURE(name) macro in any
of its explicitly-linked source files to cause the corresponding
object(s) to be included in the link, eg, servald_features.c.
The DEFINE_BINDING() macro has been extended so that every individual
MDP binding is given a feature name based on its port number macro, eg,
"mdp_binding_MDP_PORT_ECHO".
Some features have been factored into their own separate source files so
they can be omitted or included in a build independently of each other:
- the MDP bindings for MDP_PORT_DNALOOKUP, MDP_PORT_ECHO,
MDP_PORT_TRACE, MDP_PORT_KEYMAPREQUEST, MDP_PORT_RHIZOME_xxx,
MDP_PORT_PROBE, MDP_PORT_STUN, MDP_PORT_STUNREQ
- the CLI "log" and "echo" commands
- the CLI "rhizome direct" command
The JNI source files are only compiled if the <jni.h> header is present,
otherwise they are omitted from libservald.so.
2016-10-13 02:58:23 +00:00
@$( AR) -cr $@ $^
2016-09-27 07:26:04 +00:00
2017-09-12 06:08:21 +00:00
libmonitorclient.a : _monitorclient .a $( LIBSODIUM_A )
@$( call MERGE_STATIC_LIBS, $@ , $^)
libmonitorclient.so : $( MONITOR_CLIENT_OBJS ) $( OBJSDIR_TOOLS ) /version .o $( LIBSODIUM_A )
2012-07-29 03:05:53 +00:00
@echo LINK $@
2017-09-12 06:08:21 +00:00
@$( CC) -Wall -shared -o $@ $( LDFLAGS) $( filter %.o, $^) $( filter %.a, $^)
2012-08-10 05:06:46 +00:00
2017-09-18 06:34:16 +00:00
# The tags will always index all the Serval DNA headers and source files. If
# serval-tools is installed, then it will also index all the libsodium, JNI
# and Android NDK header files.
2017-10-23 07:18:40 +00:00
$(srcdir)/tags : Makefile $( PREFIXED_HEADERS ) $( PREFIXED_SOURCES )
2017-09-12 06:08:21 +00:00
{ for file in $( PREFIXED_HEADERS) $( PREFIXED_SOURCES) ; do echo " $$ file " ; done ; \
2017-10-03 04:45:13 +00:00
find $( LIBSODIUM_DEV) /include -type f ; \
2017-09-18 06:34:16 +00:00
sp-find-gcc-headers $( CFLAGS) 2>/dev/null; \
ndk_prefix = $$ ( sp-ndk-prefix . 2>/dev/null) && find " $$ ndk_prefix/arch-arm/usr/include " -type f; \
} | ctags -L- -f $@ --tag-relative= yes --c-kinds= defgmpstuv
2016-09-27 07:26:04 +00:00
# Helpful target to update the COPYRIGHT.txt file by harvesting copyright
# information from the contents of all the source and header files. This
# should be run periodically and the results reviewed, manually adjusted and
# committed to the repository.
2013-12-03 03:59:13 +00:00
2016-09-27 07:26:04 +00:00
findPATH = $( firstword $( wildcard $( addsuffix /$( 1) ,$( subst :, ,$( PATH) ) ) ) )
COPYRIGHT_TOOL := $( call findPATH,sp-copyright-tool)
2013-10-13 08:09:17 +00:00
2016-09-27 07:26:04 +00:00
copyright :
@if [ -x " $( COPYRIGHT_TOOL) " ] ; then \
echo GENERATE COPYRIGHT.txt; \
2017-11-10 04:15:53 +00:00
$( COPYRIGHT_TOOL) -o COPYRIGHT.txt condense \
$( PREFIXED_HEADERS) \
$( PREFIXED_SOURCES) \
$( find $( srcdir) /java-api -type f -name '*.java' ) \
$( find $( srcdir) /swift-api -type f -name '*.swift' ) \
; \
2016-09-27 07:26:04 +00:00
else \
echo 'sp-copyright-tool is not in $$PATH; COPYRIGHT.txt not updated' ; \
fi