configure Codelite for SDCC compiler

General questions regarding the usage of CodeLite
timok
CodeLite Curious
Posts: 2
Joined: Sun Dec 06, 2009 7:43 pm
Genuine User: Yes
IDE Question: C++
Contact:

configure Codelite for SDCC compiler

Post by timok » Sun Dec 06, 2009 7:48 pm

Hi,

How to configure IDE using small device c compiler (SDCC) ??

timok

User avatar
eranif
CodeLite Plugin
Posts: 6089
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: configure Codelite for SDCC compiler

Post by eranif » Sun Dec 06, 2009 9:43 pm

Define new compiler from the menu: 'Settings -> Build Settings' in the compiler tab, you can create new compiler.
Once created, edit the toolchain, and set regexs for the error/warning parsing

Eran
Make sure you have read the HOW TO POST thread

timok
CodeLite Curious
Posts: 2
Joined: Sun Dec 06, 2009 7:43 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: configure Codelite for SDCC compiler

Post by timok » Mon Dec 07, 2009 1:07 pm

Hi,

Can you clarify further how the compiler settings goes.
For example, PATH, switch, linker, etc.

timok

User avatar
eranif
CodeLite Plugin
Posts: 6089
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: configure Codelite for SDCC compiler

Post by eranif » Mon Dec 07, 2009 10:01 pm

timok wrote: Can you clarify further how the compiler settings goes.
For example, PATH, switch, linker, etc.
Hi,

To create a new compiler, follow these simple steps:

1) From the Build Settings dialog, select the 'Compiler' tab and click on the 'New..' button - give the compiler a name and click OK
2) You should now see a new compiler defined at the left tree with various sub-node
3) select the 'switches' and modify the switches to fit your compiler:
ArchiveOutput - this is the switch passed the linker when creating archive, under MSVC this is equal to /OUT:, while for GNU its simply left empty
Debug: debug switch '/Zi ' for MSVC, while '-g ' for GNU (note that the switch also includes a trailing space)
Include: the compiler include switch '-I' under GNU, /I for MSVC
I think that for SDCC you can copy the switches from GNU g++/gcc

4) select the 'File Types' and update the build lines for each file extension - or leave them as is

5) Tools: this page contains the toolchain of your compiler. for example, you want to replace Compiler Name with sdcc.exe from g++

PATH Environment variable: you can edit the PATH environment variable here, but note that you must prepend the old content to the new content, otherwise it will override it
so, if your toolchain locates under C:\sdcc\bin, you might want to edit the PATH to include this:

Code: Select all

C:\sdcc\bin;$(PATH)
on Linux:

Code: Select all

/path/to/sdcc/bin:$(PATH)
Note the difference in the separator from ';' to ':' from LInux and Windows

6) Patterns:
codelite uses regexes to parse the compiler output. Usually you will need 1 regex to parse errors and 1 regex to parse warnings.
the 'File Index' and 'Line Index' is the group number in the regex that codelite can locate the file name or line number (by providing valid regexs, codelite will be able
to parse and colour error/warning in the build output, as well as providing 'hyperlink' for error files)

Hope it cleared it
Eran
Make sure you have read the HOW TO POST thread

Post Reply