User forums > Using Code::Blocks
cbp2make - makefile generation tool
killerbot:
sounds good : target-case
oBFusCATed:
I'm not a user of cbp2make, but I guess less options is better.
mirai:
Update: (see rev.101)
I implemented both of ideas discussed above, you may try them now.
[+] Default options can be stored in configuration file. Use "cbp2make --config options --default-options "<your_options>"" command to pass some of frequently used options to configuration, they will be applied every time you run cbp2make with this configuration, so the actual command line can be shortened.
[+] Implemented optional build target name casing. Use "--target-case <case>" option to select one of possible casings "keep", "lower" or "upper", default value is "keep".
mirai:
Update: (see rev.107) an intermediate release
The next [stable] release is not ready yet, but there were few important changes and I thought it would be nice to indicate that the project is alive.
[+] Fixed small ugly bug which made makefiles for individual projects and workspace projects completely different.
[+] Partially rewrote makefile generation for multiple toolchain architecture. Commands for build tools are generated with CB-compatible command templates. It mostly works fine with a couple of exceptions: 1) option switches for includes and defines "/I" "/D" in Windows won't work - they can be configured, but not taken into account (hardcoded "-I" "-D" are still in use); 2) linker requirements for paths, prefixes and extensions of libraries are also managed by old code;
[+] Updated tool chain and build tools configuration interface.
While some features are yet incomplete, I hope nothing is seriously broken.
--- Quote ---Usage syntax:
Generate makefile:
cbp2make -in <project_file> [-cfg <configuration>] [-out <makefile>]
[-unix] [-windows] [-mac] [--all-os] [--flat-objects] [--flat-objpath]
[--wrap-objects] [--wrap-options] [--target-case keep|lower|upper]
cbp2make -list -in <project_file_list> [-cfg <configuration>]
[-unix] [-windows] [-mac] [--all-os] [--flat-objects] [--flat-objpath]
[--wrap-objects] [--wrap-options] [--with-deps] [--target-case <case>]
Manage toolchains:
cbp2make --config toolchain --add [-unix|-windows|-mac] -chain <toolchain>
cbp2make --config toolchain --remove [-unix|-windows|-mac] -chain <toolchain>
Manage build tools:
cbp2make --config tool --add [-unix|-windows|-mac] -chain <toolchain>
-tool <tool> -type <type> <tool options>
cbp2make --config tool --remove [-unix|-windows|-mac] -chain <toolchain>
-tool <tool>
Tool types: pp=preprocessor as=assembler cc=compiler rc=resource compiler
sl=static linker dl=dynamic linker el=executable linker
nl=native linker
Tool options (common):
-desc <description> -program <executable> -command <command_template>
-mkv <make_variable> -srcext <source_extensions> -outext <output_extension>
-quotepath <yes|no> -fullpath <yes|no> -unixpath <yes|no>
Tool options (compiler):
-incsw <include_switch> -defsw <define_sqitch> -deps <yes|no>
Tool options (linker):
-ldsw <library_dir_switch> -llsw <link_library_switch> -lpfx <library_prefix>
-lext <library_extension> -objext <object_extension> -lflat <yes|no>
Manage platforms:
cbp2make --config platform [-unix|-windows|-mac] [-pwd <print_dir_command>]
[-cd <change_dir_command>] [-rm <remove_file_command>]
[-rmf <remove_file_forced>] [-rmd <remove_dir_command>]
[-cp <copy_file_command>] [-mv <move_file_command>]
[-md <make_dir_command>] [-mdf <make_dir_forced>]
[-make <default_make_tool>]
Manage global compiler variables:
cbp2make --config variable --add [-set <set_name>] -name <var_name>
[-desc <description>] [-field <field_name>] -value <var_value>
cbp2make --config variable --remove [-set <set_name>] [-name <var_name>]
[-field <field_name>]
Manage options:
cbp2make --config options --default-options "<options>"
cbp2make --config show
Common options:
cbp2make --local // use configuration from current directory
cbp2make --global // use configuration from home directory
cbp2make --verbose // show project information
cbp2make --quiet // hide all messages
cbp2make --help // display this message
cbp2make --version // display version information
--- End quote ---
pacrook:
Tried out rev.107 on a relatively simple project. Works well - thanks for very useful tool.
One small gotcha, if I use a command like `pkg-config --libs someLib` for linking I have to put it (in Codeblocks) under Linker settings; Other linker options. Then in the generated Makefile it appears under the parameter LDFLAGS (i.e. LDFLAGS = `pkg-config --libs someLib`) which results in a call to g++ along the lines of:
g++ `pkg-config --libs someLib` somethingA.o somethingB.o -o sometthingExec
This fails due to the linker not finding the pkg-config libraries associated with someLib.
If I manually change the Makefile such that the linking pkg-config command appears instead under LIB (i.e. LIB = `pkg-config --libs someLib`). Then the resulting g++ linking call is:
g++ somethingA.o somethingB.o `pkg-config --libs someLib` -o sometthingExec
which works fine.
Not sure if this is something that could easily be fixed? You could look out for special cases starting with `pkg-config --libs?
Thanks again for a useful tool.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version