#!/usr/bin/env python # encoding: utf-8 import fnmatch def build(bld): targets = bld.ap_periph_boards() valid_target = False for t in targets: if fnmatch.fnmatch(bld.env.BOARD, t): valid_target = True if not valid_target: return if bld.env.AP_PERIPH_HEAVY: libraries = bld.ap_get_all_libraries() bld.env.DEFINES += ['HAL_BOARD_AP_PERIPH_HEAVY'] else: libraries = ['AP_Common', 'AP_HAL', 'AP_HAL_Empty', 'AP_Math', 'AP_BoardConfig', 'AP_BattMonitor', 'AP_CANManager', 'AP_Param', 'StorageManager', 'AP_FlashStorage', 'AP_RAMTRON', 'AP_GPS', 'AP_SerialManager', 'AP_RTC', 'AP_Compass', 'AP_Baro', 'Filter', 'AP_InternalError', 'AP_Airspeed', 'AP_RangeFinder', 'AP_ROMFS', 'AP_MSP', 'SRV_Channel', 'AP_Notify', 'AP_SerialLED', 'AP_Filesystem', 'AP_InertialSensor', 'AP_AccelCal', 'AP_Logger', 'AC_PID', ] bld.ap_stlib( name= 'AP_Periph_libs', ap_vehicle='AP_Periph', ap_libraries= libraries, exclude_src=[ 'libraries/AP_HAL_ChibiOS/Storage.cpp' ] ) # build external libcanard library bld.stlib(source=['../../modules/libcanard/canard.c'] + bld.bldnode.ant_glob('modules/libcanard/dsdlc_generated/src/**.c'), includes=[bld.env.SRCROOT + '/modules/libcanard', bld.env.BUILDROOT + '/modules/libcanard/dsdlc_generated/include'], 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/include'] )