IMHO it would make more sense to spend that time developing a CB project generator for Cmake or scons. That way you have true cross platform build system with the easy of an IDE like Code::Blocks. I should really investigate this a little more.
Should be doable, for bakefile too. But first some changes have to come from the compiler framework: settings for debug, optimize, etc. for grouping common flags between compilers.
Self explaining example:
<exe id="myprogram">
<!-- set target-specific variable: -->
<set var="SOME_VAR">value</set>
<!-- three tags: -->
<sources>file1.c myprogram.c utils.c</sources>
<include>./includes</include>
<define>USE_UNICODE</define>
</exe>
Set compiler's optimization level. May be one of off (no optimization), speed (generate fastest code) or size (smallest code):
<set var="OPTIMIZE_FLAG">
<if cond="BUILD=='release'">speed</if>
<if cond="BUILD=='debug'">off</if>
</set>
<exe id="myapp">
<optimize>$(OPTIMIZE_FLAG)</optimize>
<sources>main.c</sources>
<sys-lib>GL</sys-lib>
</exe>