Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: BrianSidebotham on November 27, 2006, 01:29:40 pm

Title: calling compiler in "commands" section of build options
Post by: BrianSidebotham on November 27, 2006, 01:29:40 pm
Hi guys,

Is there a variable I can use to call the compiler in the commands (post build) build options dialog for a target? I've tried $cc $(cc) $c $(c) but they all get omitted.

Thanks,

Brian.
Title: Re: calling compiler in "commands" section of build options
Post by: thomas on November 27, 2006, 03:03:24 pm
As of revision 3287, you can use TARGET_CC, TARGET_CPP, TARGET_LD, and TARGET_LIB.

EDIT: The "standard" variable $CC was purposely not used, since this might otherwise break builds that depend on $CC being set by the environment.
If you do have $CC on your environment, it will be replaced, by the way.
Title: Re: calling compiler in "commands" section of build options
Post by: BrianSidebotham on November 27, 2006, 04:04:39 pm
Hi thomas,

working under windows, so no $cc variable defined.

Either you typed very fast, or my question was extremely well timed. Am updating to svn 3287 now. I updated this morning, and got confused when I couldn't find TARGET_CC in the source when I read your reply.

Thanks very much, that's just what I needed!
Title: Re: calling compiler in "commands" section of build options
Post by: thomas on November 27, 2006, 04:58:08 pm
I updated this morning, and got confused when I couldn't find TARGET_CC in the source when I read your reply.
That must be an interesting physical phenomenon related to electrons travelling faster than light and going back in time, because I posted the above (15:03:01 CET) only after committing the changes (15:01:25 CET) and re-updating. So, at any rate, I don't see how you could have read about TARGET_xxx without them being present in svn :)

Anyway, hope that solves your problem :)
Title: Re: calling compiler in "commands" section of build options
Post by: BrianSidebotham on November 27, 2006, 05:50:58 pm
I guess you just type fast! ;)

That's sorted everything. Thanks.

I created a compiler for avr-gcc. It could do with a custom project setup as it needs post build steps to extract different code sections to hex files using objcopy and objdump.

c::b doesn't have them setup as compiler programs, so it has to be hardcoded. :(

Maybe the avr-gcc compiler is of use to the c::b project?