Author
Topic: cbp2make - makefile generation tool (Read 68863 times)

cbp2make is another standalone command-line tool to convert Code::Blocks projects to GNU makefiles.Unlike previously appeared cbp2mak (v0.2) tool it does not require to be built for individual projects,however, it is still in early stage of development and currently able to process only simple project files.Hopefully, somebody will find this tool useful (http://sourceforge.net/projects/cbp2make).I'm using CB constantly and going to support all or at least most of CB project/workspace features in this tool.Any comments or suggestions are welcome.

Actually, I've looked through the plugin code and it seems that I haven't missed too many features.So I have to add few words on what cbp2make can do and what it cannot in the current state.Pros.:(+) reads .cbp file directly and does not require .depend file presence as well as CB presence.(+) processes all targets and all virtual targets, "all" and "clean" targets are added by default(+) supports two(three) of all types of targets: binary, static library, (dynamic library)(+) generates individual makefile for every platform(+) keeps toolchain configuration in local xml fileCons.:(-) doesn't know how to process .workspace files(-) doesn't work when project has no targets(-) other types of targets are not supported(-) doesn't generate makefile rules for before-build and after-build commands(-) makes no difference between platforms and generates makefiles for unix toolchains(-) can't read CB toolchain configuration from CB profile due to tinyxml library limitations (CDATA sections).

mirai: Do you have plans to make automake/autotools system generation?

Honestly, I just haven't thought about creating that kind of build tool.As far as I know, the autotools system is rather complicated and unfriendly one.However, If there is an actual necessity to connect CB to automake/autotools system,maybe it is a good idea to get concerned about developing such tool.For the time being, I want to get makefile generation tool to production stateas soon as possible before I am forced to switch to something else...

I think you can add Linux makefile/Mingw makefile(make/mingw32-make) and Windows makefile(nmake) support.

That's what I'm actually planning (all but nmake, because there's a little different story with nmake, I may add nmake later).Almost all of the time I'm developing and testing under Linux, so Windows part may not work for now.

Now I'm gradually starting to switch from developing to testing and working on compatibility with Windows.There are few things I had problems with.One problem is working directories for targets. According to CB's wiki, one should change directory to target'sworking directory before building it, but applying that to the CB projects results in discrepancy in expected pathsin build command sequence. What's wrong?Another is calling resource compilers, processing of WX forms, etc. How does CB invokes this resource compiler stuff ?There are also few other things to implement before full-scale testing, but I think they will be completed in the course of time.

I tried to convert and build Code::Blocks IDE project and plug-ins workspace and it seems that it mostly worked out with couple of exceptions. (openSUSE 11.2 x86, gcc 4.4.x, wxWidgets 2.8.10, CodeBlocks 10.05)1) Neither CB build system nor make tool could not link "codeblocks" executable leaving me with error message" ../../devel/libwxscintilla.so: undefined reference to `sci2wx(char const*)' "after everything else before final linkage went just fine.2) Neither of build tools could not select correct "wxscintilla.h" out of system default and one from CB sources,even with include directories given in right order, so I had to rename CB's version of wxscintilla.* files and change #include directives accordingly.

Please confirm if cbp2make really works in for unix version of CB IDE project or for any of your projects.

Now cbp2make works for my projects in Windows, but they are quite simple. I would be very grateful to everyone for testing this tool or for links to open source projects developed with CodeBlocks to test against them.

mirai: Do you use some version control system, because I couldn't find it in the project page on the sf.net?

Yes, I use Git locally, but I don't publish the repository, generally because I don't feel strong reason to do so (at least now).And, since Git has no true revision numbers, I use following naming scheme: "project-branch-revision",where "revision" is simply `git log --pretty=format:'%h' | wc -w` expression evaluated while switched to that branch.

Added support for global compiler variables. The "--config" option now has one mandatory parameter which may be "toolchain", "platform" or "variable". Global compiler variables are added to configuration using the "--add" option, the two other mandatory options "-name" and "-value", and the two other options "-set" (default value is "default") and "-field" (default value is "base"). Removal of a variable is mostly alike, but setting both "-name" and "-field" options removes only user-added field, setting only "-name" option removes the whole variable and settings the "-set" option alone removes the entire variable set. Since "default" variable set cannot be deleted, removing it will only clear the variable set. Global compiler variables are basically translated into makefile variables without any additional checking for being correctly defined, recursive variable resolution is up to the make tool.