I configured C::B to work with an embedded toolchain for a 16-bit microcontroller. After many tests, I reached a working configuration but for a thing.
In the Project/target options/Build targets window, I set ABS/myproject.abs in the Output filename field and I uncheck both Auto-generate ... checkboxes. In this way, C::B knows the executable is in ABS subfolder of the project folder.
The command line for the linker (configured in Settings/Compiler and debugger/Other settings/Advanced options) is:
$linker -f "$(PROJECT_DIR)\OPT\$(PROJECT_NAME).opl" $link_options -Xcwno
In the OPT\myproject.opl file there are the options for the linker from the original IDE that I want to continue using. One of the option in this file is the classical output filename:
-o ABS\myproject.abs
as before.
If I modify a single source file and click on Build button, the compilation of the changed file and the linking are well done and I correctly found the executable in ABS subfolder.
If I modify a single source file and click on Build file button, the compilation of the changed file is well done and I found the updated object file. After that, if I click on Build, C::B outputs the message: Target is up to date. It's not true, because the ABS\myproject.abs is older than the object file of the changed source (that is created with Build file).
At the moment I solved adding a pre-build step:
CMD /C IF EXIST ABS\$(PROJECT_NAME).abs DEL ABS\$(PROJECT_NAME).abs
In this way, the executable is always deleted before building, so the linking is always executed, even if the target is really up to date.
When does C::B decide that the target is up to date? Only if the file exists? Do it compare the date of the target file and the date of all the object files?