Source Files – Where to Keep Compiled Application Source Files

source

I use Slackware Linux and I install most applications from the source. I would like to know how to manage the source files, specially the header files, so they are available to other applications.

Best Answer

Best way to get an idea is taking look at the Slackware build scripts (located in sources/*/* in the distribution trees). There are also some additional Slackware package repositories, which contain lots of packages not found in Slackware proper, so you might not necessarily need to build everything yourself. Two of the well-known are Eric Hameleers' slackbuilds repo and slackbuilds.

That said, the install part of the application build system usually puts these files (headers) in the appropriate place, i.e. /usr/include or /usr/local/include, depending whether you are installing into /usr or /usr/local (the latter being usually default).

As for the sources - generally speaking you should not need anything else than headers once you compile the application (apart from any header files you need when you want to compile another piece of code against it). Unless you want to actually develop the software, you discard the sources right after compilation. And if you want to develop you usually keep a separate tree somewhere under version control and do not build your packages from this devel tree, rather from a more stable one.

Last but not the least, you really want to make a package first and only install that (i.e. not running make install as root directly), since it makes system maintenance easier (and you don't have to keep the sources to be able to run make uninstall).

Related Question