Exemplo n.º 1
0
    def build_all(self, env, glob_build, srcroot, bindir, libdir, pkgdir):
        if glob_build:
            env = env.Clone()

        # Needed for both C and F90 programs:
        bldroot = '../..'  # aka RSFSRC/build

        if not glob_build:
            bldroot = env.get('RSFROOT', os.environ.get('RSFROOT', sys.prefix))
            if self.f90:
                SConscript(os.path.join(srcroot, 'api', 'f90', 'SConstruct'))
            else:
                SConscript(os.path.join(srcroot, 'api', 'c', 'SConstruct'))

        if not self.c:
            docs_c = []
        else:
            docs_c = build_install_c(env, self.c, srcroot, bindir, libdir,
                                     glob_build, bldroot)

        if self.c_place:
            docs_c += [
                env.Doc(prog, 'M' + prog) for prog in Split(self.c_place)
            ]

        if not self.c_mpi:
            docs_c_mpi = None
        else:
            docs_c_mpi = build_install_c_mpi(env, self.c_mpi, srcroot, bindir,
                                             glob_build, bldroot)

        api = env.get('API', [])
        if not self.f90:
            docs_f90 = None
        else:
            docs_f90 = build_install_f90(env, self.f90, srcroot, bindir, api,
                                         bldroot, glob_build)

        if glob_build:
            if not self.py:
                docs_py = None
            else:
                docs_py = install_py_mains(env, self.py, bindir)
            if self.py_modules:
                install_py_modules(env, self.py_modules, pkgdir)

            if self.jl:
                install_jl_mains(env, self.jl, bindir)

            install_self_doc(env, pkgdir, docs_c, docs_py, docs_f90,
                             docs_c_mpi)
Exemplo n.º 2
0
def BuildFrameworks(env, frameworks):
    if not frameworks:
        return

    if "BOARD" not in env:
        sys.stderr.write("Please specify `board` in `platformio.ini` to use "
                         "with '%s' framework\n" % ", ".join(frameworks))
        env.Exit(1)

    board_frameworks = env.BoardConfig().get("frameworks", [])
    if frameworks == ["platformio"]:
        if board_frameworks:
            frameworks.insert(0, board_frameworks[0])
        else:
            sys.stderr.write(
                "Error: Please specify `board` in `platformio.ini`\n")
            env.Exit(1)

    for f in frameworks:
        if f == "arduino":
            # Arduino IDE appends .o the end of filename
            Builder.match_splitext = scons_patched_match_splitext
            if "nobuild" not in COMMAND_LINE_TARGETS:
                env.ConvertInoToCpp()

        if f in board_frameworks:
            SConscript(env.GetFrameworkScript(f), exports="env")
        else:
            sys.stderr.write(
                "Error: This board doesn't support %s framework!\n" % f)
            env.Exit(1)
Exemplo n.º 3
0
 def subproject(self, project, env, conf):  #pylint: disable=C0103, R0201,W0613
     """
     Build the Subproject with name project
     """
     #pylint: disable=E1102
     SConscript(sconscript_path(project),
                exports=['project', 'env', 'conf'])  # pylint: disable=E0602, C0301
Exemplo n.º 4
0
def AutoPacketBundle(env, name, exclude=[], subdirs=[], doc_extra_sources=[]):
    import SENFSCons

    sources, tests, includes = SENFSCons.Glob(env,
                                              exclude=((exclude)),
                                              subdirs=((subdirs)))
    subscripts = sorted(env.Glob("*/SConscript", strings=True))
    doxyfile = env.Glob("Doxyfile")

    objects = env.Object(sources)
    cobject = env.CombinedObject('${LOCALLIBDIR}/${NAME}${OBJADDSUFFIX}',
                                 objects,
                                 NAME=((name)))
    sobundle = env.SharedLibrary('${LOCALLIBDIR}/${NAME}${OBJADDSUFFIX}',
                                 sources,
                                 NAME=((name)),
                                 LIBS=[],
                                 SHLIBPREFIX='')

    env.Default(cobject)
    env.Default(sobundle)
    env.Append(ALLOBJECTS=objects, PACKET_BUNDLES=cobject)
    env.Install('$OBJINSTALLDIR', cobject)
    env.Install('$OBJINSTALLDIR', sobundle)

    if tests: env.BoostUnitTest('test', tests + cobject)
    if includes: env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
    if doxyfile: SENFSCons.Doxygen(env, extra_sources=((doc_extra_sources)))
    if subscripts: SConscript(subscripts)
