Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile improvements #28

Merged
merged 2 commits into from
Mar 4, 2021
Merged

Makefile improvements #28

merged 2 commits into from
Mar 4, 2021

Conversation

cyrozap
Copy link
Contributor

@cyrozap cyrozap commented Mar 4, 2021

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.

This makes it possible to select the build toolchain without modifying
the Makefile.
@r2axz r2axz added the enhancement New feature or request label Mar 4, 2021
@r2axz
Copy link
Owner

r2axz commented Mar 4, 2021

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

@cyrozap
Copy link
Contributor Author

cyrozap commented Mar 4, 2021

Nope, that's all, thanks!

@r2axz
Copy link
Owner

r2axz commented Mar 4, 2021

Thank you, accepting the PR.

@r2axz r2axz merged commit 9460f88 into r2axz:main Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants