What you need then is a software automation system. There are several ways this can be done, but I myself have never dealt with any of them seriously, hehe!
This is a really vast subject - just the Wikipedia page about software automation systems (ptbr)is quite old. As expected, each has its own pros and cons.
But to cut your search short, I would give three recommendations: Waf, Meson and cmake. They are versatile and easy to learn, and major distributions and software installation channels have good support. The Waf I would recommend for small projects, and the Cmake for larger ones. (The GNU Autotools are famous and widely used, but I find them too complicated. I do not recommend.)
After that, well, you can already open an account on Github, Gitlab, Sourceforge, Bitbucket or whatever, and release your software to the world! (Here’s when you’ll think about what furlough choose...).
P.S.: As for the apt-get
, this is specifically a package installation command. Each distribution handles this in its own way. Because of this, I would recommend leaving this package creation to the developers of each distro.