Exemplo n.º 5
0
def generate(env):
    # 1.) find the infusor directory
    sconscript = os.path.join(env['OFT_SCONS_TOOLS'], '..', 'infuser',
                              'SConscript')
    if not os.path.isfile(sconscript):
        env.Error("Could not find the infuser. `{}` does not exist.".format(
            sconscript))
        exit(1)

    # 2.) build infusor string
    jar = SConscript([sconscript], exports='env')
    env['INFUSER_JAR'] = jar

    # 3.) create the infusion builder
    infusion_builder = SCons.Builder.Builder(
        generator=infusion_action_generator,
        emitter=infusion_emitter,
        target_factory=SCons.Node.FS.Dir,
        source_factory=SCons.Node.FS.Entry)

    env.Append(BUILDERS={'Infusion': infusion_builder})

    # 4.) add ostfriesentee pseudo builders
    env.AddMethod(ostfriesentee_library_method, 'OstfriesenteeLibrary')
    env.AddMethod(ostfriesentee_application_method, 'OstfriesenteeApplication')
def BuildFrameworks(env, frameworks):
    if not frameworks:
        return

    if "BOARD" not in env:
        sys.stderr.write("Please specify `board` in `platformio.ini` to use "
                         "with '%s' framework\n" % ", ".join(frameworks))
        env.Exit(1)

    board_frameworks = env.BoardConfig().get("frameworks", [])
    if frameworks == ["platformio"]:
        if board_frameworks:
            frameworks.insert(0, board_frameworks[0])
        else:
            sys.stderr.write(
                "Error: Please specify `board` in `platformio.ini`\n")
            env.Exit(1)

    for f in frameworks:
        if f in ("arduino", "energia"):
            env.ConvertInoToCpp()

        if f in board_frameworks:
            SConscript(env.GetFrameworkScript(f))
        else:
            sys.stderr.write(
                "Error: This board doesn't support %s framework!\n" % f)
            env.Exit(1)
Exemplo n.º 7
0
    def initialize(cls,
                   packageName,
                   versionString=None,
                   eupsProduct=None,
                   eupsProductPath=None,
                   cleanExt=None,
                   versionModuleName="python/lsst/%s/version.py",
                   noCfgFile=False,
                   sconscriptOrder=None):
        if cls._initializing:
            state.log.fail(
                "Recursion detected; an SConscript file should not call BasicSConstruct."
            )
        cls._initializing = True
        if cleanExt is None:
            cleanExt = r"*~ core *.so *.os *.o *.pyc *.pkgc"
        dependencies.configure(packageName, versionString, eupsProduct,
                               eupsProductPath, noCfgFile)
        state.env.BuildETags()
        state.env.CleanTree(cleanExt)
        if versionModuleName is not None:
            try:
                versionModuleName = versionModuleName % "/".join(
                    packageName.split("_"))
            except TypeError:
                pass
            state.targets["version"] = state.env.VersionModule(
                versionModuleName)
        scripts = []
        for root, dirs, files in os.walk("."):
            if "SConstruct" in files and root != ".":
                dirs[:] = []
                continue
            dirs[:] = [d for d in dirs if not d.startswith('.')]
            dirs.sort(
            )  # os.walk order is not specified, but we want builds to be deterministic
            if "SConscript" in files:
                scripts.append(os.path.join(root, "SConscript"))
        if sconscriptOrder is None:
            sconscriptOrder = ("lib", "python", "tests", "examples", "doc")

        def key(path):
            for i, item in enumerate(sconscriptOrder):
                if path.lstrip("./").startswith(item):
                    return i
            return len(sconscriptOrder)

        scripts.sort(key=key)
        for script in scripts:
            state.log.info("Using SConscript at %s" % script)
            SConscript(script)
        cls._initializing = False
        return state.env
