views:

16

answers:

2

hi,

the code i develop for avr microcontrollers i write so that it runs on the PC and only differs in one or more files (the port). till now i do that using makefiles but now id like to move to eclipse CDT with the AVR plugin.

is there a way to

  1. use 2 different toolchains (x86 and avr compiler) in one project (and also tell these toolchains which port to include)

  2. or to create 2 project (one for x86 one for avr) that share the common files?

note that main() is in a shared file.

thanks for your help.

A: 

Within Eclipse, only the x86 compiler will be used (so you can run the tests, etc). You will have to invoke the Makefile to build for AVR manually, so one project should be enough.

Eclipse will not use the output of the compiler but the C sources to build its project model. Therefore, you will see all files (even those for AVR) but they will never run in Eclipse. That means you can edit them including code completion.

Aaron Digulla
A: 

You may be able to set up multiple configurations to do this, with different toolchains. If this looks reasonable, you could have your source files change their behaviour based on what compile-time symbols are present.

crazyscot