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
|
|
|
|
|
2022-02-04 13:53:42 -04:00
|
|
|
if bld.env.EXT_FLASH_SIZE_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
|
|
|
|
2019-10-21 03:11:14 -03:00
|
|
|
bld.ap_stlib(
|
|
|
|
name= 'AP_Bootloader_libs',
|
2022-10-24 00:16:08 -03:00
|
|
|
use='dronecan',
|
|
|
|
dynamic_source='modules/DroneCAN/libcanard/dsdlc_generated/src/**.c',
|
2019-10-21 03:11:14 -03:00
|
|
|
ap_vehicle='AP_Bootloader',
|
2021-06-02 10:37:18 -03:00
|
|
|
ap_libraries= flashiface_lib + [
|
2022-08-11 05:04:13 -03:00
|
|
|
'AP_Math',
|
2023-01-09 06:11:05 -04:00
|
|
|
'AP_CheckFirmware',
|
|
|
|
'AP_HAL',
|
2024-01-13 01:28:10 -04:00
|
|
|
'AP_Networking',
|
|
|
|
'AP_ROMFS',
|
2024-05-27 02:45:07 -03:00
|
|
|
'AP_Common',
|
2019-10-21 03:11:14 -03:00
|
|
|
])
|
2023-01-09 06:11:05 -04:00
|
|
|
|
|
|
|
# build external libcanard library
|
|
|
|
bld.stlib(source='../../modules/DroneCAN/libcanard/canard.c',
|
|
|
|
name='libcanard',
|
|
|
|
use='dronecan',
|
|
|
|
target='libcanard')
|
|
|
|
|
|
|
|
bld.ap_program(
|
|
|
|
use=['AP_Bootloader_libs', 'libcanard', 'dronecan'],
|
|
|
|
program_groups='bootloader'
|
|
|
|
)
|