2018-03-28 21:45:13 -03:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# encoding: utf-8
|
|
|
|
|
|
|
|
def build(bld):
|
2019-05-26 22:38:46 -03:00
|
|
|
if not bld.env.BOOTLOADER:
|
|
|
|
return
|
|
|
|
|
2021-06-02 14:56:58 -03:00
|
|
|
if bld.env.EXTERNAL_PROG_FLASH_MB:
|
2021-07-01 03:27:45 -03:00
|
|
|
flashiface_lib = ['AP_HAL', 'AP_FlashIface', 'AP_HAL_Empty']
|
2021-06-02 10:37:18 -03:00
|
|
|
else:
|
|
|
|
flashiface_lib = []
|
|
|
|
|
2019-05-26 22:38:46 -03:00
|
|
|
# build external libcanard library
|
|
|
|
bld.stlib(source='../../modules/libcanard/canard.c',
|
|
|
|
target='libcanard')
|
|
|
|
|
|
|
|
bld.ap_program(
|
2019-10-21 03:11:14 -03:00
|
|
|
use=['ap','libcanard','AP_Bootloader_libs'],
|
2019-05-26 22:38:46 -03:00
|
|
|
program_groups='bootloader',
|
|
|
|
includes=[bld.env.SRCROOT + '/modules/libcanard',
|
|
|
|
bld.env.BUILDROOT + '/modules/libcanard/dsdlc_generated']
|
|
|
|
)
|
|
|
|
|
2019-10-21 03:11:14 -03:00
|
|
|
bld.ap_stlib(
|
|
|
|
name= 'AP_Bootloader_libs',
|
|
|
|
ap_vehicle='AP_Bootloader',
|
2021-06-02 10:37:18 -03:00
|
|
|
ap_libraries= flashiface_lib + [
|
2019-10-21 03:11:14 -03:00
|
|
|
'AP_Math'
|
|
|
|
])
|
|
|
|
|
2019-05-26 22:38:46 -03:00
|
|
|
bld(
|
|
|
|
# build libcanard headers
|
|
|
|
source=bld.path.ant_glob("modules/uavcan/dsdl/**/*.uavcan libraries/AP_UAVCAN/dsdl/**/*.uavcan"),
|
2019-10-24 08:31:58 -03:00
|
|
|
rule="python3 ${SRCROOT}/modules/libcanard/dsdl_compiler/libcanard_dsdlc --header_only --outdir ${BUILDROOT}/modules/libcanard/dsdlc_generated ${SRCROOT}/modules/uavcan/dsdl/uavcan ${SRCROOT}/libraries/AP_UAVCAN/dsdl/ardupilot ${SRCROOT}/libraries/AP_UAVCAN/dsdl/com",
|
2019-05-26 22:38:46 -03:00
|
|
|
group='dynamic_sources',
|
|
|
|
)
|
|
|
|
|