r2axz / bluepill-serial-monster

USB to 3 Port Serial (UART) adapter firmware for STM32 Blue Pill.
MIT License
323 stars 76 forks source link

Makefile improvements #28

Closed cyrozap closed 3 years ago

cyrozap commented 3 years ago

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.

r2axz commented 3 years ago

Looks good, thank you. I tested it locally and I'm ready to merge. Do you have anything to add here?

cyrozap commented 3 years ago

Nope, that's all, thanks!

r2axz commented 3 years ago

Thank you, accepting the PR.