Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Joining Makefiles from Managed Projects
Joining Makefiles from Managed Projects [message #153134] Mon, 05 September 2005 16:08 Go to next message
Eclipse UserFriend
Originally posted by: ltcmelo.gmail.com

Hi all.
I'm beginning with CDT. I'm trying to work with cdt in a project that
requires a lib (CGAL - computational geometry algorithms library). When I
install CGAL from a script, a makefile based on my configuration and
system is generated for me. So , I'm supposed to use this makefile for my
CGAL apps. However, I'm not good at makefiles, and that's why I like to
work with managed cdt projects (that already generates the makefiles for
me). But now, I need to incorporate the CGAL makefile and still keep using
managed projects. And I don't know how can I do that? Is it possible?
Maybe, I could tell cdt to pre-process this CGAL makefile and than the
other from my project...
Well, any ideas are welcome.
Thanks.
Re: Joining Makefiles from Managed Projects [message #153142 is a reply to message #153134] Tue, 06 September 2005 00:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: proctophantasmist.free.fr

CDT's managed project creates a top level makefile (one per
configurations actually) for you called, well, Makefile. You can find it
in the configuration subdir (release or debug for instance). In it
you'll see this line:

-include $(ROOT)/makefile.init

this is make's equivalent of the #include directive, it is the mecanism
you must use, and thankfully CDT makes that possible by providing three
"hooks", makefile.init afore mentioned, makefile.defs, and makefile.targets.
You need to create at least one of those files in the top level
directory of your project. My advice would then be to plug in your
configuration script in one of those three makefiles (technically it
doesn't really matter which one, though makefile.init or makefile.defs
would be the natural one in your case I guess) using:

-include $(ROOT)/path_to_your_configuration_script



That said, I haven't seen your auto-generated makefile but you will have
to make some adjustments, that is a given, so that the two makefile
"blend". So you will need a basic understanding of make (make's
scripting language is pretty basic in any case) to do that .

http://www.gnu.org/software/make/manual/html_chapter/make.ht ml

The most obvious trick is to go in your project C/C++ build properties
in CDT: in the tool setting panel add
$(CXXFLAGS)
as a compiler command line "miscellaneous" option
and
$(LNKFLAGS) as a linker "miscellaneous" option

now "$(CXXFLAGS)" is a make expression which expands as the value stored
in the variable CXXFLAGS (the name is of course arbitrary). Hence you
will have complete control of the compiler and linker options for your
project through the definitions of CXXFLAGS and LNKFLAGS you'll put in
one of the included makefiles. This will enable you to "import" the
settings found in the CGAL makefile.

OK now that I've read what I wrote I'm hoping someone has a better idea
and is capable of better explanations.

good luck.


Leandro Melo wrote:
> Hi all.
> I'm beginning with CDT. I'm trying to work with cdt in a project that
> requires a lib (CGAL - computational geometry algorithms library). When
> I install CGAL from a script, a makefile based on my configuration and
> system is generated for me. So , I'm supposed to use this makefile for
> my CGAL apps. However, I'm not good at makefiles, and that's why I like
> to work with managed cdt projects (that already generates the makefiles
> for me). But now, I need to incorporate the CGAL makefile and still keep
> using managed projects. And I don't know how can I do that? Is it possible?
> Maybe, I could tell cdt to pre-process this CGAL makefile and than the
> other from my project... Well, any ideas are welcome.
> Thanks.
>
Re: Joining Makefiles from Managed Projects [message #153150 is a reply to message #153142] Tue, 06 September 2005 00:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: proctophantasmist.free.fr

err:
-include $(ROOT)/path_to_your_configuration_script

too tired... obviously the "$(ROOT)/" part shouldn't be there, it should
just be the path to the script.
Re: Joining Makefiles from Managed Projects [message #153466 is a reply to message #153150] Thu, 08 September 2005 14:42 Go to previous message
Eclipse UserFriend
Originally posted by: ltcmelo.gmail.com

Thanks!!!
I'll try to work on that and let you know if everything turned out ok.
Previous Topic:content of the outline view corrupted
Next Topic:Development status of org.eclipse.cdt.debug.win32.core
Goto Forum:
  


Current Time: Tue Apr 23 11:09:44 GMT 2024

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

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

Back to the top