Page 1 of 1

Compiler Settings and Project.mk

Posted: Sat Jan 19, 2013 11:54 am
by Verax
I'm trying to use CodeLite with a Sourcery Codebench Lite arm-none-eabi compiler. I'm quite familiar with the compiler as I've used it successfully in both Eclipse and Code::Blocks. But I'm having some trouble with CodeLite.

When I first created the compiler, I modified the "C++ Compiler Name" to arm-none-eabi-g++ -std=c++11 -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mlittle-endian -ffunction-sections -fsingle-precision-constant -Wa,-EL.

I then made a new project. Since I need to call a different "build system" from the default "mingw32-make.exe", I made a custom build as shown below:
CustomBuild.png
This does what I want it to do.

However, now when I modify the "C++ Compiler Name" setting to arm-none-eabi-g++ -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mlittle-endian -ffunction-sections -fsingle-precision-constant -Wa,-EL (e.g. removed -std=c++). Notice no "-std=c++11"
CompilerSettings.png


It still appears appears to use it in the compiler output: "-std=c++11" still there
CompilerOutput.png
The only way I've been able to get around this is to modify "TestProject.mk" in a text editor by changing the CXX variable to match that in the compiler settings. Am I doing something wrong?

CodeLite v4.1.5770 (not self-compiled). Windows 8 Pro. Nice tool btw.

Re: Compiler Settings and Project.mk

Posted: Sat Jan 19, 2013 12:32 pm
by eranif
so what u did is this:
- Used codelite to generate the makefile with the compiler settings
- You then enabled 'custom build'
- You modified the compiler (removed -std=c++11)

And your problem is that the makefile is still using '-std=c++11' ?
Well, once you enabled custom build, codelite will stop generating the makefile. From this point on, it will simply execute the commands as written in the custom build
So the old makefile remains

I am guessing that you are using the release 4.1.5770? ( you should read this before posting )
In trunk version, the MAKE command is part of the toolchain

I have sent you are download link in Private Message that allows you to set different make per compiler

Eran

Re: Compiler Settings and Project.mk

Posted: Sat Jan 19, 2013 12:40 pm
by Verax
I understand now. Thanks.

Re: Compiler Settings and Project.mk

Posted: Sat Jan 19, 2013 12:51 pm
by eranif
Note that with the installer that I have sent you in private message, you simply need to define new compiler like this:

Settings -> build settings -> compilers

and click on the 'New' button

Once clicked, fill in the toolchain (including the 'make' command you need)
And use that instead.

BTW, if you think its generic enough, I will be happy to add it to codelite default compilers
Eran

Re: Compiler Settings and Project.mk

Posted: Sat Jan 19, 2013 1:00 pm
by Verax
Thanks for the bits, but I don't see the MAKE setting in the toolchain. It still seems to be global for all compilers in the "Build Systems" tab.
BuildSettings.png
CodeLite v5.0.6147, Windows 8 Pro.

Re: Compiler Settings and Project.mk

Posted: Sat Jan 19, 2013 1:04 pm
by eranif
mm, I might have sent you an older version ...
uploading new one now ;)

Eran

Re: Compiler Settings and Project.mk

Posted: Sat Jan 19, 2013 1:28 pm
by eranif
I have sent you another private message with a more up-to-date link

Eran

Re: Compiler Settings and Project.mk

Posted: Sat Jan 19, 2013 2:14 pm
by Verax
Work's great. If you're ever in there again and want to add an "Assembler" command, that will probably make me and some other embedded developers happy. But I'm thrilled with this tool so far, and I think I can get what I need out of the "File Types" settings.
BTW, if you think its generic enough, I will be happy to add it to codelite default compilers
I'm not sure what you meant here. Did you mean the cs-make command? Actually I've only seen the cs- prefix with the CodeSourcery compiler. I'm guessing it stands for CodeSourcery-make, so I don't think it's very generic, but I'm coming from long career with Microsoft Tools, so I'm not sure.

Thanks so much for your attention, and helpful support.

Re: Compiler Settings and Project.mk

Posted: Sat Jan 19, 2013 6:41 pm
by eranif
Verax wrote:I'm not sure what you meant here.
I meant, if the toolchain is commonly used, I can add it so it will be part of codelite's default compilers definition set
so other people might enjoy it as well.

By "generic" I menat: it does not contains some hard coded paths to your machine and that the toolchain can be used on other machines as well
Verax wrote:Thanks so much for your attention, and helpful support.
No problem

Eran

Re: Compiler Settings and Project.mk

Posted: Sat Jan 19, 2013 8:14 pm
by Verax
I meant, if the toolchain is commonly used, I can add it so it will be part of codelite's default compilers definition set so other people might enjoy it as well. By "generic" I menat: it does not contains some hard coded paths to your machine and that the toolchain can be used on other machines as well
Sorry I misunderstood. Sourcery CodeBench Lite is just a GCC cross-compiler, so it doesn't have any hard-coded paths or other rigid limitations that I'm aware of. I think trying to include an embedded compiler would be great, but the the problem is "which one?". Sourcery CodeBench Lite comes in 16 different editions according to processor (ARM, ColdFire, Mips, etc...), operating system (none, linux, uClinux, etc...), and ABI (none, ELF, EABI, etc...). You can see the list here (http://www.mentor.com/embedded-software ... e-edition/).

There's also:
- GNU Tools for ARM Embedded Processors here (https://launchpad.net/gcc-arm-embedded)
- crosstool-ng (http://crosstool-ng.org/)
- summon-arm-toolchain here (https://github.com/esden/summon-arm-toolchain)

All these toolchains seem to name their executables with a processor-operatingsystem-abi prefix, so the commands in the CodeLite "Build Settings" would have to be different for each compiler flavor. Maybe if someone finds a way to unify all these different flavors into one, then it would be worth including.

In my opinion, just having the ability to configure a new compiler, as CodeLite already does, is all one should need.