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] Mon, 04 June 2012 01:19 Go to next message
Gary Price is currently offline Gary PriceFriend
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 07:55 Go to previous message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
The usage of ${selected_resource_loc} is problematic. It depends on the focus.
See and

Before you ask
- search this forum
- see the 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: Tue Apr 24 01:32:09 GMT 2018

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

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