EmbDev.net

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


von Bernard M. (bernard_m)


Rate this post
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:
1
-----------------------------------------------
2
ifdef (Release,$VariableName)
3
4
 some stuff ..
5
6
else
7
8
ifdef (Debug, $VariableName)
9
10
 some other stuff
11
endif
12
------------------------------------------------

I need to know what the variable name is ..

Thanks,
Bernie

von Martin T. (mthomas) (Moderator)


Rate this post
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.

von Bernard M. (bernard_m)


Rate this post
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.

von Bernard M. (bernard_m)


Rate this post
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.

von abc (Guest)


Rate this post
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..

von Jax (Guest)


Rate this post
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

von HausaSaxSnila (Guest)


Rate this post
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.!

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.