def compose_target(target_name, project_descriptor): target = Target(target_name) target.cflags = project_descriptor.build.cflags target.ldflags = project_descriptor.build.ldflags target.libraries = project_descriptor.build.libraries target.image = project_descriptor.targets[target_name].image target.dockerfile = project_descriptor.targets[target_name].dockerfile compose_packages(project_descriptor.build.packages, target) for bit_description in project_descriptor.build.bits.values(): adjust_bit_packages_base_path(bit_description, bit_description.build.packages) add_packages_to_target_includes(bit_description.build.packages, target) target.bits.append(compose_target(target_name, bit_description)) return target
def compose_target(target_name, project_descriptor): target = Target(target_name) target_description = project_descriptor.targets.get(target_name, TargetDescription(target_name)) target.cflags = project_descriptor.build.cflags + target_description.build.cflags target.cppflags = project_descriptor.build.cppflags + target_description.build.cppflags target.ldflags = project_descriptor.build.ldflags + target_description.build.ldflags target.libraries = project_descriptor.build.libraries + target_description.build.libraries target.include_directories.update(project_descriptor.build.includes) target.main = target_description.main target.image = target_description.image target.dockerfile = target_description.dockerfile target.test_image = target_description.test_image target.test_dockerfile = target_description.test_dockerfile target.toolchain_prefix = target_description.toolchain_prefix target.post_build = target_description.post_build compose_packages(project_descriptor.build.packages, target) compose_packages(target_description.build.packages, target) for bit_description in project_descriptor.build.bits.values(): compose_bit(bit_description, target) for bit_description in target_description.build.bits.values(): compose_bit(bit_description, target) return target