Author Topic: No need for compiler selection when using custom makefile?  (Read 5089 times)

Offline flybar

  • Single posting newcomer
  • *
  • Posts: 2
No need for compiler selection when using custom makefile?
« 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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7787
    • My Best Post
Re: No need for compiler selection when using custom makefile?
« Reply #1 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.
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: No need for compiler selection when using custom makefile?
« Reply #2 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...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline flybar

  • Single posting newcomer
  • *
  • Posts: 2
Re: No need for compiler selection when using custom makefile?
« Reply #3 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?