mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-30 12:38:33 -04:00
waf: Allow spaces in paths when compiling for ChibiOS targets
This commit is contained in:
parent
835484429d
commit
76cc014245
@ -54,7 +54,7 @@ class upload_fw(Task.Task):
|
|||||||
def run(self):
|
def run(self):
|
||||||
upload_tools = self.env.get_flat('UPLOAD_TOOLS')
|
upload_tools = self.env.get_flat('UPLOAD_TOOLS')
|
||||||
src = self.inputs[0]
|
src = self.inputs[0]
|
||||||
return self.exec_command("python {}/px_uploader.py {}".format(upload_tools, src))
|
return self.exec_command("python '{}/px_uploader.py {}'".format(upload_tools, src))
|
||||||
|
|
||||||
def exec_command(self, cmd, **kw):
|
def exec_command(self, cmd, **kw):
|
||||||
kw['stdout'] = sys.stdout
|
kw['stdout'] = sys.stdout
|
||||||
@ -84,8 +84,8 @@ class set_default_parameters(Task.Task):
|
|||||||
|
|
||||||
class generate_fw(Task.Task):
|
class generate_fw(Task.Task):
|
||||||
color='CYAN'
|
color='CYAN'
|
||||||
run_str='${OBJCOPY} -O binary ${SRC} ${SRC}.bin && \
|
run_str="${OBJCOPY} -O binary ${SRC} ${SRC}.bin && \
|
||||||
python ${UPLOAD_TOOLS}/px_mkfw.py --image ${SRC}.bin --prototype ${BUILDROOT}/apj.prototype > ${TGT}'
|
python '${UPLOAD_TOOLS}/px_mkfw.py' --image '${SRC}.bin' --prototype '${BUILDROOT}/apj.prototype' > '${TGT}'"
|
||||||
always_run = True
|
always_run = True
|
||||||
def keyword(self):
|
def keyword(self):
|
||||||
return "Generating"
|
return "Generating"
|
||||||
@ -242,7 +242,7 @@ def configure(cfg):
|
|||||||
if not os.path.exists(hwdef_out):
|
if not os.path.exists(hwdef_out):
|
||||||
os.mkdir(hwdef_out)
|
os.mkdir(hwdef_out)
|
||||||
try:
|
try:
|
||||||
cmd = 'python %s -D %s %s' % (hwdef_script, hwdef_out, hwdef)
|
cmd = "python '{0}' -D '{1}' '{2}'".format(hwdef_script, hwdef_out, hwdef)
|
||||||
ret = subprocess.call(cmd, shell=True)
|
ret = subprocess.call(cmd, shell=True)
|
||||||
except Exception:
|
except Exception:
|
||||||
cfg.fatal("Failed to process hwdef.dat")
|
cfg.fatal("Failed to process hwdef.dat")
|
||||||
@ -263,14 +263,14 @@ def build(bld):
|
|||||||
bld(
|
bld(
|
||||||
# build hwdef.h and apj.prototype from hwdef.dat. This is needed after a waf clean
|
# build hwdef.h and apj.prototype from hwdef.dat. This is needed after a waf clean
|
||||||
source=bld.path.ant_glob('libraries/AP_HAL_ChibiOS/hwdef/%s/hwdef.dat' % bld.env.get_flat('BOARD')),
|
source=bld.path.ant_glob('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',
|
rule="python '${AP_HAL_ROOT}/hwdef/scripts/chibios_hwdef.py' -D '${BUILDROOT}' '${AP_HAL_ROOT}/hwdef/${BOARD}/hwdef.dat'",
|
||||||
group='dynamic_sources',
|
group='dynamic_sources',
|
||||||
target=['hwdef.h', 'apj.prototype', 'ldscript.ld']
|
target=['hwdef.h', 'apj.prototype', 'ldscript.ld']
|
||||||
)
|
)
|
||||||
|
|
||||||
bld(
|
bld(
|
||||||
# create the file modules/ChibiOS/include_dirs
|
# create the file modules/ChibiOS/include_dirs
|
||||||
rule='touch Makefile && BUILDDIR=${BUILDDIR_REL} CHIBIOS=${CH_ROOT_REL} AP_HAL=${AP_HAL_REL} ${CHIBIOS_BUILD_FLAGS} ${CHIBIOS_BOARD_NAME} ${MAKE} pass -f ${BOARD_MK}',
|
rule="touch Makefile && BUILDDIR=${BUILDDIR_REL} CHIBIOS=${CH_ROOT_REL} AP_HAL=${AP_HAL_REL} ${CHIBIOS_BUILD_FLAGS} ${CHIBIOS_BOARD_NAME} ${MAKE} pass -f '${BOARD_MK}'",
|
||||||
group='dynamic_sources',
|
group='dynamic_sources',
|
||||||
target='modules/ChibiOS/include_dirs'
|
target='modules/ChibiOS/include_dirs'
|
||||||
)
|
)
|
||||||
@ -283,7 +283,7 @@ def build(bld):
|
|||||||
common_src += bld.path.ant_glob('modules/ChibiOS/os/hal/**/*.mk')
|
common_src += bld.path.ant_glob('modules/ChibiOS/os/hal/**/*.mk')
|
||||||
ch_task = bld(
|
ch_task = bld(
|
||||||
# build libch.a from ChibiOS sources and hwdef.h
|
# build libch.a from ChibiOS sources and hwdef.h
|
||||||
rule="BUILDDIR='${BUILDDIR_REL}' CHIBIOS='${CH_ROOT_REL}' AP_HAL=${AP_HAL_REL} ${CHIBIOS_BUILD_FLAGS} ${CHIBIOS_BOARD_NAME} '${MAKE}' lib -f ${BOARD_MK}",
|
rule="BUILDDIR='${BUILDDIR_REL}' CHIBIOS='${CH_ROOT_REL}' AP_HAL=${AP_HAL_REL} ${CHIBIOS_BUILD_FLAGS} ${CHIBIOS_BOARD_NAME} '${MAKE}' lib -f '${BOARD_MK}'",
|
||||||
group='dynamic_sources',
|
group='dynamic_sources',
|
||||||
source=common_src,
|
source=common_src,
|
||||||
target='modules/ChibiOS/libch.a'
|
target='modules/ChibiOS/libch.a'
|
||||||
|
@ -22,8 +22,10 @@ class uavcangen(Task.Task):
|
|||||||
src = self.env.get_flat('SRC')
|
src = self.env.get_flat('SRC')
|
||||||
dsdlc = self.env.get_flat("DSDL_COMPILER")
|
dsdlc = self.env.get_flat("DSDL_COMPILER")
|
||||||
input_dir = os.path.dirname(self.inputs[0].abspath())
|
input_dir = os.path.dirname(self.inputs[0].abspath())
|
||||||
ret = self.exec_command('{} {} {} -O{}'.format(
|
ret = self.exec_command(['{}'.format(python),
|
||||||
python, dsdlc, input_dir, out))
|
'{}'.format(dsdlc),
|
||||||
|
'{}'.format(input_dir),
|
||||||
|
'-O{}'.format(out)])
|
||||||
|
|
||||||
if ret != 0:
|
if ret != 0:
|
||||||
# ignore if there was a signal to the interpreter rather
|
# ignore if there was a signal to the interpreter rather
|
||||||
|
Loading…
Reference in New Issue
Block a user