These are some small improvements for the Makefile.
The first commit fixes the dependencies for the "flash" and "size" targets. This is important since when running a parallel build (with, say, make -j4), if $(TARGET).elf isn't built by the time $(SIZE) $(TARGET).elf is run, the entire build will fail with the following error:
arm-none-eabi-size bluepill-serial-monster.elf
arm-none-eabi-size: 'bluepill-serial-monster.elf': No such file
make: *** [Makefile:75: size] Error 1
make: *** Waiting for unfinished jobs....
After making that small change, the build never fails, no matter how many threads are used.
The second commit is more a matter of convenience, and allows you to specify your toolchain with the CROSS_COMPILE environment variable. The name is somewhat arbitrary--I just used the same name and semantics that the ARM Trusted Firmware-A project uses for specifying a toolchain.
These are some small improvements for the Makefile.
The first commit fixes the dependencies for the "flash" and "size" targets. This is important since when running a parallel build (with, say,
make -j4
), if$(TARGET).elf
isn't built by the time$(SIZE) $(TARGET).elf
is run, the entire build will fail with the following error:After making that small change, the build never fails, no matter how many threads are used.
The second commit is more a matter of convenience, and allows you to specify your toolchain with the
CROSS_COMPILE
environment variable. The name is somewhat arbitrary--I just used the same name and semantics that the ARM Trusted Firmware-A project uses for specifying a toolchain.