Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: flybar on September 06, 2010, 03:29:39 pm

Title: No need for compiler selection when using custom makefile?
Post by: flybar on September 06, 2010, 03:29:39 pm
Hello everybody :-)

Background: I am writing a small application using a custom Makefile. For making things easier and more comfortable i also use a CodeBlocks Project that lets me edit all my sources within CB. I sometimes edit my sources using linux, sometime using windows, which is no problem as CB is available on both platforms (btw.: I love that feature!!).
The only thing that nags me is that everytime i switch from Linux to Win and vice versa i have to select a "new" compiler, which makes no sense to me because the compiler is hardcoded in my Makefile anyway.

(Yes, I know - I could rename the compiler names to match on Win and Linux. But - I need it to work on a -default- installation cause I send my sources around and cannot make sure everyone has the same compiler names set)

Question: Wouldn't it make sense to be able to ignore the compiler selection completely when using custom Makefiles? Wouldn't it even make sense to remove all compiler settings then?

Kind regards,
Stefan
Title: Re: No need for compiler selection when using custom makefile?
Post by: stahta01 on September 06, 2010, 04:59:06 pm
How would you find the correct make under Windows if you did not use the Toolchain Setting.

My idea for a solution is to rename the compiler gnumake and only have the make defined.
Never had time to do this in CB source code.

Tim S.
Title: Re: No need for compiler selection when using custom makefile?
Post by: MortenMacFly on September 06, 2010, 05:14:54 pm
My idea for a solution is to rename the compiler gnumake and only have the make defined.
...would be a feasible solution, but keep in mind that there are also other "makes", like nmake etc...
Title: Re: No need for compiler selection when using custom makefile?
Post by: flybar on September 07, 2010, 01:21:52 pm
The idea of defining a "magic word" that marks a custom makefile seems not straightforward to me.
I have two ideas for that :-)

First:
I would rather add an additional (optional) parameter like the following:

<Option makefile_is_custom="1" custominvoke="nmake" />

Second: (which i'd prefer)
Add the possibility to choose whether to compile via Makefile or a compiler configuration by adding a "makefile" option to the target configuration:

Code
<Target title="MakeRelease">
  <Option invokemake="make" />
</Target>

This would give us the option to have several different compiler configurations AND also a custom makefile.

What do you think?