User forums > Using Code::Blocks

Custom Makefile: How to build one module.obj from module.cpp ?

<< < (2/2)

stahta01:
I just realized I have never used "build file" with an custom makefile it might or might not work correctly.

Tim S.

JoJo:

--- Quote from: stahta01 on April 25, 2023, 06:36:33 pm ---Is the Makefile and the CB Project file in the same folder?

--- End quote ---

Yes. The Makefile already existed when I created the CB project file.

stahta01:
I just visual traced the code and it looks to me that "Build file" does not use the custom makefile.

From compilergcc.cpp line 3133 current SVN

--- Code: ---return CompileFileDefault(m_pProject, pf, bt); // compile file using default build system

--- End code ---

Edit: Adding the use of  "UseMake" call in compilergcc.cpp would be a partial fix; but, other than adding an error saying not supported I have no idea what to add without a lot more work.

Tim S.

JoJo:
IMO, with a custom Makefile, it's hard or impossible to guess how that works, and it's likely you build wrong assumptions into C::B.

What I was expecting that there is some custom command that could be issued on "build file" etc., where I can provide a string that can be composed from parts like basename of the file, extension of the file, folder where the file is located, etc. C::B would then just issue that command.

Or if you allow to attach command to special keys like F7, where you provide file name, extension, etc.

Navigation

[0] Message Index

[*] Previous page

Go to full version