Closed uvtc closed 2 years ago
Good point.
One of the problems I see with this is that the install script has parameters. Unless you invoke make uninstall
with the same parameters, it won't work. This is better handled by means of a package manager. The install
target is very simple and installs the binary, a shared directory, a doc directory and a man/info page. It is very easy to remove them.
OTOH, if a make uninstall
checked for a $(DESTDIR)$(PREFIX)/bin/ne
and found none, it could say it needs the same parameters the install
target had, otherwise it attempts the removal. If they already aren't there, then no harm done.
It could be as simple as giving the user the commands and saying "You'll have to do these manually, assuming this is where previously you installed ne." A note mentioning that "Personal ~/.ne
directories may remain after uninstall
but it's safe to remove them" would be a nice touch too.
The point being, it's better to have an uninstall
target, even if just to assure that there's not some non-obvious hidden junk lying around.
OK, I found some magick on StackOverflow that will do it without using shell commands. Please have a look: d954f8cfa2c4c44d4df76f34eefc8f4c437600bf
That nearly broke my brain! I like it in that it seems to do exactly the right thing with minimal text added. But it is subtle.
(Also, check for trailing space, or view it with sy tabs
to see inadvertent trailing space.)
git diff will red out traliling spaces, too. There's none.
??? Lines 84 and 85.
OK, you're right, and that's really weird. Usually it does. Or maybe not on all files... fixed!
Thank you. I don't yet understand the makefile magic you've conjured, but if it nearly broke Todd's brain I should probably look closely. :)
I wonder if, as part of the make install process, if anyone ever writes out a small text file to the cwd that includes those parameters that were used, in order to help inform a possible later manual uninstall.
Well, I think that if someone is fiddling with install/uninstall, they better know what they're doing 😂.
Since the uninstall target has been added, closing this issue. Thanks again.
Not sure how customary this is to supply an uninstall target for programs installed via makefile, but it would be handy for cases where users want to upgrade to a much newer version and don't want to risk leaving remnants of the old version around.
Also for folks who want to completely remove ne for whatever reason.
Personally, it's always a good sign to me when software provides an easy uninstall.