2014-05-28 17:40:47 +09:30
# Makefile.in for Serval DNA
# vim: noet ts=8 sts=0 sw=8
2013-10-13 10:09:17 +02:00
prefix = @prefix@
2013-12-03 14:29:13 +10:30
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
2014-03-26 15:35:43 +10:30
sysconfdir = @sysconfdir@
localstatedir = @localstatedir@
2013-10-13 10:09:17 +02:00
2016-09-19 12:21:57 +09:30
SQLITE3_AMALGAMATION = sqlite-amalgamation-3140200
2016-10-25 12:53:17 +10:30
i n c l u d e $( SOURCE_PREFIX ) s o u r c e f i l e s . m k
i n c l u d e $( SOURCE_PREFIX ) h e a d e r f i l e s . m k
2012-03-15 09:24:31 +10:30
2014-05-28 17:40:47 +09:30
OBJSDIR_SERVALD = objs_servald
OBJSDIR_LIB = objs_lib
OBJSDIR_TOOLS = objs
OBJSDIRS = $( OBJSDIR_SERVALD) $( OBJSDIR_LIB) $( OBJSDIR_TOOLS)
2014-12-01 12:48:46 +10:30
ALL_SOURCES = \
$( SERVAL_CLIENT_SOURCES) \
$( MDP_CLIENT_SOURCES) \
$( SERVAL_DAEMON_SOURCES) \
2016-10-12 17:08:26 +10:30
$( SERVAL_DAEMON_JNI_SOURCES) \
2014-12-01 12:48:46 +10:30
$( MONITOR_CLIENT_SRCS) \
2016-10-17 17:40:28 +10:30
$( CLIENT_ONLY_SOURCES) \
2014-12-01 12:48:46 +10:30
$( SIMULATOR_SOURCES) \
$( SQLITE3_SOURCES)
2016-09-19 12:21:57 +09:30
2014-05-23 17:49:00 +09:30
SERVAL_DAEMON_OBJS = \
2014-05-28 17:40:47 +09:30
$( 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 13:28:23 +10:30
$( addprefix $( OBJSDIR_SERVALD) /, $( SERVAL_DAEMON_SOURCES:.c= .o) )
2016-10-19 16:26:00 +10:30
2016-10-24 16:13:55 +10:30
i f e q ( @ H A V E _ J N I _ H @ , y e s )
2016-10-19 16:26:00 +10:30
SERVAL_DAEMON_JNI_OBJS = \
2016-10-12 17:08:26 +10:30
$( addprefix $( OBJSDIR_SERVALD) /, $( SERVAL_DAEMON_JNI_SOURCES:.c= .o) )
2016-10-19 16:26:00 +10:30
SERVAL_DAEMON_OBJS += $( SERVAL_DAEMON_JNI_OBJS)
2016-10-24 16:13:55 +10:30
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 13:28:23 +10:30
e n d i f
2016-10-19 16:26:00 +10:30
2016-09-19 12:21:57 +09:30
SQLITE3_OBJS = \
$( addprefix $( OBJSDIR_SERVALD) /, $( notdir $( SQLITE3_SOURCES:.c= .o) ) )
2016-10-19 16:26:00 +10:30
2014-05-23 17:49:00 +09:30
SERVALD_OBJS = \
2016-09-19 12:21:57 +09:30
$( SQLITE3_OBJS) \
2014-05-28 17:40:47 +09:30
$( SERVAL_DAEMON_OBJS)
2016-10-19 16:26:00 +10:30
2014-05-23 17:49:00 +09:30
LIB_SERVAL_OBJS = \
2014-05-28 17:40:47 +09:30
$( addprefix $( OBJSDIR_LIB) /, $( SERVAL_CLIENT_SOURCES:.c= .o) ) \
2016-10-17 17:40:28 +10:30
$( addprefix $( OBJSDIR_LIB) /, $( CLIENT_ONLY_SOURCES:.c= .o) ) \
2014-05-28 17:40:47 +09:30
$( addprefix $( OBJSDIR_LIB) /, $( MDP_CLIENT_SOURCES:.c= .o) )
2016-10-19 16:26:00 +10:30
2014-05-23 17:49:00 +09:30
MONITOR_CLIENT_OBJS = \
2014-05-28 17:40:47 +09:30
$( addprefix $( OBJSDIR_LIB) /, $( SERVAL_CLIENT_SOURCES:.c= .o) ) \
2016-10-17 17:40:28 +10:30
$( addprefix $( OBJSDIR_LIB) /, $( CLIENT_ONLY_SOURCES:.c= .o) ) \
2014-05-28 17:40:47 +09:30
$( addprefix $( OBJSDIR_LIB) /, $( MONITOR_CLIENT_SRCS:.c= .o) )
2016-10-19 16:26:00 +10:30
2014-05-23 17:49:00 +09:30
SIMULATOR_OBJS = \
2014-05-28 17:40:47 +09:30
$( addprefix $( OBJSDIR_TOOLS) /, $( SIMULATOR_SOURCES:.c= .o) )
2016-09-27 16:56:04 +09:30
PREFIXED_HEADERS = $( addprefix $( SOURCE_PREFIX) , $( HDRS) )
2014-05-28 17:40:47 +09:30
CC = @CC@
2012-03-15 09:24:31 +10:30
2014-06-11 20:12:56 +09:30
LDFLAGS = @LDFLAGS@ @LIBS@
2012-03-15 09:24:31 +10:30
2016-09-27 16:56:04 +09:30
CFLAGS = -I$( SOURCE_PREFIX) $( SQLITE3_AMALGAMATION) @CPPFLAGS@ @CFLAGS@
2014-06-30 10:14:12 +09:30
CFLAGS += -DSYSCONFDIR= " \" $( sysconfdir) \" " -DLOCALSTATEDIR= " \" $( localstatedir) \" "
2016-09-19 12:21:57 +09:30
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 14:16:51 +10:30
CFLAGS += -fPIC -DSERVAL_ENABLE_DEBUG= 1 -Wall -Werror -Wextra -Wformat -Werror= format-security -D_FORTIFY_SOURCE= 2
2012-09-05 18:53:22 +09:30
# Solaris magic
CFLAGS += -DSHA2_USE_INTTYPES_H -D_XOPEN_SOURCE= 600 -D_XOPEN_SOURCE_EXTENDED= 1 -D__EXTENSIONS__= 1
2012-09-06 14:32:17 +09:30
# OSX magic to compensate for the Solaris magic
CFLAGS += -D_DARWIN_C_SOURCE
2016-09-19 12:21:57 +09:30
CFLAGS_SQLITE = @CFLAGS_SQLITE@
2013-12-03 14:29:13 +10:30
2016-11-08 14:51:15 +10:30
JAVAC = @JAVAC@
2013-12-03 14:29:13 +10:30
INSTALL = install
INSTALL_PROGRAM = $( INSTALL)
INSTALL_DATA = $( INSTALL) -m 644
2016-09-27 16:56:04 +09:30
- i n c l u d e $( SOURCE_PREFIX ) M a k e f i l e . d b g
2012-06-15 15:01:14 +09:30
2016-10-25 12:53:17 +10:30
DEFS = @DEFS@
CONFIG_H = @CONFIG_H@
2012-04-23 20:17:11 +09:30
2016-09-27 16:56:04 +09:30
.PHONY : all libs test install uninstall clean
all : libs servald servaldwrap test
2013-08-19 16:59:10 +09:30
2016-10-20 13:19:26 +10:30
libs : libservaldaemon .so \
2016-09-27 16:56:04 +09:30
libservalclient.so libservalclient.a \
libmonitorclient.so libmonitorclient.a
2013-08-19 13:35:58 +09:30
2014-12-01 12:48:46 +10:30
test : tfw_createfile directory_service fakeradio simulator serval -tests
2012-03-15 09:24:31 +10:30
2016-09-27 16:56:04 +09:30
install : servald
$( INSTALL_PROGRAM) -D servald $( DESTDIR) $( sbindir) /servald
uninstall :
$( RM) $( DESTDIR) $( sbindir) /servald
clean :
@$( RM) -r $( OBJSDIRS:%= %/*) \
servald \
2016-10-20 13:19:26 +10:30
libservaldaemon.so libservaldaemon.a \
2016-09-27 16:56:04 +09:30
libservalclient.so libservalclient.a \
libmonitorclient.so libmonitorclient.a \
tfw_createfile directory_service fakeradio simulator serval-tests
2016-11-08 14:51:15 +10:30
# 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
ifneq ($(SOURCE_PREFIX : /%=), )
SOURCE_PREFIX_JAVA_API = $( SOURCE_PREFIX) ../java-api/
e l s e
SOURCE_PREFIX_JAVA_API = $( SOURCE_PREFIX)
e n d i f
java-api :
@mkdir -p java-api
2017-02-13 15:36:13 +10:30
@cd java-api && $( MAKE) SOURCE_PREFIX = $( SOURCE_PREFIX_JAVA_API) all
2016-11-08 14:51:15 +10:30
java-api-clean :
2017-02-13 15:36:13 +10:30
@cd java-api 2>/dev/null && $( MAKE) SOURCE_PREFIX = $( SOURCE_PREFIX_JAVA_API) clean
2016-11-08 14:51:15 +10:30
e n d i f # $(JAVAC)
2016-09-27 16:56:04 +09:30
# Source code test coverage support -- see doc/Testing.md
.PHONY : covzero covinit covhtml is_built_with_coverage has_coverage_data
2014-05-28 17:40:47 +09:30
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 12:53:17 +10:30
servald-initial.info : Makefile servald | is_built_with_coverage
2014-05-28 17:40:47 +09:30
geninfo --quiet --initial --checksum --base-directory= $( abspath .) --no-external $( OBJSDIR_SERVALD) -o $@
2016-10-25 12:53:17 +10:30
servald-coverage.info : Makefile servald $( shell find $ ( OBJSDIR_SERVALD ) -type f -name '*.gcda ' 2>/dev /null ) | has_coverage_data
2014-05-28 17:40:47 +09:30
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 12:53:17 +10:30
coverage_html/index.html : Makefile servald -initial .info servald -coverage .info
2014-05-28 17:40:47 +09:30
$( RM) -r coverage_html
genhtml --quiet servald-initial.info servald-coverage.info -o coverage_html
2016-09-27 16:56:04 +09:30
# Autconf support -- helpful messages to help avoid some common build mistakes.
2016-10-25 12:53:17 +10:30
.PRECIOUS : Makefile config .status $( SOURCE_PREFIX ) configure
2016-09-27 16:56:04 +09:30
2016-10-25 12:53:17 +10:30
Makefile : $( SOURCE_PREFIX ) Makefile .in config .status
2014-12-01 10:19:09 +10:30
$( warning Makefile may be out of date, please run ./config.status)
2012-04-20 17:10:38 +09:30
2016-10-25 12:53:17 +10:30
config.status : $( SOURCE_PREFIX ) configure
$( warning config.status may be out of date, please run $( if $( SOURCE_PREFIX) ,$( SOURCE_PREFIX) ,./) configure)
2014-12-01 10:19:09 +10:30
2016-09-27 16:56:04 +09:30
$(SOURCE_PREFIX)configure : $( SOURCE_PREFIX ) configure .ac
2016-10-25 12:53:17 +10:30
$( warning $( SOURCE_PREFIX) configure may be out of date, please run $( if $( SOURCE_PREFIX) ,cd $( SOURCE_PREFIX) && ,) autoreconf -f -i -I m4)
2014-05-23 17:49:00 +09:30
2016-09-27 16:56:04 +09:30
# Embed Serval DNA's version into libraries and executables.
$(OBJSDIR_TOOLS)/version.o : $( addprefix $ ( SOURCE_PREFIX ) , $ ( ALL_SOURCES ) ) \
$( PREFIXED_HEADERS) \
$( SOURCE_PREFIX) version_servald.c \
$( SOURCE_PREFIX) version_string.sh \
$( wildcard VERSION.txt) \
$( SOURCE_PREFIX) COPYRIGHT.txt
2013-08-19 13:35:58 +09:30
@echo CC version_servald.c
2014-07-02 10:09:13 +09:30
@mkdir -p $( dir $@ )
2014-05-28 17:40:47 +09:30
@$( RM) $( @:.o= .gcno) $( @:.o= .gcda)
2016-09-27 16:56:04 +09:30
@V= ` $( SOURCE_PREFIX) ./version_string.sh --repository= $( SOURCE_PREFIX) --ignore-untracked` \
&& C = " `sed -e :a -e N -e ' $$ !ba' -e 's/[\\\\ " ] /\\ \\ & /g' -e ' s/\\ n/\\ \\ n/g' $( SOURCE_PREFIX) COPYRIGHT.txt` " \
&& $( CC) $( CFLAGS) $( DEFS) -c $( SOURCE_PREFIX) version_servald.c -o $@ -DSERVALD_VERSION= " \" $$ V\" " -DSERVALD_COPYRIGHT= " \" $$ C\" "
2013-08-19 13:35:58 +09:30
2014-05-23 17:49:00 +09:30
#' <-- fixes vim syntax highlighting
2014-05-09 15:27:23 +09:30
2016-02-01 13:42:38 +10:30
# 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.
2016-09-27 16:56:04 +09:30
$(SQLITE3_OBJS) : $( OBJSDIR_SERVALD ) /%.o : $( SOURCE_PREFIX ) $( SQLITE 3_AMALGAMATION ) /%.c
2014-05-23 17:49:00 +09:30
@echo SERVALD CC $<
@mkdir -p $( dir $@ )
2014-05-28 17:40:47 +09:30
@$( RM) $( @:.o= .gcno) $( @:.o= .gcda)
2016-09-19 12:21:57 +09:30
@$( CC) $( CFLAGS) $( CFLAGS_SQLITE) $( DEFS) -c $< -o $@
2014-05-23 17:49:00 +09:30
# No object files in source directory!
2016-09-27 16:56:04 +09:30
%.o : $( SOURCE_PREFIX ) %.c
2014-05-09 15:27:23 +09:30
2016-09-27 16:56:04 +09:30
$(OBJSDIR_TOOLS)/%.o : $( SOURCE_PREFIX ) %.c
2012-05-10 13:23:06 +09:30
@echo CC $<
2014-05-23 17:49:00 +09:30
@mkdir -p $( dir $@ )
2014-05-29 11:04:09 +09:30
@$( RM) $( @:.o= .gcno) $( @:.o= .gcda)
2014-05-23 17:49:00 +09:30
@$( CC) $( CFLAGS) $( DEFS) -c $< -o $@
2016-09-27 16:56:04 +09:30
$(OBJSDIR_SERVALD)/%.o : $( SOURCE_PREFIX ) %.c
2014-05-23 17:49:00 +09:30
@echo SERVALD CC $<
@mkdir -p $( dir $@ )
2014-05-29 11:04:09 +09:30
@$( RM) $( @:.o= .gcno) $( @:.o= .gcda)
2014-05-23 17:49:00 +09:30
@$( CC) $( CFLAGS) $( DEFS) -c $< -o $@
2016-09-27 16:56:04 +09:30
$(OBJSDIR_LIB)/%.o : $( SOURCE_PREFIX ) %.c
2014-05-23 17:49:00 +09:30
@echo LIB CC $<
@mkdir -p $( dir $@ )
2014-05-29 11:04:09 +09:30
@$( RM) $( @:.o= .gcno) $( @:.o= .gcda)
2012-10-18 17:10:45 +10:30
@$( CC) $( CFLAGS) $( DEFS) -c $< -o $@
2012-03-15 09:24:31 +10:30
2016-09-27 16:56:04 +09:30
# 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.
2016-10-25 12:53:17 +10:30
$(SERVAL_DAEMON_OBJS) : Makefile $( CONFIG_H ) $( PREFIXED_HEADERS )
$(SERVALD_OBJS) : Makefile
$(LIB_SERVAL_OBJS) : Makefile $( CONFIG_H ) $( PREFIXED_HEADERS )
$(OBJSDIR_TOOLS)/tfw_createfile.o : Makefile str .h
$(OBJSDIR_TOOLS)/directory_service.o : Makefile $( CONFIG_H ) $( PREFIXED_HEADERS )
$(MONITOR_CLIENT_OBJS) : Makefile $( CONFIG_H ) $( PREFIXED_HEADERS )
$(SIMULATOR_OBJS) : Makefile $( CONFIG_H ) $( PREFIXED_HEADERS )
2016-09-27 16:56:04 +09:30
# Rules for main targets.
2012-11-22 18:18:00 +10:30
2016-10-20 13:19:26 +10:30
libservaldaemon.a : \
$( SERVALD_OBJS) \
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 13:28:23 +10:30
$( OBJSDIR_TOOLS) /version.o
@echo AR $@
@$( AR) -cr $@ $^
2016-10-20 13:19:26 +10:30
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 13:28:23 +10:30
$( OBJSDIR_SERVALD) /servald_features.o \
2016-10-19 16:26:00 +10:30
$( SERVAL_DAEMON_JNI_OBJS) \
2016-10-20 13:19:26 +10:30
libservaldaemon.a
2012-05-10 13:23:06 +09:30
@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 13:28:23 +10:30
@$( CC) -Wall -shared -o $@ $^ $( LDFLAGS)
2016-10-20 13:19:26 +10:30
servald : $( OBJSDIR_SERVALD ) /servald_features .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 13:28:23 +10:30
@echo LINK $@
@$( CC) -Wall -o $@ $^ $( LDFLAGS)
2014-05-23 17:49:00 +09:30
2016-09-27 16:56:04 +09:30
servaldwrap : $( OBJSDIR_SERVALD ) /servalwrap .o $( OBJSDIR_TOOLS ) /version .o
@echo LINK $@
@$( CC) -Wall -o $@ $^ $( LDFLAGS)
2016-10-20 13:19:26 +10:30
serval-tests : $( OBJSDIR_SERVALD ) /test_features .o libservaldaemon .a
2014-12-01 12:48:46 +10:30
@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 13:28:23 +10:30
@$( CC) -Wall -o $@ $^ $( LDFLAGS)
2014-12-01 12:48:46 +10:30
2016-09-27 16:56:04 +09:30
directory_service : $( OBJSDIR_TOOLS ) /directory_service .o libservalclient .a
2012-09-14 11:50:45 +09:30
@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 13:28:23 +10:30
@$( CC) -Wall -o $@ $^ $( LDFLAGS)
2012-09-14 11:50:45 +09:30
2016-09-27 16:56:04 +09:30
tfw_createfile : $( OBJSDIR_TOOLS ) /tfw_createfile .o libservalclient .a
2012-10-31 18:13:33 +10:30
@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 13:28:23 +10:30
@$( CC) -Wall -o $@ $^ $( LDFLAGS)
2012-10-31 18:13:33 +10:30
2016-09-27 16:56:04 +09:30
fakeradio : $( OBJSDIR_TOOLS ) /fakeradio .o libservalclient .a
2013-08-19 13:56:19 +09:30
@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 13:28:23 +10:30
@$( CC) -Wall -o $@ $^ $( LDFLAGS)
2013-08-19 13:56:19 +09:30
2016-09-27 16:56:04 +09:30
simulator : $( SIMULATOR_OBJS ) libservalclient .a
2014-05-02 14:02:25 +09:30
@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 13:28:23 +10:30
@$( CC) -Wall -o $@ $^ $( LDFLAGS)
2013-12-05 13:21:58 +10:30
2016-09-27 16:56:04 +09:30
libservalclient.a : $( LIB_SERVAL_OBJS ) $( OBJSDIR_TOOLS ) /version .o
@echo AR $@
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 13:28:23 +10:30
@$( AR) -cr $@ $^
2013-12-05 13:21:58 +10:30
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 13:28:23 +10:30
libservalclient.so : $( LIB_SERVAL_OBJS ) $( OBJSDIR_TOOLS ) /version .o
2016-10-19 10:54:44 +10:30
@echo LINK $@
@$( CC) -Wall -shared -o $@ $^ $( LDFLAGS)
2012-03-15 09:24:31 +10:30
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 13:28:23 +10:30
libmonitorclient.a : $( MONITOR_CLIENT_OBJS ) $( OBJSDIR_TOOLS ) /version .o
2016-09-27 16:56:04 +09:30
@echo AR $@
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 13:28:23 +10:30
@$( AR) -cr $@ $^
2016-09-27 16:56:04 +09:30
2014-05-28 17:40:47 +09:30
libmonitorclient.so : $( MONITOR_CLIENT_OBJS ) $( OBJSDIR_TOOLS ) /version .o
2012-07-29 12:35:53 +09:30
@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 13:28:23 +10:30
@$( CC) -Wall -shared -o $@ $^ $( LDFLAGS)
2012-08-10 14:36:46 +09:30
2016-09-27 16:56:04 +09:30
# 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 14:29:13 +10:30
2016-09-27 16:56:04 +09:30
findPATH = $( firstword $( wildcard $( addsuffix /$( 1) ,$( subst :, ,$( PATH) ) ) ) )
COPYRIGHT_TOOL := $( call findPATH,sp-copyright-tool)
2013-10-13 10:09:17 +02:00
2016-09-27 16:56:04 +09:30
copyright :
@if [ -x " $( COPYRIGHT_TOOL) " ] ; then \
echo GENERATE COPYRIGHT.txt; \
$( COPYRIGHT_TOOL) -o COPYRIGHT.txt condense *.c *.h; \
else \
echo 'sp-copyright-tool is not in $$PATH; COPYRIGHT.txt not updated' ; \
fi