You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.2 KiB
37 lines
1.2 KiB
#!/usr/bin/env python |
|
# encoding: utf-8 |
|
|
|
def build(bld): |
|
if not bld.env.BOOTLOADER: |
|
return |
|
|
|
if bld.env.EXTERNAL_PROG_FLASH_MB: |
|
flashiface_lib = ['AP_HAL', 'AP_FlashIface', 'AP_HAL_Empty'] |
|
else: |
|
flashiface_lib = [] |
|
|
|
# build external libcanard library |
|
bld.stlib(source='../../modules/libcanard/canard.c', |
|
target='libcanard') |
|
|
|
bld.ap_program( |
|
use=['ap','libcanard','AP_Bootloader_libs'], |
|
program_groups='bootloader', |
|
includes=[bld.env.SRCROOT + '/modules/libcanard', |
|
bld.env.BUILDROOT + '/modules/libcanard/dsdlc_generated'] |
|
) |
|
|
|
bld.ap_stlib( |
|
name= 'AP_Bootloader_libs', |
|
ap_vehicle='AP_Bootloader', |
|
ap_libraries= flashiface_lib + [ |
|
'AP_Math' |
|
]) |
|
|
|
bld( |
|
# build libcanard headers |
|
source=bld.path.ant_glob("modules/DroneCAN/DSDL/**/*.uavcan"), |
|
rule="python3 ${SRCROOT}/modules/libcanard/dsdl_compiler/libcanard_dsdlc --header_only --outdir ${BUILDROOT}/modules/libcanard/dsdlc_generated ${SRCROOT}/modules/DroneCAN/DSDL/uavcan ${SRCROOT}/modules/DroneCAN/DSDL/ardupilot ${SRCROOT}/modules/DroneCAN/DSDL/com", |
|
group='dynamic_sources', |
|
) |
|
|
|
|