The easiest way is to create a "install" section in your makefile that installs the program, and then run checkinstall . You may need to install it using aptitude install checkinstall .
checkinstall runs make install , finds out what has been changed, then creates a package on it.
To make the installation section in a makefile, simply put the commands that you need to install your program. Here is an example program that creates a binary called "myprogram" and needs some configuration in / etc:
# make example myprogram: main.o something_else.o gcc -o myprogram main.o something_else.o -llibrary_goes_here install: myprogram cp myprogram /usr/bin #install binary cp -R etc /etc/myprogram # copy "etc" folder to /etc/myprogram
There's a command called install that likes cp and allows you to specify permissions, but I don't know the syntax well enough.
You will also need a section for each .o file that tells you how to compile it (possibly gcc -c filename.cpp ).
source share