Skip to content
Snippets Groups Projects
Commit fede2391 authored by g0dil's avatar g0dil
Browse files

senfscons: Much improved install implementation

Socket/Protocols: Removed obsolete GenericSockAddr
Utils: Add missing unit tests
Fix debian '.install' files
parent 0675a566
No related branches found
No related tags found
No related merge requests found
Showing
with 474 additions and 174 deletions
......@@ -12,6 +12,6 @@ SENFSCons.StandardTargets(env)
SENFSCons.Object(env, target = 'DefaultBundle', sources=sources,
LIBS = ['Packets', 'Socket', 'Utils'])
SENFSCons.Lib(env, library = 'Packets_DefaultBundle', sources = sources[0],
LIBS = ['Packets', 'Socket', 'Utils'])
LIBS = ['Packets', 'Socket', 'Utils'], no_includes = 1)
SENFSCons.Doxygen(env)
......@@ -12,6 +12,6 @@ SENFSCons.StandardTargets(env)
SENFSCons.Object(env, target = 'MPEGDVBBundle', sources=sources,
LIBS = ['Packets', 'Socket', 'Utils'])
SENFSCons.Lib(env, library = 'Packets_MPEGDVBBundle', sources = sources[0],
LIBS = ['Packets', 'Socket', 'Utils'])
LIBS = ['Packets', 'Socket', 'Utils'], no_includes = 1)
SENFSCons.Doxygen(env)
......@@ -21,7 +21,7 @@
/** \file
\brief ParseArray non-inline template implementation */
//#include "ParseArray.ih"
#include "ParseArray.ih"
// Custom includes
......@@ -41,8 +41,6 @@ prefix_ void senf::Parse_Array<elements,ElementParser>::init()
(*i).init();
}
///////////////////////////////ct.e////////////////////////////////////////
#undef prefix_
......
......@@ -102,7 +102,7 @@ namespace senf {
#if !defined(SENF_PACKETS_DECL_ONLY) && !defined(HH_ParseArray_i_)
#define HH_ParseArray_i_
//#include "ParseArray.cci"
//#include "ParseArray.ct"
#include "ParseArray.ct"
#include "ParseArray.cti"
#endif
......
......@@ -5,26 +5,22 @@ import SENFSCons, glob
###########################################################################
def makeAllIncludesHH(target = None, source = None, env = None):
file(target[0].abspath,"w").write("".join([ '#include "%s"\n' % f
for f in env['SOURCE_HEADERS']]))
makeAllIncludesHH = env.Action(makeAllIncludesHH, varlist=['SOURCE_HEADERS'])
def makeAllIncludesHH(target, headers):
file(env.File(target).abspath,"w").write("".join([ '#include "%s"\n' % f
for f in headers ]))
###########################################################################
sources = SENFSCons.GlobSources()
source_headers = [ f for f in glob.glob("*.hh")
if 'defined(SENF_PACKETS_DECL_ONLY)' in file(f).read() ]
source_headers.sort()
makeAllIncludesHH('all_includes.hh', source_headers)
SENFSCons.StandardTargets(env)
env.Command('all_includes.hh', 'SConscript', makeAllIncludesHH,
SOURCE_HEADERS = [ f for f in glob.glob("*.hh")
if 'defined(SENF_PACKETS_DECL_ONLY)' in file(f).read() ])
SENFSCons.Lib(env,
library = 'Packets',
sources = sources,
sources = SENFSCons.GlobSources(),
LIBS = [ 'Socket', 'Utils' ])
SENFSCons.Doxygen(env, extra_sources = [
env.Dia2Png("structure.dia")
])
......
// $Id$
//
// Copyright (C) 2006
// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
// Stefan Bund <stefan.bund@fokus.fraunhofer.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the
// Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
\brief GenericSockAddr public header */
/** \defgroup addr_group Socket Addressing
To support the core socket functionality we need a collection of classing providing addressing
for the different protocols.
For all standard BSD socket protocols we base the address classes on the corresponding \c
sockaddr structures, wrapped into appropriate C++ adapters. These Address classes are based on
GenericSockAddr, the corresponding addressing policy is defined in GenericAddressingPolicy.
You are however not limit to BSD type socket address classes as long as you implement the
corresponding addressing policy.
*/
#ifndef HH_GenericSockAddr_
#define HH_GenericSockAddr_ 1
// Custom includes
#include <sys/socket.h>
//#include "GenericSockAddr.mpp"
///////////////////////////////hh.p////////////////////////////////////////
namespace senf {
/// \addtogroup addr_group
/// @{
/** \brief Generic protocol-independant socket address
This address type does not depend on the protocol of the socket. It does nowever not support
any protocol specific API, so access to the address is very limited.
*/
class GenericSockAddr
{
public:
GenericSockAddr();
/// \name Generic Address Interface
/// @{
struct sockaddr * sockaddr_p(); ///< Return a pointer to sockaddr structure
/**< The exact structure pointed to depends on the address
family. The data pointed to must be \e mutable. The
value must be changeable and any change of the value
through this pointer must be reflected in the visible
address interface.
\returns non-const (!) pointer to sockaddr structure */
struct sockaddr const * sockaddr_p() const; ///< Return a pointer to sockaddr structure
/**< This member is like sockaddr_p(), however it does not
allow changing the address.
\returns const pointer to sockaddr structure */
unsigned sockaddr_len() const; ///< Return size of address
/**< This member return the size of the socket address
structure as returned by sockaddr_p() in bytes.
\returns size of respective sockaddr structure in bytes
*/
/// @}
private:
struct ::sockaddr_storage addr_;
};
/// @}
}
///////////////////////////////hh.e////////////////////////////////////////
#include "GenericSockAddr.cci"
//#include "GenericSockAddr.ct"
//#include "GenericSockAddr.cti"
//#include "GenericSockAddr.mpp"
#endif
// Local Variables:
// mode: c++
// fill-column: 100
// c-file-style: "senf"
// indent-tabs-mode: nil
// ispell-local-dictionary: "american"
// compile-command: "scons -u test"
// comment-column: 40
// End:
// Copyright (C) 2007
// $Id$
//
// Copyright (C) 2007
// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
// Stefan Bund <g0dil@berlios.de>
......@@ -19,43 +21,39 @@
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
\brief GenericSockAddr inline non-template implementation */
\brief Buffer.test unit tests */
//#include "Buffer.test.hh"
//#include "Buffer.test.ih"
// Custom includes
#include "Buffer.hh"
#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
#include <boost/test/auto_unit_test.hpp>
#include <boost/test/test_tools.hpp>
prefix_ senf::GenericSockAddr::GenericSockAddr()
{}
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
prefix_ struct sockaddr * senf::GenericSockAddr::sockaddr_p()
BOOST_AUTO_UNIT_TEST(buffer)
{
return reinterpret_cast<sockaddr *>(&addr_);
}
int size (128);
prefix_ struct sockaddr const * senf::GenericSockAddr::sockaddr_p()
const
{
return reinterpret_cast<sockaddr const *>(&addr_);
// Just check for compile errors, the rest can't be checked
SENF_SCOPED_BUFFER(char, buf, size);
(void) buf;
}
prefix_ unsigned senf::GenericSockAddr::sockaddr_len()
const
{
return sizeof(addr_);
}
///////////////////////////////cci.e///////////////////////////////////////
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
// Local Variables:
// mode: c++
// fill-column: 100
// comment-column: 40
// c-file-style: "senf"
// indent-tabs-mode: nil
// ispell-local-dictionary: "american"
// compile-command: "scons -u test"
// comment-column: 40
// End:
// $Id$
//
// Copyright (C) 2007
// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
// Stefan Bund <g0dil@berlios.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the
// Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
\brief SafeBool.test unit tests */
//#include "SafeBool.test.hh"
//#include "SafeBool.test.ih"
// Custom includes
#include "SafeBool.hh"
#include <boost/test/auto_unit_test.hpp>
#include <boost/test/test_tools.hpp>
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
namespace {
class TestTrue : public senf::SafeBool<TestTrue>
{
public:
bool boolean_test() const {
return true;
}
};
class TestFalse : public senf::SafeBool<TestFalse>
{
public:
bool boolean_test() const {
return false;
}
};
}
BOOST_AUTO_UNIT_TEST(safeBool)
{
BOOST_CHECK( TestTrue() );
BOOST_CHECK( ! TestFalse() );
}
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
// Local Variables:
// mode: c++
// fill-column: 100
// comment-column: 40
// c-file-style: "senf"
// indent-tabs-mode: nil
// ispell-local-dictionary: "american"
// compile-command: "scons -u test"
// End:
......@@ -26,6 +26,7 @@
//#include "TypeIdValue.ih"
// Custom includes
#include "TypeInfo.hh"
#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
......@@ -64,11 +65,23 @@ prefix_ std::string senf::TypeIdValue::name()
return std::string(value_->id().name());
}
prefix_ std::type_info const & senf::TypeIdValue::id()
const
{
return value_->id();
}
prefix_ senf::TypeIdValue const senf::typeIdValue()
{
return TypeIdValue();
}
prefix_ std::ostream & senf::operator<<(std::ostream & os, TypeIdValue const & v)
{
os << prettyName(v.id());
return os;
}
///////////////////////////////cci.e///////////////////////////////////////
#undef prefix_
......
......@@ -64,6 +64,7 @@ namespace senf {
bool operator<(TypeIdValue const & other) const;
std::string name() const;
std::type_info const & id() const;
protected:
......@@ -92,9 +93,7 @@ namespace senf {
template <class Type>
TypeIdValue const typeIdValue();
inline std::ostream & operator<<(std::ostream & os, TypeIdValue const & v)
{ return os << v.name(); }
std::ostream & operator<<(std::ostream & os, TypeIdValue const & v);
}
///////////////////////////////hh.e////////////////////////////////////////
......
// $Id$
//
// Copyright (C) 2007
// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
// Stefan Bund <g0dil@berlios.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the
// Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
\brief TypeIdValue.test unit tests */
//#include "TypeIdValue.test.hh"
//#include "TypeIdValue.test.ih"
// Custom includes
#include "TypeIdValue.hh"
#include <boost/test/auto_unit_test.hpp>
#include <boost/test/test_tools.hpp>
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
BOOST_AUTO_UNIT_TEST(typeIdValue)
{
// We don't care for the ordering, just that the following compiles
(void) ( senf::typeIdValue<int>() < senf::typeIdValue<float>() );
(void) ( senf::typeIdValue<int>() == senf::typeIdValue<float>() );
}
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
// Local Variables:
// mode: c++
// fill-column: 100
// comment-column: 40
// c-file-style: "senf"
// indent-tabs-mode: nil
// ispell-local-dictionary: "american"
// compile-command: "scons -u test"
// End:
......@@ -34,7 +34,7 @@
namespace senf {
/** \brief write the contents from Iterator i to i_end to the output stream in hexadecimal format.
/** \brief Write range [ i, i_end ) to output stream in hexadecimal format
*/
template <class Iterator>
void hexdump(Iterator i, Iterator i_end, std::ostream & stream, unsigned block_size=16);
......
// $Id$
//
// Copyright (C) 2007
// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
// Stefan Bund <g0dil@berlios.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the
// Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
\brief hexdump.test unit tests */
//#include "hexdump.test.hh"
//#include "hexdump.test.ih"
// Custom includes
#include "hexdump.hh"
#include <sstream>
#include <boost/test/auto_unit_test.hpp>
#include <boost/test/test_tools.hpp>
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
BOOST_AUTO_UNIT_TEST(hExDuMp)
{
char data[] = { 0x18, 0x19, 0x20, 0x21, 0x7c, 0x7d, 0x7e, 0x7f };
std::stringstream s;
senf::hexdump(data, data+sizeof(data), s, 8);
BOOST_CHECK_EQUAL( s.str(), " 0000 18 19 20 21 7c 7d 7e 7f .. ! |}..\n" );
}
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
// Local Variables:
// mode: c++
// fill-column: 100
// comment-column: 40
// c-file-style: "senf"
// indent-tabs-mode: nil
// ispell-local-dictionary: "american"
// compile-command: "scons -u test"
// End:
// $Id$
//
// Copyright (C) 2007
// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
// Stefan Bund <g0dil@berlios.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the
// Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
\brief pool_alloc_mixin.test unit tests */
//#include "pool_alloc_mixin.test.hh"
//#include "pool_alloc_mixin.test.ih"
// Custom includes
#include "pool_alloc_mixin.hh"
#include <boost/scoped_ptr.hpp>
#include <boost/test/auto_unit_test.hpp>
#include <boost/test/test_tools.hpp>
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
namespace {
class Test : public senf::pool_alloc_mixin<Test>
{};
}
BOOST_AUTO_UNIT_TEST(poolAllocMixin)
{
#ifndef NDEBUG
BOOST_CHECK_EQUAL( Test::allocCounter(), 0u );
{
boost::scoped_ptr<Test> test (new Test());
BOOST_CHECK_EQUAL( Test::allocCounter(), 1u );
}
BOOST_CHECK_EQUAL( Test::allocCounter(), 0u );
#endif
}
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
// Local Variables:
// mode: c++
// fill-column: 100
// comment-column: 40
// c-file-style: "senf"
// indent-tabs-mode: nil
// ispell-local-dictionary: "american"
// compile-command: "scons -u test"
// End:
// $Id$
//
// Copyright (C) 2007
// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
// Stefan Bund <g0dil@berlios.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the
// Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
\brief singleton.test unit tests */
//#include "singleton.test.hh"
//#include "singleton.test.ih"
// Custom includes
#include "singleton.hh"
#include <boost/test/auto_unit_test.hpp>
#include <boost/test/test_tools.hpp>
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
namespace {
class Test : public senf::singleton<Test>
{
friend class senf::singleton<Test>;
Test() : foo_(1234) {}
int foo_;
public:
using senf::singleton<Test>::instance;
int foo() { return foo_; }
};
}
BOOST_AUTO_UNIT_TEST(sInGlEtOn)
{
BOOST_CHECK_EQUAL( Test::instance().foo(), 1234 );
}
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
// Local Variables:
// mode: c++
// fill-column: 100
// comment-column: 40
// c-file-style: "senf"
// indent-tabs-mode: nil
// ispell-local-dictionary: "american"
// compile-command: "scons -u test"
// End:
debian/tmp/usr/lib/libSocket.a
debian/tmp/usr/include/Scheduler
debian/README usr/share/doc/libsenf-scheduler-dev
debian/tmp/usr/include/Socket
debian/README usr/share/doc/libsenf-socket-dev
File moved
......@@ -14,7 +14,7 @@ fi
cond=""
if [ "$1" = "-c" ]; then
shift
cond='( -name *.h -o -name *.hh -o -name *.ih -o -name *.c -o -name *.cc -o -name *.cci -o -name *.ct -o -name *.cti )'
cond='( -name *.h -o -name *.hh -o -name *.ih -o -name *.c -o -name *.cc -o -name *.cci -o -name *.ct -o -name *.cti -o -name *.mpp )'
fi
set -f
......
## \file
# \brief InstallIncludes builder
## \package senfscons.InstallIncludes
# \brief Install all include files which some targets depend upon
#
# \ingroup builder
import SCons.Builder, SCons.Action, SCons.Environment, SCons.Node.FS
def recursiveChildren(f):
rv = {}
map(rv.setdefault,f)
for c in f:
map(rv.setdefault,recursiveChildren(c.children()))
return rv.keys()
def filterIncludes(files, extensions):
return [ f for f in files
if f.get_suffix() in extensions ]
def filterDirectory(files, dir):
return [ f for f in files
if f.abspath.startswith(dir.abspath) ]
def excludeDirectories(files, dirs):
return [ f for f in files
if not [ True for d in dirs if files.abspath.startswith(dirs.abspath) ] ]
def emitter(target, source, env):
source = recursiveChildren(source)
source = filterIncludes(source, env['CPP_INCLUDE_EXTENSIONS'])
source = filterDirectory(source, env['INSTALL_BASE'])
source = excludeDirectories(source, env['INCLUDE_IGNORED_DIRECTORIES'])
# Build target file by appending the path of 'src' relative to INSTALL_BASE to target[0]
target = [ target[0].File(src.get_path(env.Dir(env['INSTALL_BASE'])))
for src in source ]
return (target, source)
class Installer:
def __init__(self, target, source):
self.target = target;
self.source = source
def __call__(self, target, source, env):
SCons.Environment.installFunc([self.target], [self.source], env)
def generator(target, source, env, for_signature):
return [ SCons.Action.Action( Installer(trg, src),
SCons.Environment.installString([trg], [src], env) )
for trg, src in zip(target,source) ]
InstallIncludes = SCons.Builder.Builder(emitter = emitter,
generator = generator,
source_factory = SCons.Node.FS.Entry,
target_factory = SCons.Node.FS.Dir,
name = 'InstallIncludesBuilder',
)
def generate(env):
env['BUILDERS']['InstallIncludes'] = InstallIncludes
env['INSTALL_BASE'] = '#'
env['INCLUDE_IGNORED_DIRECTORIES'] = []
def exists(env):
return 1
......@@ -50,6 +50,7 @@ SCONS_TOOLS = [
"Doxygen",
"Dia2Png",
"CopyToDir",
"InstallIncludes",
]
opts = None
......@@ -343,27 +344,28 @@ def Objects(env, sources, testSources = None, LIBS = [], OBJECTS = []):
return objects
def InstallWithSources(env, targets, dir, sources, testSources = []):
def InstallWithSources(env, targets, dir, sources, testSources = [], no_includes = False):
if type(sources) is type(()):
sources = sources[0] + sources[1]
if testSources:
sources += testSources
sources, testSources = sources
if type(sources) is not type([]):
sources = [ sources ]
if type(testSources) is not type([]):
testSources = [ testSources ]
installs = []
installs.append( env.Install(dir, targets) )
for source in sources:
l = len(env.Dir('#').abspath)
source = str(source)
while '.' in source:
source = os.path.splitext(source)[0]
for ext in env['CPP_INCLUDE_EXTENSIONS']:
f = env.File(source+ext)
if f.exists():
installs.append(env.Install(
'$INCLUDEINSTALLDIR' + f.dir.abspath[l:], f))
if not no_includes:
target = env.Dir(env['INCLUDEINSTALLDIR']).Dir(
env.Dir('.').get_path(env.Dir(env['INSTALL_BASE'])))
source = targets
if testSources:
source.append( env.File('.test.bin') )
installs.append(env.InstallIncludes(
target = target,
source = targets,
INSTALL_BASE = env.Dir('.') ))
return installs
......@@ -568,25 +570,25 @@ def DoxyXRef(env, docs=None,
# The library is added to the list of default targets.
#
#\ingroup target
def Lib(env, library, sources, testSources = None, LIBS = [], OBJECTS = []):
def Lib(env, library, sources, testSources = None, LIBS = [], OBJECTS = [], no_includes = False):
objects = Objects(env,sources,testSources,LIBS=LIBS,OBJECTS=OBJECTS)
lib = None
if objects:
lib = env.Library(env.File(LibPath(library)),objects)
env.Default(lib)
env.Append(ALLLIBS = library)
install = InstallWithSources(env, lib, '$LIBINSTALLDIR', sources)
install = InstallWithSources(env, lib, '$LIBINSTALLDIR', sources, testSources, no_includes)
env.Alias('install_all', install)
return lib
## \brief Build Object from multiple sources
def Object(env, target, sources, testSources = None, LIBS = [], OBJECTS = []):
def Object(env, target, sources, testSources = None, LIBS = [], OBJECTS = [], no_includes = False):
objects = Objects(env,sources,testSources,LIBS=LIBS,OBJECTS=OBJECTS)
ob = None
if objects:
ob = env.Command(target+".o", objects, "ld -r -o $TARGET $SOURCES")
env.Default(ob)
install = InstallWithSources(env, ob, '$OBJINSTALLDIR', sources)
install = InstallWithSources(env, ob, '$OBJINSTALLDIR', sources, testSources, no_includes)
env.Alias('install_all', install)
return ob
......@@ -600,7 +602,7 @@ def Object(env, target, sources, testSources = None, LIBS = [], OBJECTS = []):
# construction environment parameters or the framework helpers.
#
# \ingroup target
def Binary(env, binary, sources, testSources = None, LIBS = [], OBJECTS = []):
def Binary(env, binary, sources, testSources = None, LIBS = [], OBJECTS = [], no_includes = False):
objects = Objects(env,sources,testSources,LIBS=LIBS,OBJECTS=OBJECTS)
program = None
if objects:
......@@ -609,7 +611,7 @@ def Binary(env, binary, sources, testSources = None, LIBS = [], OBJECTS = []):
program = progEnv.Program(target=binary,source=objects+OBJECTS)
env.Default(program)
env.Depends(program, [ env.File(LibPath(x)) for x in LIBS ])
install = InstallWithSources(env, program, '$BININSTALLDIR',
sources, testSources)
install = InstallWithSources(env, program, '$BININSTALLDIR', sources, testSources,
no_includes)
env.Alias('install_all', install)
return program
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment