Changeset 1a2fcaf in rtems-central


Ignore:
Timestamp:
Apr 15, 2020, 11:37:01 AM (13 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
8164bd4
Parents:
9667971
git-author:
Sebastian Huber <sebastian.huber@…> (04/15/20 11:37:01)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/16/20 18:54:53)
Message:

build: New module

Files:
8 added
3 edited

Legend:

Unmodified
Added
Removed
  • config.ini

    r9667971 r1a2fcaf  
     1build:
     2  arch: sparc
     3  bsp: leon3
     4  enabled:
     5  - RTEMS_QUAL
     6  - RTEMS_SMP
     7  source-directory: external/rtems
     8  sources:
     9  - bsps/shared/cache/cacheimpl.h
     10  - bsps/shared/dev/clock/clockimpl.h
     11  - cpukit/libcsupport/src/malloc_p.h
     12  - cpukit/libtest/t-test-rtems.h
     13  - cpukit/score/cpu/sparc/syscall.h
     14  - cpukit/score/src/opt_compat.h
     15  - cpukit/score/src/opt_ffclock.h
     16  - cpukit/score/src/opt_ntp.h
     17  - gccdeps.py
     18  - long_gcc.py
     19  - waf
     20  - wscript
     21  uids:
     22  - RTEMS-BUILD-CPUKIT-LIBRTEMSCPU
     23  - RTEMS-BUILD-CPUKIT-LIBRTEMSTEST
     24  - RTEMS-BUILD-TEST-VAL-GRP
     25  workspace-directory: workspace/rtems
    126spec:
    227  cache-directory: cache
  • rtems_spec_to_x.py

    r9667971 r1a2fcaf  
    2626# POSSIBILITY OF SUCH DAMAGE.
    2727
     28import os
     29import shutil
     30import subprocess
     31from typing import List
    2832import yaml
    2933
    3034import rtemsqual.applconfig
    31 import rtemsqual.items
     35import rtemsqual.build
     36from rtemsqual.items import ItemCache
    3237import rtemsqual.glossary
    3338
    3439
    35 def main():
     40def _run_command(args: List[str], cwd: str) -> int:
     41    task = subprocess.Popen(args,
     42                            stdout=subprocess.PIPE,
     43                            stderr=subprocess.STDOUT,
     44                            cwd=cwd)
     45    while True:
     46        line = task.stdout.readline()
     47        if line:
     48            print(line.decode("utf-8").strip())
     49        elif task.poll() is not None:
     50            break
     51    return task.wait()
     52
     53
     54def _run_pre_qualified_only_build(config: dict, item_cache: ItemCache) -> None:
     55    files = rtemsqual.build.gather_files(config, item_cache)
     56    source_dir = config["source-directory"]
     57    workspace_dir = config["workspace-directory"]
     58    for a_file in files:
     59        src = os.path.join(source_dir, a_file)
     60        dst = os.path.join(workspace_dir, a_file)
     61        os.makedirs(os.path.dirname(dst), exist_ok=True)
     62        shutil.copy2(src, dst)
     63    with open(os.path.join(workspace_dir, "config.ini"), "w") as config_ini:
     64        config_ini.write(f"""[{config["arch"]}/{config["bsp"]}]
     65RTEMS_SMP = True
     66RTEMS_QUAL = True
     67RTEMS_QUAL_ONLY = True
     68BUILD_TESTS = False
     69BUILD_VALIDATIONTESTS = True
     70""")
     71    specs = os.path.relpath(os.path.join(source_dir, "spec"), workspace_dir)
     72    _run_command(["./waf", "configure", "--rtems-specs", specs], workspace_dir)
     73    _run_command(["./waf"], workspace_dir)
     74
     75
     76def main() -> None:
    3677    """ Generates glossaries of terms according to the configuration. """
    3778    with open("config.ini", "r") as out:
    3879        config = yaml.safe_load(out.read())
    39     item_cache = rtemsqual.items.ItemCache(config["spec"])
     80    item_cache = ItemCache(config["spec"])
    4081    rtemsqual.glossary.generate(config["glossary"], item_cache)
    4182    rtemsqual.applconfig.generate(config["appl-config"], item_cache)
     83    _run_pre_qualified_only_build(config["build"], item_cache)
    4284
    4385
  • rtemsqual/__init__.py

    r9667971 r1a2fcaf  
    2525# POSSIBILITY OF SUCH DAMAGE.
    2626
    27 __all__ = ["content", "glossary", "items"]
     27__all__ = ["applconfig", "build", "content", "glossary", "items"]
    2828
     29import rtemsqual.applconfig
     30import rtemsqual.build
    2931import rtemsqual.content
    3032import rtemsqual.glossary
Note: See TracChangeset for help on using the changeset viewer.