How to make a .deb file of a source package for personal installation/uninstallation only, NOT for distribution
Warning: Note that packaging a source package for distribution via PPA or even via plain .deb is quite complicated and you should start off with this guide and its links as well as this other guide in that case. I have also found the #debian-mentors channel on the official Debian IRC to be a great situation-specific resource for beginning packagers/devs.
To create a deb for personal use, the easy solution for most cases is to simply use checkinstall, which will create a .deb file that you can not only install on other (compatible) systems with the appropriate dependencies installed, but also allows you to uninstall the package. Note that GCC is a large and complex package, so checkinstall may not work with it!
sudo apt-get install checkinstall -y
- When done with
make, run checkinstall instead of make install
- checkinstall will install your application AND give you a .deb file in the current (source) folder which you can simply copy and install on other systems with
dpkg -i
- Use
dpkg -r application-name to remove the application at any time (should also work from Synaptic)