On Tue, 2022-11-08 at 13:13 +0400, Joursoir wrote:
Of course, `uninstall`/`install` options should be performed by the package manager, but not limited to this. Otherwise, why do we need `install` option in the Makefile?
It's just strange, that a person can download flashrom sources, use `install` options and then find out that there's no `uninstall` option.
The install target is pretty much a standard in build systems. The "standard" user (even these who compile flashrom by themselves) usually doesn't use it though. People just run the software from that directory when it's self compiled. The install target is mostly meant for package maintainers or for people who know **exactly** what they do, since running these commands might damage your system or bring it into an undefined state. For example, if the software was installed through the package manager before then its own data and state about that package break and become inconsistent when you run the install target, which breaks the package manager. And to make it worse, maybe the other software installed on your system is not even compatible to your build.
In case of package maintainers, they mostly just specify the prefix [1], run `make install` which sets up everything and then the package is built out of it.
There are many operating systems out there and we don't know the users environment. We just can't guess their environment or what they intended their environment to be and so running any command with privileged rights is **always** a risk. That's not our responsibility.
There are surely other cases where the install target is useful as well. For example, when you want to build your system from scratch. Another case might be, you are a developer, you want to have that binary system-wide available for some reason and you want it in your path temporarily. So you could set the PREFIX variable to /usr/local, which is not managed by the package manager, do your thing and the other system directories stay untouched.
However, an uninstall target doesn't make sense since there are way too many unknown variables and what not.
// Felix
[1] https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/tools/misc/flashro...