User forums > Using Code::Blocks

cbp2make - makefile generation tool

<< < (14/25) > >>

mirai:
Update: (see rev.120)

[+] Implemented build target selection using option "-targets <target1[,target2[, ...]]>". This option allows to generate individual makefiles for different build targets:

--- Quote ---cbp2make -in project.cbp -targets "Debug,Profile" -out Makefile.Debug
cbp2make -in project.cbp -targets "Release" -out Makefile.Release
--- End quote ---
Quotes around parameter of the -targets option may be omitted if target names do not contain spaces.

[+] Added options "--keep-objdir" and "--keep-outdir" to save directories for object files and output binary during cleaning step. By default they are forcefully removed by commands of "clean_*" target.

oswjk:
There's something fishy going on with global variables.

I've got these in the global configuration:


--- Code: ---    <globalvariables>
        <variableset name="default">
            <variable name="qt4" description="">
                <builtin base="/home/oskari/qt-4.7.4/" include="" lib="" obj="" cflags="" lflags="" />
                <user />
            </variable>
            <variable name="trak" description="">
                <builtin base="/home/oskari/TCF" include="" lib="" obj="" cflags="" lflags="" />
                <user />
            </variable>
        </variableset>
    </globalvariables>

--- End code ---

And below is the stuff generated in the top of the makefile:


--- Code: ---qt4 = /home/oskari/qt-4.7.4/
qt4_include = /home/oskari/qt-4.7.4//include
qt4_lib = /home/oskari/qt-4.7.4//lib
qt4_obj =
qt4_cflags =
qt4_lflags =
trak = /home/oskari/TCF
trak_include = /home/oskari/TCF/include
trak_lib = /home/oskari/TCF/lib
trak_obj =
trak_cflags =
trak_lflags =
--- End code ---

All the variables are in small letters in my original .cbp file, but still theres some places where the variables are either not replaced or they are in all caps:


--- Code: ---INC =  -I$(TRAK)/ClientFramework/include -I$(TRAK)/ClientFramework/lib/libstrophe -I$(TRAK)/ClientFramework/lib/qxmpp/src -I$(QT4_INCLUDE) -I$(QT4_INCLUDE)/QtCore -I$(QT4_INCLUDE)/QtNetwork -I$(QT4_INCLUDE)/QtXml
LIBDIR =  -L$(TRAK)/build/lib/$(TARGET_NAME)/ -L$(TRAK)/ClientFramework/lib/qxmpp/lib -L$(QT4_LIB)
OUT_DEBUG = $(#trak)/build/bin/$(TARGET_NAME)/TCF.so

...

before_Debug:
        test -d $(#trak)/build/bin/$(TARGET_NAME) || mkdir -p $(#trak)/build/bin/$(TARGET_NAME)

...

--- End code ---

This causes problems at least for me, because make seems to be case-sensitive when it comes to variables. Also, would it be possible to define the $(PROJECT_NAME) and $(TARGET_NAME)? For example, I have the following in my .cbp:


--- Code: ---<Target title="Debug">
    <Option output="$(#trak)\build\bin\$(TARGET_NAME)\TCF" prefix_auto="1" extension_auto="1" />
    <Option object_output="$(#trak)\build\obj\$(TARGET_NAME)\$(PROJECT_NAME)\" />
    ...
--- End code ---

stahta01:

--- Quote ---<builtin base="/home/oskari/qt-4.7.4/"
--- End quote ---

Should above end with a "/"?

Tim S

mirai:

--- Quote from: oswjk on November 24, 2011, 10:46:12 am ---There's something fishy going on with global variables.
I've got these in the global configuration:

--- End quote ---
Yeah, I see. There's something wrong with target and macro variable casing.
While one of identifier casings (upper,lower,as-is) follows the configuration, another one does not.

Thanks for your effort. This is definitely a bug and I will fix it ASAP.

p.s. Please, send your project file (.cbp) to mirai.computing@gmail.com so I could test against it. I don't have any active projects with global variables in setup.

mirai:
I think I solved this issue with global compiler variables, but I still need a .cbp file to test against it.


--- Quote from: oswjk on November 24, 2011, 10:46:12 am ---Also, would it be possible to define the $(PROJECT_NAME) and $(TARGET_NAME)? For example, I have the following in my .cbp:

--- Code: ---<Target title="Debug">
    <Option output="$(#trak)\build\bin\$(TARGET_NAME)\TCF" prefix_auto="1" extension_auto="1" />
    <Option object_output="$(#trak)\build\obj\$(TARGET_NAME)\$(PROJECT_NAME)\" />
    ...
--- End code ---

--- End quote ---

Yes and no :) A $(PROJECT_NAME) macro is simple, I can add this right now.
But $(TARGET_NAME) is a completely different thing - it should be different for every target in a makefile.
Hence, processing of $(TARGET_NAME) should be either
1) a dirty hack inside cbp2make which I would like to avoid;
2) a bunch of macros like "TARGET_NAME_DEBUG = Debug" which is easy to add and is not a hack but looks less nicely;
3) a generic feature to support some internal macros - but it is not clear to me what macros should be there.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version