Exemplo n.º 8
0
def AutoRules(env, exclude=[], subdirs=[], doc_extra_sources=[]):
    import SENFSCons

    sources, tests, includes = SENFSCons.Glob(env,
                                              exclude=((exclude)),
                                              subdirs=((subdirs)))
    subscripts = sorted(env.Glob("*/SConscript", strings=True))
    doxyfile = env.Glob("Doxyfile")

    if sources: env.Append(ALLOBJECTS=env.Object(sources))
    if tests: env.BoostUnitTest('test', tests)
    if includes: env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
    if doxyfile: SENFSCons.Doxygen(env, extra_sources=((doc_extra_sources)))
    if subscripts: SConscript(subscripts)
Exemplo n.º 9
0
def ProcessGeneral(env):
    corelibs = []
    if "BUILD_FLAGS" in env:
        env.MergeFlags(env['BUILD_FLAGS'])

    if "FRAMEWORK" in env:
        if env['FRAMEWORK'] in ("arduino", "energia"):
            env.ConvertInoToCpp()
        SConscriptChdir(0)
        corelibs = SConscript(env.subst(
            join("$PIOBUILDER_DIR", "scripts", "frameworks",
                 "${FRAMEWORK}.py")),
                              exports="env")
    return corelibs
Exemplo n.º 10
0
def BuildFramework(env):
    if "FRAMEWORK" not in env or "uploadlazy" in COMMAND_LINE_TARGETS:
        return

    if env['FRAMEWORK'].lower() in ("arduino", "energia"):
        env.ConvertInoToCpp()

    for f in env['FRAMEWORK'].split(","):
        framework = f.strip().lower()
        if framework in env.get("BOARD_OPTIONS", {}).get("frameworks"):
            SConscript(
                env.subst(
                    join("$PIOBUILDER_DIR", "scripts", "frameworks",
                         "%s.py" % framework)))
        else:
            Exit("Error: This board doesn't support %s framework!" % framework)
Exemplo n.º 11
0
    def initialize(cls, packageName, versionString=None, eupsProduct=None, eupsProductPath=None,
                   cleanExt=None, versionModuleName="python/lsst/%s/version.py", noCfgFile=False,
                   sconscriptOrder=None, disableCc=False):
        if not disableCc:
            state._configureCommon()
            state._saveState()
        if cls._initializing:
            state.log.fail("Recursion detected; an SConscript file should not call BasicSConstruct.")
        cls._initializing = True
        dependencies.configure(packageName, versionString, eupsProduct, eupsProductPath, noCfgFile)
        state.env.BuildETags()
        if cleanExt is None:
            cleanExt = r"*~ core core.[1-9]* *.so *.os *.o *.pyc *.pkgc"
        state.env.CleanTree(cleanExt, ".cache __pycache__ .pytest_cache")
        if versionModuleName is not None:
            try:
                versionModuleName = versionModuleName % "/".join(packageName.split("_"))
            except TypeError:
                pass
            state.targets["version"] = state.env.VersionModule(versionModuleName)
        scripts = []
        for root, dirs, files in os.walk("."):
            if "SConstruct" in files and root != ".":
                dirs[:] = []
                continue
            dirs[:] = [d for d in dirs if not d.startswith('.')]
            dirs.sort()  # os.walk order is not specified, but we want builds to be deterministic
            if "SConscript" in files:
                scripts.append(os.path.join(root, "SConscript"))
        if sconscriptOrder is None:
            sconscriptOrder = DEFAULT_TARGETS

        # directory for shebang target is bin.src
        sconscriptOrder = [t if t != "shebang" else "bin.src" for t in sconscriptOrder]

        def key(path):
            for i, item in enumerate(sconscriptOrder):
                if path.lstrip("./").startswith(item):
                    return i
            return len(sconscriptOrder)
        scripts.sort(key=key)
        for script in scripts:
            state.log.info("Using SConscript at %s" % script)
            SConscript(script)
        cls._initializing = False
        return state.env
