SCons driven build system: Skeleton
To find out if SCons is suitable for Cinelerra's build system, I'll try to write a protorype, including platform configuration support, installing and support for packaging.
This commit is contained in:
parent
b32425820d
commit
37a38f976d
2 changed files with 110 additions and 0 deletions
29
Buildhelper.py
Normal file
29
Buildhelper.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# -*- python -*-
|
||||
##
|
||||
## Buildhelper.py - helpers, custom builders, for SConstruct
|
||||
##
|
||||
|
||||
# Copyright (C) CinelerraCV
|
||||
# 2007, Hermann Vosseler <Ichthyostega@web.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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#####################################################################
|
||||
|
||||
|
||||
#
|
||||
# Common Helper Functions
|
||||
#
|
||||
def isCleanupOperation(env):
|
||||
return env.GetOption('clean')
|
||||
81
SConstruct
Normal file
81
SConstruct
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
# -*- python -*-
|
||||
##
|
||||
## SConstruct - SCons based build-sytem for Cinelerra
|
||||
##
|
||||
|
||||
# Copyright (C) CinelerraCV
|
||||
# 2007, Hermann Vosseler <Ichthyostega@web.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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#####################################################################
|
||||
|
||||
from Buildhelper import *
|
||||
|
||||
|
||||
# NOTE: the following code /defines/ what and how to build
|
||||
# it doesn't "do" the build. SCons will do the "doing"
|
||||
|
||||
env = setupBasicEnvironment()
|
||||
|
||||
if not isCleanupOperation(env):
|
||||
configurePlatform(env)
|
||||
|
||||
artifacts = {}
|
||||
# the various things we build.
|
||||
# Each entry actually is a SCons-Node list.
|
||||
# Passing these entries to other builders defines dependencies.
|
||||
# 'cinelerra' : the App
|
||||
# 'plugins' : plugin shared lib
|
||||
# 'tools' : small tool applications (e.g mpegtoc)
|
||||
# 'src,tar' : source tree as tarball (without doc)
|
||||
# 'devdoc.tar' : uml model, wiki, dev docu (no src)
|
||||
|
||||
definePackagingTargets(env, artifacts)
|
||||
defineBuildTargets(env, artifacts)
|
||||
defineInstallTargets(env, artifacts)
|
||||
|
||||
|
||||
#####################################################################
|
||||
|
||||
def setupBasicEnvironment():
|
||||
''' define cmdline options, decide build type
|
||||
'''
|
||||
|
||||
|
||||
def configurePlatform(env):
|
||||
''' locate required libs.
|
||||
setup platform specific options.
|
||||
Abort build in case of failure.
|
||||
'''
|
||||
|
||||
|
||||
def definePackagingTargets(env, artifacts):
|
||||
''' build operations and targets to be done /before/ compiling.
|
||||
things like creating a source tarball or preparing a version header.
|
||||
'''
|
||||
|
||||
|
||||
def defineBuildTargets(env, artifacts):
|
||||
''' define the source file/dirs comprising each artifact to be built.
|
||||
setup sub-environments with special build options if necessary
|
||||
'''
|
||||
|
||||
|
||||
def defineInstallTargets(env, artifacts):
|
||||
''' define install locations and cleanup after the build.
|
||||
define alias targets to trigger the installing.
|
||||
'''
|
||||
|
||||
|
||||
Loading…
Reference in a new issue