Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

in eclipse cdt, how to build target other than the first one

I am quite newbie in using eclipse cdt. I have a makefile project, and have more than two targets in my Makefile. Say the Makefile is as follows,

all: 
 ...
t1:
 ...
t2:
 ...

it's easy to make CDT build target 'all'. However, how can I build targets other than the first one, like t1 and t2? Thanks.

like image 541
Richard Avatar asked Feb 27 '11 16:02

Richard


People also ask

What is a build target in Eclipse?

A "make target" provides a way for developers to interactively select a makefile target from within the Eclipse environment. It is assumed that the makefile is named makefile , which will allow it to run with the default build tool configuration. This can be changed but is cleaner if defaults are used.

When writing code using Eclipse Once you have added a project you need to add a file with code from Project Explorer Where do you create a page to write your code?

Since you already have a makefile, you can create a project with File --> New --> Project --> C/C++ --> Makefile Project with Existing Code. The dialog that pops up asks for the name of the project and the location. Make the location the main directory. and pick whatever project name your want.

What is Eclipse CDT?

The CDT is Eclipse's C/C++ Development Tooling project. It is an industrial-strength C/C++ IDE that also serves as a platform for others to provide value-added tooling for C/C++ developers.


1 Answers

In eclipse, go to:

Window > Show View > Make Target

In the view that opens up, right click your project, click on "New".

Give your target a name, say "T1". Uncheck the "same as the target name" and put the "Make Target" value to t1. Same for t2.

The next time you want to build your targets, look at the Make Target view that you opened, and double click the target you want.

like image 90
Sagar Avatar answered Oct 18 '22 18:10

Sagar