Exemplo n.º 12
0
def ProcessGeneral(env):
    corelibs = []
    if "BUILD_FLAGS" in env:
        env.MergeFlags(env['BUILD_FLAGS'])

    env.PrependENVPath(
        "PATH", join(env.subst("$PLATFORMTOOLS_DIR"), "toolchain", "bin"))

    if "FRAMEWORK" in env:
        if env['FRAMEWORK'] in ("arduino", "energia"):
            env.ConvertInotoCpp()
        SConscriptChdir(0)
        corelibs = SConscript(env.subst(
            join("$PIOBUILDER_DIR", "scripts", "frameworks",
                 "${FRAMEWORK}.py")),
                              exports="env")
    return corelibs
Exemplo n.º 13
0
def BuildFrameworks(env, frameworks):
    if not frameworks or "uploadlazy" in COMMAND_LINE_TARGETS:
        return

    board_frameworks = env.get("BOARD_OPTIONS", {}).get("frameworks", [])
    if frameworks == ["platformio"]:
        if board_frameworks:
            frameworks.insert(0, board_frameworks[0])
        else:
            env.Exit("Error: Please specify board type")

    for f in frameworks:
        if f in ("arduino", "energia"):
            env.ConvertInoToCpp()

        if f in board_frameworks:
            SConscript(env.subst(
                join("$PIOBUILDER_DIR", "scripts", "frameworks", "%s.py" % f)))
        else:
            env.Exit("Error: This board doesn't support %s framework!" % f)
Exemplo n.º 14
0
def _build_units(env, units):
    """
    For each given unit, check the build manifest to see if it has been
    built. If not, execute the unit's SConscript.
    """
    project_dir = _get_project_dir(env)
    for unit in Flatten([units]):
        unit_name = _get_unit_name(env, unit)
        if env['X_BUILD_MANIFEST'].has_key(unit_name):
            continue
        unit_dir = os.path.join(project_dir, unit_name)
        variant_dir = os.path.join(project_dir, 'build', _get_variant(env),
                                   unit_name)
        SConscript(dirs=unit_dir,
                   exports='env',
                   variant_dir=variant_dir,
                   duplicate=0)
        # Make sure that the build manifest has been updated.
        if not env['X_BUILD_MANIFEST'].has_key(unit_name):
            env['X_BUILD_MANIFEST'][unit_name] = {}
Exemplo n.º 15
0
def build_library(tile, libname, chip):
    """Build a static ARM cortex library"""

    dirs = chip.build_dirs()

    output_name = '%s_%s.a' % (libname, chip.arch_name())

    # Support both firmware/src and just src locations for source code
    if os.path.exists('firmware'):
        VariantDir(dirs['build'], os.path.join('firmware', 'src'), duplicate=0)
    else:
        VariantDir(dirs['build'], 'src', duplicate=0)

    library_env = setup_environment(chip)
    library_env['OUTPUT'] = output_name
    library_env['OUTPUT_PATH'] = os.path.join(dirs['build'], output_name)
    library_env['BUILD_DIR'] = dirs['build']

    # Check for any dependencies this library has
    tilebus_defs = setup_dependencies(tile, library_env)

    # Create header files for all tilebus config variables and commands that are defined in ourselves
    # or in our dependencies
    tilebus_defs += tile.find_products('tilebus_definitions')
    compile_tilebus(tilebus_defs, library_env, header_only=True)

    SConscript(os.path.join(dirs['build'], 'SConscript'),
               exports='library_env')

    library_env.InstallAs(os.path.join(dirs['output'], output_name),
                          os.path.join(dirs['build'], output_name))

    # See if we should copy any files over to the output:
    for src, dst in chip.property('copy_files', []):
        srcpath = os.path.join(*src)
        destpath = os.path.join(dirs['output'], dst)
        library_env.InstallAs(destpath, srcpath)

    return os.path.join(dirs['output'], output_name)
