I want use makefile for building of project but need to pass additional parameters. Of course I could change the makefile. This is the easiest way but pretty solution would be to set custom variable.
Makefile invocation
$make -f $makefile $target $USE_OPT
$USE_OPT is the custom variable
its value
USE_OPT="-gdwarf-2 -falign-function=16"
but when executed C::B adds some additional quotation which is not accepted by make tool
-------------- Build: all in chibios-f3d (compiler: STM32 GCC Compiler)---------------
Running command: make.exe -f Makefile all "USE_OPT="-gdwarf-2 -falign-function=16""
make: align-function=16: No such file or directory
make: *** No rule to make target `align-function=16'. Stop.
Process terminated with status 2 (0 minutes, 0 seconds)
0 errors, 0 warnings (0 minutes, 0 seconds)
Second parameter is not recognized because of these quotes.
Some workaround to suppress these quotes ?
I also tested it in 12.11 .
Here is a possible workaround:
It seems to work when I add double-doublequotes around the variable, so the build log with a dummy empty Makefile shows:
-------------- Build: Release in test (compiler: GNU GCC Compiler)---------------
Running command: mingw32-make.exe -f Makefile ""USE_OPTS="-gdwarf-2 -falign-function=16"""
mingw32-make.exe: *** No targets. Stop.
Process terminated with status 2 (0 minutes, 0 seconds)
0 errors, 0 warnings (0 minutes, 0 seconds)
The variable is: ""USE_OPTS="-gdwarf-2 -falign-function=16"""
.
A little hacky, but it still works in actual nightly.