User forums > Using Code::Blocks
cbp2make - makefile generation tool
ripcordjones:
--- Quote from: mirai on April 22, 2011, 07:24:28 pm ---Well, the program expects that libraries are named as GNU linker expects them to be, i.e., that a static library has file name "lib<something>.a" and corresponding linking option "-l<something>" without prefix "lib" and extension ".a", where <something> can be name or name plus version or anything else. If you have a library that does not follow this naming scheme, cbp2make may fail (and it actually does).
I can try to fix this by adding some logic to check if a library follows active naming scheme and change linking options accordingly.
Another solution is to rename that library file in the way that matches linker expectations or create a well-named symbolic link to the library inside your project tree or somewhere else withing linking path.
--- End quote ---
Thanks for the reply. Just to clarify, the library is actually called libtcl8.4.a, but it's stored in the .cbp without the lib and .a, so the line in the .cbp looks like this
<Add library="tcl8.4" />
but this gets put in the Makefile without the "-l"
LIB = [... a bunch of libraries ...] -lrt -lz tcl8.4 -ldl
I can try some workarounds, but I thought you might want to know about it in case there are other libraries that use a similar naming scheme.
mirai:
--- Quote from: ripcordjones on April 23, 2011, 12:58:17 am ---Thanks for the reply. Just to clarify, the library is actually called libtcl8.4.a, but it's stored in the .cbp without the lib and .a, so the line in the .cbp looks like this
<Add library="tcl8.4" />
but this gets put in the Makefile without the "-l"
LIB = [... a bunch of libraries ...] -lrt -lz tcl8.4 -ldl
--- End quote ---
A linkage command should contain either "libtcl8.4.a" or "-ltcl8.4", but not simply "tcl8.4", generated command is wrong.
I know why: cbp2make was looking for any extension (not just valid ".a") to tell which one of ways to instruct linker is the right one.
Look forward to next revision, this bug is already fixed.
--- Quote from: ripcordjones on April 23, 2011, 12:58:17 am ---I can try some workarounds, but I thought you might want to know about it in case there are other libraries that use a similar naming scheme.
--- End quote ---
Yes, thank you. I do need real-world examples of projects to be capable to manage different conditions.
mirai:
Update: (see rev.99) This is a major preliminary update prior to switching to multiple toolchain architecture.
[+] Rewrote plaform-specific command generation logic to template-based. Platform-specific commands can be generated in a more flexible way now, probably as it should have been done in the first place. You can find default settings in automatically created cbp2make.cfg configuration file.
[+] Rewrote dependency search for C/C++ source/header files. Extracting dependencies is much faster now, and also you can get some additional info like project statistics on unit usage when running cbp2make with "--verbose" option [prepare a big screen or redirect output to a text file].
[+] Switched makefile generation code to rule-based version. Makefiles became nicer and look more clean, project unit dependencies are also converted into makefile rules now.
[*] Changed format of configuration file to more human-readable form. Old configuration files are partially incompatible, but cbp2make will rewrite new sections with defaults, so just check if everything works fine.
[*] Prepared infrastructure for multiple toolchains (to be completed soon). You can find an example of configuration in cbp2make.cfg. This feature it yet incomplete, and hence will not be activated until (probably) next release, so it is just like a technology preview :) . Toolchain management is planned to be CB-like, but more detailed up to individual tools.
[+] And the last but not least, cbp2make finally got a (imo) funny simple logo.
Well... test it, use it, feel free to report any problems or suggestions. Download link: http://sourceforge.net/projects/cbp2make/files/
mirai:
Update: (see rev.100) bugfix release
[+] Added global (per-project) pre-build and post-build steps. When global pre/post build steps are in use, makefile rules are rewritten in slightly different way to allow CB-like behavior (whatever is being built, pre/post build commands are executed only once) when make tool is invoked for either a single virtual target or a single real target ("make all", "make debug", "make release"). However, this won't work completely as intended if make tool is invoked for any multiple targets ("make debug release").
[+] Changed makefile rules naming for build targets. A build target output file name (makefile macro), if any, is no longer used as makefile target name to resolve ambiguity between multiple build targets sharing the same output file name.
killerbot:
a remark with respect to casing :
I have a cbp project, with the following targets : Debug and Release
However in the created make file, all is talking about 'debug' and 'release'. I would expect the same casing is used :
Eg :
--- Code: ---debug: before_debug out_debug after_debug
--- End code ---
would become (and all other likewise occurrences ) :
--- Code: ---Debug: before_Debug out_Debug after_Debug
--- End code ---
What do you think ?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version