waf: fixed handling of waf clean with new hwdef generation

This commit is contained in:
Andrew Tridgell 2018-01-13 16:46:28 +11:00
parent 867e7ebf71
commit ce9473f0e8
1 changed files with 8 additions and 0 deletions

View File

@ -146,6 +146,14 @@ def configure(cfg):
print("Failed to generate hwdef.h")
def build(bld):
bld(
# build hwdef.h and apj.prototype from hwdef.dat. This is needed after a waf clean
source='libraries/AP_HAL_ChibiOS/hwdef/%s/hwdef.dat' % bld.env.get_flat('BOARD'),
rule='python ${AP_HAL_ROOT}/hwdef/scripts/chibios_hwdef.py -D ${BUILDROOT} ${AP_HAL_ROOT}/hwdef/${BOARD}/hwdef.dat',
group='dynamic_sources',
target=['hwdef.h', 'apj.prototype']
)
bld(
# create the file modules/ChibiOS/include_dirs
rule='touch Makefile && BUILDDIR=${BUILDDIR} CHIBIOS=${CH_ROOT} AP_HAL=${AP_HAL_ROOT} ${MAKE} pass -f ${BOARD_MK}',