Jim Flood
Jim Flood

Reputation: 8487

How to add "make install" target to simple Eclipse C project

I have a simple Eclipse C project. Is there a way to add a "make install" target to the generated makefile? I can't seem to find the right search keywords to find any useful information in the doc or by googling (i.e. there is too much noise and no signal.)

I tried creating a simple project using the autotools plug-in but without being able to find any useful doc or tutorial that starts from scratch with a single C source file, I couldn't even get the project to build.

Edit: I'll take an answer based on using the autotools plug-in if I can get my project to build. I don't see how to add an include dir (-I) a link dir (-L) or additional link libs to a new Hello World autotools C project. Is there any simple autotools plug-in tutorial that covers this?

Upvotes: 3

Views: 3677

Answers (1)

iondiode
iondiode

Reputation: 650

Not familiar with the autotools plugin, but if you look at your generated makefile there should be a line

-include ../makefile.targets

This means you can create your own make file that has your own targets

an example makefile target

install: helloworld
      sudo cp Debug/helloworld /usr/bin

where helloworld is the name of your application

Upvotes: 3

Related Questions