Exemplo n.º 16
0
    "-<test%s>" % sep,
    "-<tests%s>" % sep
])


def LookupSources(env, variant_dir, src_dir, duplicate=True, src_filter=None):
    return env.CollectBuildFiles(variant_dir, src_dir, src_filter, duplicate)


def VariantDirWrap(env, variant_dir, src_dir, duplicate=False):
    env.VariantDir(variant_dir, src_dir, duplicate)


env = DefaultEnvironment()

env.AddMethod(LookupSources)
env.AddMethod(VariantDirWrap)

env.Replace(
    PLATFORMFW_DIR=env.PioPlatform().get_package_dir("framework-simba"))

env.Append(UPLOADERFLAGS=[
    "0x1000",
    join("$PLATFORMFW_DIR", "3pp", "esp32", "bin", "bootloader.bin"), "0x4000",
    join("$PLATFORMFW_DIR", "3pp", "esp32", "bin", "partitions_singleapp.bin"),
    "0x10000"
])

SConscript(
    [env.subst(join("$PLATFORMFW_DIR", "make", "platformio.sconscript"))])
Exemplo n.º 17
0
Arquivo: A21A.py Projeto: OS-Q/E21
import sys
from os.path import join, isfile

from SCons.Script import DefaultEnvironment, SConscript

env = DefaultEnvironment()
mcu = env.BoardConfig().get("build.mcu")
core = env.BoardConfig().get("build.core", "")

if core == "maple":
    build_script = join(
        env.PioPlatform().get_package_dir("A21B"),
        "tools", "build-%s.py" % mcu[0:7])
elif core == "stm32l0":
    build_script = join(
        env.PioPlatform().get_package_dir("A21C"),
        "tools", "build.py")
else:
    build_script = join(env.PioPlatform().get_package_dir(
        "A21A"), "tools", "build.py")

if not isfile(build_script):
    sys.stderr.write("Error: Missing PlatformIO build script %s!\n" % build_script)
    env.Exit(1)

SConscript(build_script)
Exemplo n.º 18
0
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Arduino

Arduino Wiring-based Framework allows writing cross-platform software to
control devices attached to a wide range of Arduino boards to create all
kinds of creative coding, interactive objects, spaces or physical experiences.

