Page 1 of 1

Compiler version select in makefile

Posted: Wed Aug 14, 2019 1:44 pm
by steved
Rather than selecting the compiler version to run at startup of the ChibiStudio IDE, would it be possible to select the version in the makefile?

This would ensure that a project was always compiled with the "correct" compiler, rather than having to start up the appropriate IDE. It would help software maintainability, by ensuring that moving to a later compiler is a conscious decision (much as happens with Chibi versions).

And it would help to avoid problems with the current M0 optimisations.

Superficially it appears this is just a matter of modifying the TRGT variable in (although I doubt its that simple!)

Re: Compiler version select in makefile

Posted: Wed Jul 29, 2020 11:34 am
by steved
If compiler selection is too problematical, would it be possible to support a compiler version check, in much the same way as done for the M0 problem? (I know I could add it myself, but an integrated solution is likely to be much better!). User specifies a required compiler version in one of the configuration files (mcuconf.h?), and Chibi errors if the current compiler version doesn't match.

While not as automated as selecting compiler version through the makefile, it would at least pick up incorrect usage.

Re: Compiler version select in makefile

Posted: Wed Jul 29, 2020 1:34 pm
by Giovanni

The only incompatibility I am aware of is the M0 one and that one is handled already. What are you suggesting exactly?


Re: Compiler version select in makefile

Posted: Wed Jul 29, 2020 3:43 pm
by steved
Its a general "quality" issue, really; nothing to do with specific incompatibilities.

I am accumulating a fair number of different projects, whose latest releases use different compiler versions. I want to be sure that the same compiler version is used for any changes, unless I make a specific decision to update to a new compiler. (There has been some support for the principle from at least one persion, maybe more, in this forum). So there are two real possibilities to achieve this; either have a project-specific means of selecting the compiler (rather than a different startup procedure for Eclipse), or have a check within the project.