Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsJoining Makefiles from Managed Projects
https://www.eclipse.org/forums/index.php/mv/msg/47523/153134/#msg_153134
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.]]>2005-09-05T16:08:51-00:00Re: Joining Makefiles from Managed Projects
https://www.eclipse.org/forums/index.php/mv/msg/47523/153142/#msg_153142
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:
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 .
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.
>]]>2005-09-06T00:41:03-00:00Re: Joining Makefiles from Managed Projects
https://www.eclipse.org/forums/index.php/mv/msg/47523/153150/#msg_153150
Originally posted by: proctophantasmist.free.fr
too tired... obviously the "$(ROOT)/" part shouldn't be there, it should
just be the path to the script.]]>2005-09-06T00:44:42-00:00Re: Joining Makefiles from Managed Projects
https://www.eclipse.org/forums/index.php/mv/msg/47523/153466/#msg_153466
Originally posted by: ltcmelo.gmail.com
Thanks!!!
I'll try to work on that and let you know if everything turned out ok.]]>2005-09-08T14:42:21-00:00