http://arduino.cc/en/Reference/HomePage
"""

from os.path import join

from SCons.Script import DefaultEnvironment, SConscript

env = DefaultEnvironment()

SConscript("_embedtxt_files.py", exports="env")

if "espidf" not in env.subst("$PIOFRAMEWORK"):
    SConscript(
        join(DefaultEnvironment().PioPlatform().get_package_dir(
            "framework-arduinoespressif32"), "tools", "platformio-build.py"))
Exemplo n.º 19
0
from os.path import join

from SCons.Script import Import, SConscript

Import("env")

SConscript(join(env.PioPlatform().get_package_dir("zephyros"), "scripts",
                "OSQ", "build.py"),
           exports="env")
Exemplo n.º 20
0
        env.Exit("Error: %s" % str(e))

    if "BOARD_MCU" not in env:
        env.Replace(BOARD_MCU="${BOARD_OPTIONS['build']['mcu']}")
    if "BOARD_F_CPU" not in env:
        env.Replace(BOARD_F_CPU="${BOARD_OPTIONS['build']['f_cpu']}")
    if "UPLOAD_PROTOCOL" not in env:
        env.Replace(
            UPLOAD_PROTOCOL="${BOARD_OPTIONS['upload'].get('protocol', None)}")
    if "UPLOAD_SPEED" not in env:
        env.Replace(
            UPLOAD_SPEED="${BOARD_OPTIONS['upload'].get('speed', None)}")
    if "ldscript" in env.get("BOARD_OPTIONS", {}).get("build", {}):
        env.Replace(
            LDSCRIPT_PATH=join(
                "$PIOHOME_DIR", "packages", "ldscripts",
                "${BOARD_OPTIONS['build']['ldscript']}"
            )
        )

if "IGNORE_LIBS" in env:
    env['IGNORE_LIBS'] = [l.strip() for l in env['IGNORE_LIBS'].split(",")]

env.PrependENVPath(
    "PATH",
    env.subst(join("$PIOPACKAGES_DIR", "$PIOPACKAGE_TOOLCHAIN", "bin"))
)

SConscriptChdir(0)
SConscript(env.subst("$BUILD_SCRIPT"))
Exemplo n.º 21
0
Arquivo: main.py Projeto: OS-Q/S02
    env.Replace(PROGNAME="firmware")

env.Append(BUILDERS=dict(DataToBin=Builder(action=env.VerboseAction(
    " ".join([
        "$PYTHONEXE",
        join(PULP_TOOLS_DIR, "bin",
             "flashImageBuilder"), "--flash-boot-binary", "$SOURCES",
        "--comp-dir-rec", "$PROJECTDATA_DIR", "--raw", "$TARGET"
    ]), "Building data image $TARGET"),
                                           suffix=".bin")))

#
# Autotiler
#

SConscript("autotiler.py", exports={"env": env})

#
# Target: Build executable, linkable firmware and data image
#

target_elf = None
if "nobuild" in COMMAND_LINE_TARGETS:
    target_elf = join("$BUILD_DIR", "${PROGNAME}.elf")
else:
    target_elf = env.BuildProgram()

if "uploadfs" in COMMAND_LINE_TARGETS:
    data_dir = env.subst("$PROJECTDATA_DIR")
    if not (isdir(data_dir) and listdir(data_dir)):
        sys.stderr.write(
Exemplo n.º 22
0
control devices attached to a wide range of Arduino boards to create all
kinds of creative coding, interactive objects, spaces or physical experiences.

http://www.stm32duino.com
"""

import sys
from os.path import join, isfile

from SCons.Script import DefaultEnvironment, SConscript

env = DefaultEnvironment()
mcu = env.BoardConfig().get("build.mcu")
core = env.BoardConfig().get("build.core", "")

if core == "maple":
    build_script = join(
        env.PioPlatform().get_package_dir("framework-arduinoststm32-maple"),
        "tools", "platformio-build-%s.py" % mcu[0:7])
    if isfile(build_script):
        SConscript(build_script)
    else:
        sys.stderr.write("Error: %s family is not supported by maple core\n" %
                         mcu[0:7])
        env.Exit(1)

else:
    SConscript(
        join(env.PioPlatform().get_package_dir("framework-arduinoststm32"),
             "tools", "platformio-build.py"))
Exemplo n.º 23
0
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Arduino

Arduino Wiring-based Framework allows writing cross-platform software to
control devices attached to a wide range of Arduino boards to create all
kinds of creative coding, interactive objects, spaces or physical experiences.

http://arduino.cc/en/Reference/HomePage
"""

from os.path import join

from SCons.Script import DefaultEnvironment, SConscript

SConscript(
    #    join(DefaultEnvironment().PioPlatform().get_package_dir(
    #        "framework-arduinoespressif32"), "tools", "platformio-build.py"))
    #    join("https://github.com/espressif/arduino-esp32/tree/stickbreaker-i2c", "tools", "platformio-build.py"))
    join("https://github.com/stickbreaker/arduino-esp32", "tools",
         "platformio-build.py"))
Exemplo n.º 24
0
# Copyright 2014-present PlatformIO <*****@*****.**>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Arduino

Arduino Wiring-based Framework allows writing cross-platform software to
control devices attached to a wide range of Arduino boards to create all
kinds of creative coding, interactive objects, spaces or physical experiences.
"""

import sys
from os.path import join, isfile

