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

I have a simple Eclipse C project. Is there a way to add the make install target to the generated makefile? I cannot find the right search keywords to find any useful information in a document or search query (i.e. Too much noise and no signal).

I tried to create a simple project using the autotools plugin, but not being able to find any useful document or tutorial starting from scratch with one source C file, I could not even build the project.

Edit: I will answer based on using the autotools plugin if I can create my project. I don’t see how to add the include dir (-I) link dir (-L) or additional link libraries in the new Hello World autotools C project. Is there any simple tutorial on connecting autotools plugins that covers this?

+3
source share
1 answer

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

-include ../makefile.targets

This means that you can create your own make file, which has its own goals.

makefile target example

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

where helloworld is the name of your application

+3
source

Source: https://habr.com/ru/post/1745163/


All Articles