User forums > Help
Debug with custom makefile
yop:
Let me add my two cents since I 'm quite familiar with C::B and Makefiles.
You might be using a Makefile driven build but when it comes to the debugger C::B acts like you have used the C::B build system (it will try to locate object files sources etc to the foldes declared in the C::B project file).
Generally Makefiles initiate the build from the target's folder while C::B from the project's folder. You can't say which is the right approach it's just different. This though leads to some problems, if you have targets in sub directories of the project's top level directory then if you build them with a Makefile C::B won't be able to find the correct path to the sources etc. (for the Makefile it will be foo.cpp, for c::b <target dir>/foo.cpp). Keep the above in mind when you create Makefiles and you will be able to tweek your Makefiles in order to work with C::B
Game_Ender:
--- Quote from: MortenMacFly on October 09, 2006, 08:18:01 am ---No, I wouldn't say this for several reasons:
1.) The C::B build sytem is much faster than with Makefiles
2.) You not neccesarily need several project files to be cross-platform compatible. In fact I have quite some projects that compile just fine under Windows and Linux with a single project file. This is only different if libraries require different settings on different platforms. But with global variables and/or user variables you can even work-around this.
With regards, Morten.
--- End quote ---
The speed is an excellent point. But you can also do the same level of variable switching with makefiles. The real issue is that external build systems, scons, CMake, can handle the configuration automatically, without the need for user intervention. I don't think CB needs autoconf like functionality it would probably be best to add CB project file generation to CMake and/or scons. So you get all the benefits of CB project files while having firmer cross platform support. Not to mention not inventing another auto configuration tool.
yop- So if you tweak you the makefiles object file output directories to match codeblocks, then everything should work fine?
yop:
--- Quote from: Game_Ender on October 10, 2006, 07:26:20 am ---yop- So if you tweak you the makefiles object file output directories to match codeblocks, then everything should work fine?
--- End quote ---
Or the other way around, tweek your codeblocks project. But still if you have to dive into subdirs to find sources then there are no guaranties. I haven't lately tried it though (knowing the limitations I try to keep both parties happy make and c::b).
paparazzi:
Hi!
I'm evaluating the possibility to switch from Eclipse to C::B also. And yes I'm also using custom makefiles for cross-platform build. The difference is I'm not using any tools like autoconf whatsoever, instead I have a pretty complex "master" makefile, which is referenced from all the (very simple) end-projects makefiles, and the master does all the magic. So generating a C::B project file here is not the option.
Yet there is another problems. One of the platforms I have to support is AIX, and I have only a relatively slow remote access to all of the available AIX machines. As far as I understand, I need to have a graphical desktop available in order to use the C::B build system, but the only option available is ssh console. I have once tried to use the X desktop on AIX, but due to the connection limitations it was not usable. And of course I am not sure I will be able to build the C::B itself on AIX. In contrast I can not name the OS for which a prebuilt gmake binary would not be available.
To sum up. I understand that my case is far from being a common case, yet I'm sure I'm not the only guy
on the earth with such requirements. To make C::B a viable option for those like me either external makefiles should be fully supported, or a command line tool capable of building the projects based on the C::B project files should be implemented. And it should be written in a way it will be possible to compile it on nearly any imaginable OS.
Thanks.
Andrey.
takeshimiya:
--- Quote from: paparazzi on November 02, 2006, 06:52:00 pm ---...or a command line tool capable of building the projects based on the C::B project files should be implemented. And it should be written in a way it will be possible to compile it on nearly any imaginable OS.
--- End quote ---
The only compromise you have if you want something working right now, is to use premake, which generates makefiles (no autoconf stuff), codeblocks projects, msvc projects, etc.
The syntax is very nice and it's far easier than to write a makefile by hand. :)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version