2019-05-26 22:46:41 -03:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# encoding: utf-8
|
|
|
|
|
2019-10-02 06:04:44 -03:00
|
|
|
import fnmatch
|
|
|
|
|
2019-05-26 22:46:41 -03:00
|
|
|
def build(bld):
|
2021-01-05 17:43:49 -04:00
|
|
|
targets = bld.ap_periph_boards()
|
2019-10-02 06:04:44 -03:00
|
|
|
valid_target = False
|
|
|
|
for t in targets:
|
|
|
|
if fnmatch.fnmatch(bld.env.BOARD, t):
|
|
|
|
valid_target = True
|
|
|
|
if not valid_target:
|
2019-05-26 22:46:41 -03:00
|
|
|
return
|
|
|
|
|
|
|
|
bld.ap_stlib(
|
|
|
|
name= 'AP_Periph_libs',
|
|
|
|
ap_vehicle='AP_Periph',
|
|
|
|
ap_libraries= [
|
|
|
|
'AP_Common',
|
|
|
|
'AP_HAL',
|
|
|
|
'AP_HAL_Empty',
|
|
|
|
'AP_Math',
|
|
|
|
'AP_BoardConfig',
|
2020-11-21 01:29:10 -04:00
|
|
|
'AP_BattMonitor',
|
2021-04-30 22:36:42 -03:00
|
|
|
'AP_CANManager',
|
2019-05-26 22:46:41 -03:00
|
|
|
'AP_Param',
|
|
|
|
'StorageManager',
|
|
|
|
'AP_FlashStorage',
|
2020-07-31 10:37:18 -03:00
|
|
|
'AP_RAMTRON',
|
2019-05-26 22:46:41 -03:00
|
|
|
'AP_GPS',
|
|
|
|
'AP_SerialManager',
|
|
|
|
'AP_RTC',
|
|
|
|
'AP_Compass',
|
|
|
|
'AP_Baro',
|
|
|
|
'Filter',
|
|
|
|
'AP_InternalError',
|
2019-10-03 08:02:56 -03:00
|
|
|
'AP_Airspeed',
|
2019-10-19 01:36:14 -03:00
|
|
|
'AP_RangeFinder',
|
2019-10-23 04:44:09 -03:00
|
|
|
'AP_ROMFS',
|
2020-09-03 08:47:34 -03:00
|
|
|
'AP_MSP',
|
2020-12-12 05:08:45 -04:00
|
|
|
'SRV_Channel',
|
2020-12-29 01:06:44 -04:00
|
|
|
'AP_Notify',
|
|
|
|
'AP_SerialLED',
|
2021-05-19 23:34:15 -03:00
|
|
|
'AP_Filesystem',
|
2021-05-17 14:46:05 -03:00
|
|
|
'AP_InertialSensor',
|
|
|
|
'AP_AccelCal',
|
|
|
|
'AP_Logger',
|
|
|
|
'AC_PID',
|
2019-05-26 22:46:41 -03:00
|
|
|
],
|
|
|
|
exclude_src=[
|
|
|
|
'libraries/AP_HAL_ChibiOS/Storage.cpp'
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
# build external libcanard library
|
|
|
|
bld.stlib(source='../../modules/libcanard/canard.c',
|
|
|
|
target='libcanard')
|
|
|
|
|
|
|
|
bld.ap_program(
|
|
|
|
program_name='AP_Periph',
|
|
|
|
use=['AP_Periph_libs', 'libcanard'],
|
|
|
|
program_groups=['bin','AP_Periph'],
|
|
|
|
includes=[bld.env.SRCROOT + '/modules/libcanard',
|
|
|
|
bld.env.BUILDROOT + '/modules/libcanard/dsdlc_generated']
|
|
|
|
)
|
|
|
|
|
|
|
|
bld(
|
|
|
|
# build libcanard headers
|
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:46:41 -03:00
|
|
|
group='dynamic_sources',
|
|
|
|
)
|