[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.cdt] Re: Eclipse/CDT has a problem with correct variable expansion

Andreas Kraatz wrote:
But if it is not a good idea to use variables within build configurations how can I solve my problem?
Background:
I have Makefile that can build my whole project and allows to compile a single file. This file name (including path) must be passed to the Makefile as an argument.
In Eclipse/CDT I have two build configurations (one for the whole project and one to compile a single file, which uses ${selected_resource_loc}). Now I can select a file from my source list and execute the compile command. But you tell me this is a typical user error! I'm confused! Yes, I read all bugs referenced from your link - thanks again.

This is one of shortcomings of CDT. I don't have a good advice. The best I can suggest is to use context menu in Project Explorer to compile your file - namely Make Targets->Build and run your make target from the table. You would need to create Make Target via the context menu using ${selected_resource_loc} ;-), and run it via the same context menu. One trick here is using Project Explorer so the UI selection ${selected_resource_loc} is right, another one is to use Make Targets build to minimize deadlocks. The disadvantages are that you have to create those targets in each freaking folder (you can easily copy them in Make Targets view though), and not very convenient way to use it - too many clicks. Hmm, sounds complicated. You could encounter one or two bugs there too...


Or you may do something else altogether, like writing your makefiles efficiently accounting for each dependency so it compiles only what is necessary...

Perhaps a good compromise is to forfeit compiling a single file and use Make Targets View compiling a folder. We use mostly that view and I find it most convenient. You can place a target in specific folder, it does not have to reside in project root.

Andrew