コード例 #1
0
ファイル: ninja_backend.py プロジェクト: ptpan/mflowgen
    def gen_step_post_conditions(s, command, deps, extra_deps):

        all_deps = deps + extra_deps

        # Extract the build directory from the command so we can create a
        # unique rule name

        tokens = command.split()
        cd_idx = tokens.index('cd')
        build_dir = tokens[cd_idx + 1]

        rule = build_dir + '-post-conditions-commands-rule'
        rule = rule.replace('-', '_')

        description = build_dir + ': Checking post-conditions...'

        # Stamp the build directory

        outputs = [build_dir + '/.postconditions.stamp']

        command = \
          command + ' && touch ' + build_dir + '/.postconditions.stamp'

        # Rules

        targets = ninja_execute(
            w=s.w,
            outputs=outputs,
            rule=rule,
            command=command,
            description=description,
            deps=all_deps,
        )

        return targets
コード例 #2
0
ファイル: ninja_backend.py プロジェクト: ptpan/mflowgen
    def gen_step_debug(s, target, command, build_id):

        # Rules

        debug_rule = build_id + '-debug-rule'
        debug_rule = debug_rule.replace('-', '_')

        ninja_execute(
            w=s.w,
            outputs=[target],
            rule=debug_rule,
            command=command,
            pool='console',
        )

        # Track debug targets for list command

        s.debug_targets.update({build_id: target})
コード例 #3
0
  def gen_step_execute( s, outputs, command, deps, extra_deps,
                                                     phony=False ):

    all_deps = deps + extra_deps

    # Extract the build directory from the command so we can create a
    # unique rule name

    tokens    = command.split()
    cd_idx    = tokens.index( 'cd' )
    build_dir = tokens[ cd_idx + 1 ]

    rule = build_dir + '-commands-rule'
    rule = rule.replace( '-', '_' )

    description = build_dir + ': Executing...'

    # Update timestamps for pre-existing outputs so timestamp-based
    # dependency checking works

    command = command + ' && touch -c ' + build_dir + '/outputs/*'

    # Stamp the build directory

    command = command + ' && touch ' + build_dir + '/.execstamp'

    # Rules

    targets = ninja_execute(
      w           = s.w,
      outputs     = outputs,
      rule        = rule,
      command     = command,
      description = description,
      deps        = all_deps,
    )

    return targets