Пример #1
0
def _make_doxygen_reference_manual(env,
                                   doxygen_inputs,
                                   subs,
                                   work_queue,
                                   hash_file_name='dox'):
    """Install the doxygen reference manual the doyxgen_output_dir
    directory. doxygen_inputs is a list of files """

    dox_dag = mbuild.dag_t(hash_file_name, env=env)

    # so that the scanner can find them
    dirs = {}
    for f in doxygen_inputs:
        dirs[os.path.dirname(f)] = True
    for d in dirs.iterkeys():
        env.add_include_dir(d)

    # make sure the config and top file are in the inptus list
    doxygen_inputs.append(env['doxygen_config'])
    doxygen_inputs.append(env['doxygen_top_src'])

    dummy = env.build_dir_join('dummy-doxygen-' + hash_file_name)

    # Run it via the builder to make it dependence driven
    run_always = False
    if _empty_dir(env['doxygen_install']):
        run_always = True

    if run_always:
        _build_doxygen_main([subs, dummy], env)
    else:
        c1 = mbuild.plan_t(command=_build_doxygen_main,
                           args=[subs, dummy],
                           env=env,
                           input=doxygen_inputs,
                           output=dummy)
        dox1 = dox_dag.add(env, c1)

        okay = work_queue.build(dag=dox_dag)
        phase = "DOXYGEN"
        if not okay:
            mbuild.die("[%s] failed. dying..." % phase)
        if mbuild.verbose(1):
            mbuild.msgb(phase, "build succeeded")
Пример #2
0
env = mbuild.env_t()
env.parse_args()

if 'clean' in env['targets']:
    mbuild.remove_tree(env['build_dir'])
    sys.exit(0)    
if not env.on_linux():
    print ("This is a linux only test"   )
    sys.exit(0)    

mbuild.cmkdir(env['build_dir'])
env['LINK'] = env['CC'] # not g++ for this program
    
dep_tracker = mbuild.dag_t()
prog = env.build_dir_join('hello' + env['EXEEXT'])
cmd1 = dep_tracker.add(env, env.cc_compile('hello.c'))

# take the nicely created link command and add on the strip command
# sequentially.
plan = env.link(cmd1.targets, prog)
cmds = [plan.command, " strip " + prog]
plan2 = mbuild.plan_t( cmds, env=env, 
                       input=plan.input, output=plan.output)
cmd2 = dep_tracker.add(env, plan2)

work_queue = mbuild.work_queue_t(env['jobs'])
okay = work_queue.build(dag=dep_tracker)
if not okay:
    mbuild.die("build failed")
mbuild.msgb("SUCCESS")