Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Building the selected resource(How to build the selected resource in an external makefile system)
Building the selected resource [message #881139] Sun, 03 June 2012 21:19 Go to next message
Gary Price is currently offline Gary Price
Messages: 3
Registered: May 2012
Junior Member
I have a large existing C++ code base (15000 files) that uses a recursive make system for its build. This has been set up as a single project in Eclipse CDT. There are various build configurations of interest based on 32 and 64-bit, debug and release etc. Several executables can be built, and each has a recursive make. The submakes are for static libraries that are used by all the executables. For each of these there is a folder, represented in the project as a linked resource. The linkage is relative so that the project can be stored in Perforce. At times it is convenient to build a static library on its own. I implemented a set of Make targets for this purpose. However, I have to have one for each configuration and static library, which is a lot of Make Targets.

As an alternative I have been looking at using the build icon in the toolbar, and combining it with the currently active build configuration. My aim was to be able to build using the makefile in a folder by selecting the folder and clicking the "build" icon. I tried to implement this by defining the following build command for each build configuration:
make -C ${selected_resource_loc} config=${ConfigName}

The make system is set up so this builds the main target in the Makefile, using the current configuration name to select various compiler settings. This builds what I expect sometimes, but not always. For example, if I start Eclipse and select a folder that contains a Makefile, it builds the right thing. But if I then select a different folder, it still builds the previous one. However, if I use the drop-down on the build icon to change the build configuration, it builds in the selected folder.

Is this expected behavior? Is there a way of making this work?
Re: Building the selected resource [message #882297 is a reply to message #881139] Wed, 06 June 2012 03:55 Go to previous message
Axel Mueller is currently offline Axel Mueller
Messages: 1949
Registered: July 2009
Senior Member
The usage of ${selected_resource_loc} is problematic. It depends on the focus.
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=323487 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=260524


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Previous Topic:Problem "using namespace ..."
Next Topic:How to find out, which of the IASTComments is the top-level file comment
Goto Forum:
  


Current Time: Thu Aug 21 16:10:45 EDT 2014

Powered by FUDForum. Page generated in 0.02773 seconds