Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Compiler/Linker variables

(1/2) > >>

killerbot:
Hello,

I am trying to add the Texas Instruments Code Composer Studio compiler to CB.
But I am running into several problems :

1) do the following variables exist ? and if not can they be created ?
  - the objects output directory, this can be specified in the Target configuration (for example ./TIobjs), but I need it as a variable in the advanced compiler/linker settings
TI compiler needs an option like this : -fr"./TIDebugObjs" just telling it where to put the obj's, and the output file needs not to be specified, here's a full compiler command :

"C:\CCStudio\C6000\cgtools\bin\cl6x" -q -o2 -fr"../tiRelease" -i"../inc" -i"../src" -i"../../General/inc" -ml3 -mv6400 -@"../Release.lkf" "Codec.cpp"

--> so no -c option, no -o option
 - maybe also the output directory for the static library/exe/... (could reuse the directory for the obj's for this)

2) self made variables show up weird or incorrect ?
As a workaround I tried to create an custom variable for the compiler :
  objects_output_dir=".TIDebugobjs"
and changed the compiler line macro to :
  $compiler $options $includes $file -fr$(objects_output_dir)
but i get replaced wrong :
  a)$objects_output_dir  --> conflict with $objects, this latter goes first (so no longest substitution)
  b)$(objects_output_dir) --> no more conflict but during compile we get the following :
cl6x.exe   -g  -q -mv6400   -I"..\General\inc" -I"inc"  -I"C:\CCStudio\C6000\cgtools\include" src\CodecDebug.cpp -fr$(objects_output_dir)

No substitution ? It seems like it, though maybe it was substituted.
Note also the filename of the cpp, it contains a part of the relative path, sources are in a subdir "src" of the project directory. But maybe this latter thing can be dealed with, you just get in the obj's directopry also that src subdir and so on ..., just need to specify it then correctly to the linker.

3) is the target name available as variable ?


kind regards,
Lieven




thomas:
With RC2, you can use the following bultins:
${PROJECT_FILENAME}
${PROJECT_NAME}
${PROJECT_DIR}
${ACTIVE_EDITOR_FILENAME}
${ALL_PROJECT_FILES}
${MAKEFILE}
${OUTPUT_FILE}
${OUTPUT_DIR}
You will want to use ${OUTPUT_DIR}. If you have the targets foo and bar, you would use ${FOO_OUTPUT_DIR} and ${BAR_OUTPUT_DIR}, respectively. The current per-target output file/dir are not supported at the present time.

With HEAD, you can use:
${PROJECT_FILENAME} ${PROJECT_FILE} ${PROJECTFILE}
${PROJECT_NAME}
${PROJECT_DIR} ${PROJECTDIR} ${PROJECT_DIRECTORY}
${CODEBLOCKS} ${APP_PATH}  ${APPPATH}
${DATA_PATH} ${DATAPATH}
${PLUGINS}
${ACTIVE_EDITOR_FILENAME}
${ALL_PROJECT_FILES}
${MAKEFILE}
${OUTPUT_FILE}
${OUTPUT_DIR}

I don't know if you can omit the -o flag without recompiling the compiler plugin (but I doubt it).


--- Quote from: killerbot on November 03, 2005, 12:26:20 pm --- a)$objects_output_dir --> conflict with $objects, this latter goes first (so no longest substitution)
 b)$(objects_output_dir) --> no more conflict but during compile we get the following :
cl6x.exe -g -q -mv6400 -I"..\General\inc" -I"inc" -I"C:\CCStudio\C6000\cgtools\include" src\CodecDebug.cpp -fr$(objects_output_dir)

--- End quote ---
Hmm this looks like a bug, will see if I can reproduce it and find a cause.


--- Quote ---3) is the target name available as variable ?

--- End quote ---
Not at the present time.

thomas:

--- Quote from: thomas on November 03, 2005, 01:29:52 pm ---
--- Quote from: killerbot on November 03, 2005, 12:26:20 pm --- a)$objects_output_dir --> conflict with $objects, this latter goes first (so no longest substitution)
 b)$(objects_output_dir) --> no more conflict but during compile we get the following :
cl6x.exe -g -q -mv6400 -I"..\General\inc" -I"inc" -I"C:\CCStudio\C6000\cgtools\include" src\CodecDebug.cpp -fr$(objects_output_dir)

--- End quote ---
Hmm this looks like a bug, will see if I can reproduce it and find a cause.

--- End quote ---
Could not reproduce that.


--- Quote from: thomas on November 03, 2005, 01:29:52 pm ---
--- Quote ---3) is the target name available as variable ?

--- End quote ---
Not at the present time.

--- End quote ---
Trying to implement that. It is not as trivial as it looks, however.

Or, do you only need the target's name inside the compiler?

killerbot:
When target name could be on interest.

Suppose you have a project.

Several targets :

1) Target 1 : Debug : using GNU CB compiler
2) Target 2 : release : using GNU CB compiler
3) Target 3 : using Digital Mars Compiler
4) Target 4 : using M$ compiler debug
5) Target 5 : using M$ compiler release
6) Target 6 : using TI compiler debug
7) Target 7 : using TI compiler release
8) Target 8 : using WindRiver compiler debug
9) Target 9 : using WindRiver compiler release

and so on.
This is not fantasy, reality at my job.

As mentioned for the TI compiler I need to specify stuff as -fr"../tiDebug" and -@"../Debug.lkf"
a) -fr"../tiDebug", here I could use the ${OUTPUT_DIR}
b) -@"../Debug.lkf", the ti compiler appends stuff to a response file, that later on is used during the linking step, ti compiler is very crappy on paths, so it's best to leave it where ti preferres it. So here it would be nice to create as filename for that response file -@"../$(target_name).lkf"

And it is best that this is a compiler setting (may be in the advanced where we customize specify it), but preferably not in the project itself.

I guess for other stuff the target name might also be interesting, but on the other hand maybe there are workarounds to accomplish the same thing without this new variable ...


Cheers,
Lieven

thomas:

--- Quote from: killerbot on November 03, 2005, 05:23:52 pm ---When target name could be on interest.
[...]
This is not fantasy, reality at my job.
--- End quote ---
Not what I asked. I understand that you write a compiler plugin for the TI compiler, and this compiler needs the build target's name (for what reason does not matter). Is that the case?

The issue of providing the current target's name as a general builtin compiler variable is an entirely different one and a lot more complicated. But if it is just the above that you need, it is really easy.

Navigation

[0] Message Index

[#] Next page

Go to full version