EmbDev.net

Forum: ARM programming with GCC/GNU tools Accessing Eclipse build variables in a Makefile


Author: Bernard M. (bernard_m)
Posted on:

Rate this post
0 useful
not useful
Hi All,

I am using eclipse and have a Makefile project. (It builds fine ..)

I would like to access the Eclipse variable that shows what the current 
configuration is (i.e Release, Debug etc), so that I can change the 
optimization flags in my Makefile...

i.e in my Makefile I want to do:
-----------------------------------------------
ifdef (Release,$VariableName)

 some stuff ..

else

ifdef (Debug, $VariableName)

 some other stuff
endif
------------------------------------------------

I need to know what the variable name is ..

Thanks,
Bernie

Author: Martin Thomas (mthomas) (Moderator)
Posted on:

Rate this post
0 useful
not useful
I have never tested this myself: it's possible to read environment 
variables from make and Eclipse offers the option to set environment 
variables. Maybe you can also use special make targets in Eclipse and 
include additional target-rules for them.

Author: Bernard M. (bernard_m)
Posted on:

Rate this post
0 useful
not useful
Yes, I could specify special make targets, but that's really not what I 
want to do ..

I just need to know how to access the variables in eclipse. You say you 
havn't tested this, but do you know how to access these variables in 
make?

thanks,
B

EDIT: I notice in eclipse that the enviroment variable that holds the 
current build configuraion is called "ConfigName", however accessing 
that name with the syntax "ifdef (Release,$Configname)" in the makefile, 
does not seem to work.

Author: Bernard M. (bernard_m)
Posted on:

Rate this post
0 useful
not useful
I found out how to fix this ..

Under Eclipse properties for the project goto C/C++ Build->Environment 
and add the system variable ConfigName so that it is exported .... it is 
then visible to the make program ... works great.

Author: abc (Guest)
Posted on:

Rate this post
0 useful
not useful
Hi..
Please help..In eclipse..

if the code is :

#ifdef ABC

code();

#endif


I want to access the function code() using Open Declaration. How can I 
do this without defining ABC in source code..


Thanks in advance..

Author: Jax (Guest)
Posted on:

Rate this post
0 useful
not useful
>I want to access the function code() using Open Declaration. How can I
>do this without defining ABC in source code..

Simple.

Project/Properties/C/c++ General/Paths and Symbols/Symbols
then "Add".

In most cases you want to tick "Add to all configurations"
and possibly also "Add to all languages"
Else RTFM.


Jax

Author: HausaSaxSnila (Guest)
Posted on:

Rate this post
0 useful
not useful
Willkommen in unseren Sexchat.


 Der Sexchat gibt dir eine Alternative transvestiten kontakte  und 
natürlich vieles mehr,unter anderem erotische Rollenspiele
 Hier in unsrem Sexchat erwarten dich transvestiten kontakte  Flirt und 
Sextalk
 Eventuel suchst du Aufregend chatten , sicher bist du hier genau 
richtig.Ok,worauf wartest du?
 sexuelle Vorlieben nackt sexy kostenlos  ,sofort anmelden .
 Du suchst jemand von Graz, oder von München, vieleicht aus Regensdorf , 
vieleicht von Wallisellen, vieleicht in AffolternamAlbis? Bestimmt ist 
da jemand dabei.!

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.