User forums > Using Code::Blocks
cbp2make - makefile generation tool
veneff:
This looks like a handy tool!
Is there a way to specify Code::Blocks's conf file? I scanned this topic and looked at the config doc for cbp2make and did not see anything obvious.
I use several different conf file depending on the toolchain and whether the project build environment is portable or not.
Update: seems as if cbp2make does not reference a conf file. I am getting error:
Generating makefile(s): test_UART.cbp.mak: Warning: toolchain 'armelfgcc' for target 'Debug' is not defined.
Warning: toolchain 'armelfgcc' for target 'Release' is not defined.
Warning: toolchain 'armelfgcc' for target 'Debug' is not defined.
Warning: toolchain 'armelfgcc' for target 'Release' is not defined.
Does this mean that global settings are not included?
Update 2:
I created a new armelfgcc toolchain entry in the CFG file. cbp2make seems to be happy with that.
Now to move any global settings to the project settings.
Update 3:
Work pretty good! But, it is ignoring assembly files (.s & .S). I'll manually add those and report on progress.
Last Update:
I added the assembly files and the output file was generated successfully, when the (modified) make file was ran!
Two additional things I had to fix:
1) When clean is specified, the order that the directory deletions was done was incorrect. It attempted to remove a parent directory before a sub directory was removed. Also, it does not remove any nested parent directories that did not contain files. As an example: I had a source file file in level5
.\level1\level2\level3\level4\level5\file.o
it attempted to remove .\level1 before removing .\level1\level2\level3\level4\level5
Also, it did not attempt to remove .\level1\level2\level3\level4, .\level1\level2\level3 or .\level1\level2 directories I presume because they did not contain any object files.
2) Is there any way I can resolve the Code::Blocks predefined symbols %TARGET_OUTPUT_DIR% and %TARGET_OUTPUT_BASENAME% without defining exact directory and file name?
Ha, I lied, one more update:
I tried to add a single variable, but it is always added as a set. It works OK, just adds a lot of unnecessary verbiage to the make file.
Thank you very much for putting the effort into creating this application!
Vance
mirai:
Hi, veneff. Sorry for terribly long reply. Haven't check this forum thread for few months.
Currently cbp2make knows only few toolchains by default. It is planned to add all toolchains known to C::B, but only few defaults were hard-coded up until now. Update2 steps are entirely correct, this is the intended way to add toolchains unknown by default.
In order to process assembly file "*.s"/"*.S" you need a defined compiler tool in a toolchain that has these extensions declared as input file extensions (put <option source_extensions="s S"/> line in config xml of the assembler section).
Directory cleanup order may be incorrect, it is just extracted from the list of output file paths as I remember.
Built-in variables are not supported yet.
Adding support for them had been planned as a major update after rev.147,
but I had to put the project on hold due to horrible lack of spare time.
Dvorkin:
cbp2make does not use global C::B compiler's settings.
There are -L"lib_path" and -lm linker's switches in C::B Settings->Compiler->Linker Settings, but there are not the switches in output makefile.
mirai:
Dvorkin
Yes, that's true. cbp2make doesn't use anything that's outside of .cbp or .workspace file (and it shouldn't by design) since the major reason for developing cbp2make was to being able to build C::B projects on systems where C::B is not available. The suggested solution to pass information which is external to a project is to use local or global configuration of cbp2make where it stores information about toolchains and system commands. However, current version of cbp2make does not implement this kind of toolchain-wise settings.
As a quick workaround to this I would suggest to move these settings to global project settings.
the.sniffer:
Please be aware that there is an inconsistency in how cbp2make is handling generation of a list of linking libraries for the linker as compared to CodeBlocks.
For more information please see my reply to the Stack Overflow question: http://stackoverflow.com/questions/25670849/cbp2make-linking-libraries-with-a-on-windows/27672601#27672601
It is my opinion that cbp2make behaviour should be corrected to mach CB (required settings and variables holding file extensions are already present).
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version