Coming from the world of C and C++, most build system have an install
target, notably Makefiles (where it is recommended by GNU for example) or CMake. This target copies the runtime files (executables, libraries, ...) in the operating system (for example, in C:\Program Files\
on Windows).
This feels really hacky, since for me it is not the responsibility of the build system to install programs (which is actually the responsibility of the operating system / package manager). It also means the build system or build script must know the organization of installed programs, with environment variables, registry variables, symlinks, permissions, etc.
At best, build systems should have a release
target that will output an installable program (for example .deb
or .msi
), and then kindly ask the operating system to install that program. It would also allow the user to uninstall without having to type make uninstall
.
So, my question: why do build system usually recommend having an install
target?
make install
usually installs under/usr/local
(or even/opt
) which are directories not handled by the "core OS/package management system". No idea whether Windows has some similar convention though.make install
makes no sense when we talk about cross-compilingDESTDIR
.