Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Edit managed make file(I want to edit managed make file -> CFLAG)
Edit managed make file [message #515029] Wed, 17 February 2010 14:18 Go to next message
Secure Linprog is currently offline Secure LinprogFriend
Messages: 5
Registered: February 2010
Junior Member

I want to edit makefile that Eclipse automatically create it.

I want to add one line to it like:

CFLAGS += -DLOG_DIS_VAR_NAME=$(DIS_NAME)_log_id

How can do it?

Can I include a file in automatically generated makefile?

Is there any way for changing CFLAG in "Managed Make C Project"?
Re: Edit managed make file [message #515133 is a reply to message #515029] Wed, 17 February 2010 20:38 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Secure Linprog wrote on Wed, 17 February 2010 09:18
I want to edit makefile that Eclipse automatically create it.

I want to add one line to it like:

CFLAGS += -DLOG_DIS_VAR_NAME=$(DIS_NAME)_log_id

How can do it?

Can I include a file in automatically generated makefile?

Is there any way for changing CFLAG in "Managed Make C Project"?

You can change the CFLAGs via Project Properties->C/C++ Build


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Edit managed make file [message #515197 is a reply to message #515133] Thu, 18 February 2010 06:53 Go to previous messageGo to next message
Secure Linprog is currently offline Secure LinprogFriend
Messages: 5
Registered: February 2010
Junior Member

Quote:
You can change the CFLAGs via Project Properties->C/C++ Build


Do you intent I change CFLAGS as follow?

"in GCC C Compiler->Expert Settings->command line pattern->
Here I change this
${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}
to
${COMMAND} ${CFLAGS += -DLOG_DIS_VAR_NAME=$(DIS_NAME)_log_id} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}

Do i understand correctly?


Re: Edit managed make file [message #515208 is a reply to message #515197] Thu, 18 February 2010 08:28 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Secure Linprog wrote on Thu, 18 February 2010 01:53
Quote:
You can change the CFLAGs via Project Properties->C/C++ Build


Do you intent I change CFLAGS as follow?

"in GCC C Compiler->Expert Settings->command line pattern->
Here I change this
${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}
to
${COMMAND} ${CFLAGS += -DLOG_DIS_VAR_NAME=$(DIS_NAME)_log_id} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}

Do i understand correctly?


Nearly. You must add a symbol (option -D) in "in GCC C Compiler->Symbols".


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Edit managed make file [message #515270 is a reply to message #515029] Thu, 18 February 2010 10:26 Go to previous messageGo to next message
Secure Linprog is currently offline Secure LinprogFriend
Messages: 5
Registered: February 2010
Junior Member

Thank you very much.

I have another question.
If I want to add below line to automatically generated makefile, Should I add a symbol(option -U) in "GCC C Compiler->Symbols"?
DIS_NAME = dis_pcapf

[Updated on: Thu, 18 February 2010 10:42]

Report message to a moderator

Re: Edit managed make file [message #515300 is a reply to message #515270] Thu, 18 February 2010 12:18 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Secure Linprog wrote on Thu, 18 February 2010 05:26
Thank you very much.

I have another question.
If I want to add below line to automatically generated makefile, Should I add a symbol(option -U) in "GCC C Compiler->Symbols"?
DIS_NAME = dis_pcapf


That won't work. Option -U will undefine a symbole.
Add LOG_DIS_VAR_NAME=dis_pcapf_log_id to the defined symbols (option -D).
IMHO, it is not possible to add something to the Makefile. You can only change compiler options.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Edit managed make file [message #515347 is a reply to message #515300] Thu, 18 February 2010 14:37 Go to previous message
Secure Linprog is currently offline Secure LinprogFriend
Messages: 5
Registered: February 2010
Junior Member

Thank you for helping.
Previous Topic:Play sound when compilation succeed / failed - is it possible?
Next Topic:Porting from Linux to Windows
Goto Forum:
  


Current Time: Fri Apr 26 09:33:17 GMT 2024

Powered by FUDForum. Page generated in 0.03649 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top