Accessing Eclipse build variables in a Makefile

OP #1878435
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
Moderator #1880114
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.
OP #1880771
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.
OP #1880860
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.
Guest #1944230
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..
Guest #1945573
>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
Guest #1958052
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

A question of your own? This thread is over 16 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.