Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Improvement of custom makefiles - patch to test
Jenna:
As announced in this thread I post a patch for the C::B build system, that improves the using of custom makefiles.
I attach two patches, one for linux and one for windows.
The contents are identical, but the windows patch is created with tortoise-svn and can easily applied with it, while the linux patch is created with standard diff.
Before use you have to unpack the patch with 7-zip.
To apply the linux version, change directory to the root directory of the C::B sources (the one that contains configure.in) and type
--- Code: ---patch -p1 < [path/to/the/patchfile/use_make_20090121-3.patch]
--- End code ---
without square brackets and with the correct path of course.
To make sure it applies correctly you can first try it with the --dry-run option set, so nothing will be really changed.
The windows version can be applied from within with tortoise's context menu.
After patching the CodeBlocks[-unix].cbp and the ContripPlugins[-unix].workspace have to be build.
A rebuild or make clean should not be necessary, but some sdk-files are changed and without a new build C::B might crash.
After running [./]update[.bat] the new version should be usable.
If you compile it from within C::B and want to start it from inside the IDE, you also have to run [./]update[.bat], because I changed two .xrc-files, that would otherwise not be copied to the right place.
Cleaning, building and rebuilding of workspaces with and without custom makefiles should work as expected.
They can also be mixed or depend on each other.
Pre- and post-build steps for custom makefiles are also available.
The makefile has to be in the projects root dir and has to be set in the projects properties.
You still have to setup the parameters for the makefiles in Build options -> "Make" commands correctly. In most cases (on linux) it is enough to remove the $target, or use a targetname that is also used inside the makefile.
The last (new) command on the "Make" commands tab is used to test whether the project needs to be a rebuild.
The -q (question) parameter works for gnu make, I don't know the parameter for the make executables of other compilers. You have to figure it out yourself.
I normally do not use custm makefiles, so I only tested it with some of the wxWidgets samples and a simple wizard-generated .cbp-project.
Any questions, suggestions or whatever is not only welcome, but needed to make sure it works without breaking the standard build-system.
EDIT:
removed the patches, see next post, sorry for the inconvenience.
Jenna:
The original patches lead to a crash if "Settings -> Compiler and debugger..." is called.
I forgot a null-pointer check.
Sorry.
Here are the corrected patches.
EDIT:
Attachments removed, please use the one in this post: http://forums.codeblocks.org/index.php/topic,9966.msg69440.html#msg69440
MortenMacFly:
--- Quote from: jens on January 21, 2009, 11:45:08 pm ---Here are the corrected patches.
--- End quote ---
Hi Jens,
are you aware of this patch:
https://developer.berlios.de/patch/?func=detailpatch&patch_id=2583&group_id=5358
This I am testing for several weeks now and it looks quite good. It harmonises the build process quite nicely, including and especially the handling of custom makefiles. In addition its a kind of code cleanup for the build framework. Pretty nice, too. I could post an updated patch as the original one is based on a quite old revision. Any thoughts?
Jenna:
No.
It looks good so far and I will test it and merge the patches and post a new one (hopefully this evening).
I like the test if a makefile-based project needs a rebuild to make the behaviour more consistent (only call the compiler if needed and if not just print a message).
I'm at work now, so I will not have the time to do so before this evening.
MortenMacFly:
--- Quote from: jens on January 22, 2009, 09:34:51 am ---I'm at work now, so I will not have the time to do so before this evening.
--- End quote ---
I am posting a patch here which you can take as a first step. I have merged your changes (the ones I think are required) and the onces of #2583 into compilergcc{.h/.cpp}. I am not sure if you really need DoCleanWithMake at all...?! And hopefully I didn't miss anything...
[attachment deleted by admin]
Navigation
[0] Message Index
[#] Next page
Go to full version