Build System: Resolve CPU-specific logic in common build files#457
Conversation
|
NOTE: Please review, verify, and merge if possible. I am not really set up to do verifcation on Spresense at this time. This should resolve Issue #442 and provide guidance for completion of #437 This is the same base solution that was used for another architecture so has a solid precedence, works very well, and is very simple. |
|
after typo fix +1 |
|
it was built and verified here with the local typo fix |
My preference would be to do the merge now. My only hesitation is that Xiang did offer a different solution. This solution is superior to the one Xiang offered, however. But perhaps he is not available due to the time difference. In that case, I would elect to continue with the merge. Then we can get the ESP32 PR on the way too. |
|
I have also verified that builds for a few other architectures that do no redefine POSTBUILD also build with not problem. |
|
|
||
| include ${TOPDIR}/.config | ||
| include ${TOPDIR}/tools/Config.mk | ||
| include ${TOPDIR}/boards/arm/cxd56xx/scripts/cxd56xx_Config.mk |
There was a problem hiding this comment.
How about remove cxd56xx_ prefix? because:
1.The path already have cxd56xx
2.Align with tools/Config.mk
There was a problem hiding this comment.
Okay. Doing that now. Should also change zds_Config.mk for the same reason. I was following the pattern set by zds_Config.mk. I will push new changes momentarily.
| @@ -0,0 +1,41 @@ | |||
| ############################################################################ | |||
| # board/arm/cxd56xx/script/cxd56xx_Config.defs | |||
* tools/Config.mk - Add empty definition POSTBUILD * tools/Makefile.unix/win - Replace CXD56xx specific logic with $(call POSTBUILD) * boards/arm/cxd56xx/scripts/Config.mk - Add POSTBUILD definitions with logic removed from Makefile.unix/win * boards/arm/cxd56xx/spresense/scripts/Make.defs - Include the CXD56xx Config.mk immediately after tools/Config.mk so that the empty POSTBUILD definition will be replaced with the correct one NOTE: There is a precedent for this approach. This is the way that other architecture-specific build options are implemented. See, for example, tools/zds/Config.mk
|
@xiaoxiang781216 Updated. Please review and merge if possible. |
|
Thanks. Just saw the PR trigger running. Nice job guys! Congratulations! That was a lot of work. |
This solution look very good, I can migrate our internal post build process to this elegant mechanism now. |
|
Overriding the define's in tools/Config.mk is a very powerful customization technique. You could do many different things there, such as copying binaries onto and TFTP server, compressing binaries, etc. ... whatever meets the needs of the platform. |
NOTE: There is a precedent for this approach. This is the way that other architecture-specific build options are implemented. See, for example, tools/zds/zds_Config.mk