from SCons.Script import DefaultEnvironment, SConscript

env = DefaultEnvironment()
SConscript(
    join(env.PioPlatform().get_package_dir("framework-arduinolinkit7697"),
         "tools", "platformio-build.py"))
Exemplo n.º 25
0
Arquivo: mbed.py Projeto: OS-Q/S02
# Copyright 2018-present PIO Plus <*****@*****.**>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from os.path import join

from SCons.Script import Import, SConscript

Import("env")

SConscript(join(env.PioPlatform().get_package_dir("framework-gap_sdk"),
                "PlatformIO", "build-mbed.py"),
           exports={"env": env})
Exemplo n.º 26
0
            ) else join("$PIOHOME_DIR", "packages", "ldscripts",
                        "${BOARD_OPTIONS['build']['ldscript']}")))

    if env['PLATFORM'] != env.get("BOARD_OPTIONS", {}).get("platform"):
        Exit("Error: '%s' platform doesn't support this board. "
             "Use '%s' platform instead." %
             (env['PLATFORM'], env.get("BOARD_OPTIONS", {}).get("platform")))

for opt in ("LIB_IGNORE", "LIB_USE"):
    if opt not in env:
        continue
    env[opt] = [l.strip() for l in env[opt].split(",") if l.strip()]

env.PrependENVPath(
    "PATH", env.subst(join("$PIOPACKAGES_DIR", "$PIOPACKAGE_TOOLCHAIN",
                           "bin")))

SConscriptChdir(0)
SConscript(env.subst("$BUILD_SCRIPT"))

if getenv("PLATFORMIO_EXTRA_SCRIPT", env.get("EXTRA_SCRIPT", None)):
    SConscript(getenv("PLATFORMIO_EXTRA_SCRIPT", env.get("EXTRA_SCRIPT")))

if "envdump" in COMMAND_LINE_TARGETS:
    print env.Dump()
    Exit()

if "idedata" in COMMAND_LINE_TARGETS:
    print json.dumps(env.DumpIDEData())
    Exit()
Exemplo n.º 27
0
# Copyright (C) Ivan Kravets <*****@*****.**>
# See LICENSE for details.
"""
    Builder for Freescale Kinetis series ARM microcontrollers.
"""

from os.path import join

from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default,
                          DefaultEnvironment, SConscript)

env = DefaultEnvironment()

SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py")))

#
# Target: Build executable and linkable firmware
#

target_elf = env.BuildProgram()

#
# Target: Build the .bin file
#

if "uploadlazy" in COMMAND_LINE_TARGETS:
    target_firm = join("$BUILD_DIR", "firmware.bin")
else:
    target_firm = env.ElfToBin(join("$BUILD_DIR", "firmware"), target_elf)

#
Exemplo n.º 28
0
from os.path import join

from SCons.Script import Import, SConscript

Import("env")

# https://github.com/platformio/builder-framework-mbed.git
SConscript(
    join(env.PioPlatform().get_package_dir("framework-mbed"), "platformio",
         "platformio-build.py"))
Exemplo n.º 29
0
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Arduino

Arduino Wiring-based Framework allows writing cross-platform software to
control devices attached to a wide range of Arduino boards to create all
kinds of creative coding, interactive objects, spaces or physical experiences.

http://arduino.cc/en/Reference/HomePage
"""

from os.path import join

from SCons.Script import COMMAND_LINE_TARGETS, DefaultEnvironment, SConscript

if "nobuild" not in COMMAND_LINE_TARGETS:
    SConscript(
        join(
            DefaultEnvironment().PioPlatform().get_package_dir(
                "framework-arduinoespressif8266"), "tools",
            "platformio-build.py"))
Exemplo n.º 30
0
Arquivo: zephyr.py Projeto: OS-Q/P215
from os.path import join

from SCons.Script import Import, SConscript

Import("env")

SConscript(join(env.PioPlatform().get_package_dir("framework-zephyr"),
                "scripts", "platformio", "platformio-build.py"),
           exports="env")