Ejemplo n.º 1
0
def get_compile_tasks():
    tasks = []

    for source in SOURCES:
        obj = _globals.source_to_obj_path(source, OBJ_DIR)
        dep = _globals.source_to_dep_path(source, OBJ_DIR)
        if obj in DEPS:
            dependencies = DEPS[obj]
        else:
            dependencies = [source]
        tasks.append({
            'name': source.replace('.c', '.o'),
            'actions': [(create_folder, [os.path.dirname(obj)]),
                        gcc_utils.get_compile_cmd_str(source, obj,
                                                      compiler=COMPILER,
                                                      defs=COMPILER_DEFINITIONS,
                                                      includes=COMPILER_INCLUDE_DIRS,
                                                      flags=COMPILER_FLAGS)],
            'targets': [obj, dep],
            'file_dep': dependencies,
            'clean': True
        })
    return tasks
Ejemplo n.º 2
0
LINKER = 'gcc'

SOURCE_DIRS = [
    _globals.from_proj_root('source'),
    _globals.from_proj_root('test', 'unit_test_harness', 'Unity'),
    _globals.from_proj_root('test', 'unit_tests')
]

SOURCES = []
for sdir in SOURCE_DIRS:
    SOURCES += file_utils.find(sdir, '*.c')

# Add generated source manually
SOURCES += [UNIT_TEST_RUNNER_SOURCE]

OBJECTS = [_globals.source_to_obj_path(source, OBJ_DIR) for source in SOURCES]

DEPS = gcc_utils.get_dependency_dict(OBJ_DIR)

EXE_TARGET_NAME = _globals.get_exe_target_name(NAME, 'exe')

EXE_TARGET = os.path.join(BUILD_DIR, EXE_TARGET_NAME)


#-----------------------------------------------------------
# Doit task generators


def get_all_tasks():
    tasks = get_code_gen_tasks() + get_compile_tasks() + get_link_tasks()
    tasks += get_run_test_tasks()