Author Topic: I need some help with makefile options  (Read 4998 times)

GhotiRein

  • Guest
I need some help with makefile options
« on: January 10, 2010, 11:21:36 pm »
Hi folks,

I have this project that was normally build by using a makefile, but now everything is done by Code::Blocks IDE. Well everything except one thing:

include extra/build.mak

This line tells that the make proces should continue with that file, however I do not know where to put this in the Code::Blocks IDE. I really want to be able to do this within Code::Blocks and not use a makefile anymore. Does anybody know how I can pull that off?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: I need some help with makefile options
« Reply #1 on: January 11, 2010, 06:56:35 am »
Does anybody know how I can pull that off?
A Makefile can include other Makefiles (just like a C/C++ program). In your case it includes a sub-set of make commands. If you want to "get rid if this" you'll need to understand what exactly is done in that file and transfer the settings (usually compiler/linker targets and swicthes) to the C::B IDE. It's surely hard to tell what exactly these flags are not knowing the files / project. ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ajallooeian

  • Single posting newcomer
  • *
  • Posts: 3
Re: I need some help with makefile options
« Reply #2 on: November 11, 2010, 11:05:32 am »
Hello,

I have the same issue here, and I do not want to go into the details of the makefile that is included. In my case it is:

space :=
space +=
WEBOTS_HOME_PATH=$(subst $(space),\ ,$(strip $(subst \,/,$(WEBOTS_HOME))))
include $(WEBOTS_HOME_PATH)/resources/controllers/Makefile.include

and this Webots include is not very small. So is there a way in code::blocks to add the exact include command? (Can I do that with scripts?)

Thanks a lot for help

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: I need some help with makefile options
« Reply #3 on: November 11, 2010, 11:29:50 am »
You can either use custom-makefiles or C::B's build-system, but you can not mix them.
In other words to use the included makefile, you also have to use the makefile that includes it as custom makefile (or understand what this makefile does and do the same in C::B).
Code::Blocks does not parse makefiles to get informations out of them, it just calls the make-executable with the custom makefile as parameter.

Offline ajallooeian

  • Single posting newcomer
  • *
  • Posts: 3
Re: I need some help with makefile options
« Reply #4 on: November 11, 2010, 12:09:08 pm »
Thanks a lot for response. I was helpful.
Just a question. I know that I can set the Makefile for a whole project. But can I also do that just for one of the build targets in a project? I have a fairly big project, and I have different build targets to make the application for different uses (as a Webots controller, plot application, ...)

Thanks again

p.s. If I am going to use the stuff in the makefile in my C::B build options, can I just copy and paste them respectively in linker and compiler options, or I have to use defines for variables used in makefile and other stuff like that?


Offline ajallooeian

  • Single posting newcomer
  • *
  • Posts: 3
Re: I need some help with makefile options
« Reply #5 on: November 11, 2010, 12:10:34 pm »
I was helpful --> It was helpful!