Skip to contentSkip to conversation

Add uninstall target to Makefile

PATCH Martin Atukunda 5 participants 9 messages Jun 15, 2016 1 message not in the archive Kbuild

lore
Share & tools
lore
#0 lore raw

Add the uninstall target to the Makefile.

---

Makefile +9 -0
@@ -305,6 +305,15 @@ install-doc:
 	$(MAKE) -C Documentation install
 
 
+### Uninstallation rules
+
+uninstall:
+	-sh ./remove-cmd-rename.sh $(DESTDIR)$(bindir)
+	cd $(DESTDIR)$(bindir) && \
+	rm $(PROGRAMS) $(SCRIPTS) && \
+	rm git-cherry-pick && \
+	cd $(DESTDIR)$(GIT_PYTHON_DIR) && \
+	rm $(PYMODULES)
 
 
 ### Maintainer's dist rules
remove-cmd-rename.sh new file +51 -0

51 lines not on this page · raw message

#1 lore raw
Quoted 1 line · Martin Atukunda

Add the uninstall target to the Makefile.

Sorry, I absolutely detest other peoples' Makefiles that has this target. Why would anybody want this?

#3 lore raw
In reply to a message not in the archive
Quoted 7 lines · Tony Luck

Perhaps it would be easier[1] to support "make obsolete-uninstall" that would remove
objects installed by previous generations of git?

-Tony

[1] easier, nicer, cleaner, less detestable, whatever.

And how far back a release should we keep track of the name of obsolete versions? /usr/bin/git-uninstall for each particular version that knows what that version ships _might_ make some sense, but I do not see much point in having uninstall target in the Makefile. Should one be allowed to run make uninstall with bindir or DESTDIR set to different values from the ones used when 'make install' was run the last time? What about things like "make WITH_SEND_MAIL=YesPlease install"?

Guys, packaged distributions know how to remove obsolete binaries. OTOH if you are building from the source and installing, you are the only one who knows what you are installing and where.

#4 lore raw
In reply to Junio C Hamano
Quoted 6 lines · Junio C Hamano
Quoted 1 line · Martin Atukunda

Add the uninstall target to the Makefile.

Sorry, I absolutely detest other peoples' Makefiles that has this target. Why would anybody want this?

Is this a serious question? To uninstall the binaries e.g. if you installed them in the wrong place?

Signature · 2 lines
John W. Linville
[email protected]
#5 lore raw
Quoted 5 lines · * John W. Linville ([email protected]) wrote:
Quoted 2 lines

Sorry, I absolutely detest other peoples' Makefiles that has this target. Why would anybody want this?

Is this a serious question? To uninstall the binaries e.g. if you installed them in the wrong place?

Of course package manager will do better at this, but it is useful to be able to uninstall. However, I don't think Martin's external script with all the filenames hardcoded is the right approach. There are $(PROG) and $(SCRIPTS) which already know all these filenames.

thanks,
-chris

#6 lore raw
Quoted 4 lines · Chris Wright

Of course package manager will do better at this, but it is useful to be able to uninstall. However, I don't think Martin's external script with all the filenames hardcoded is the right approach. There are $(PROG) and $(SCRIPTS) which already know all these filenames.

I would agree with that. Definitely better to use the same Makefile vars used for install to do the uninstall.

John

Signature · 2 lines
John W. Linville
[email protected]
#7 lore raw
Quoted 9 lines · John W. Linville
Quoted 4 lines · Chris Wright

Of course package manager will do better at this, but it is useful to be able to uninstall. However, I don't think Martin's external script with all the filenames hardcoded is the right approach. There are $(PROG) and $(SCRIPTS) which already know all these filenames.

I would agree with that. Definitely better to use the same Makefile vars used for install to do the uninstall.

True. That is something I could live with.

#8 lore raw

Hi,

Quoted 9 lines · Junio C Hamano
Quoted 7 lines · John W. Linville
Quoted 4 lines · Chris Wright

Of course package manager will do better at this, but it is useful to be able to uninstall. However, I don't think Martin's external script with all the filenames hardcoded is the right approach. There are $(PROG) and $(SCRIPTS) which already know all these filenames.

Quoted 4 lines
Quoted 2 lines

I would agree with that. Definitely better to use the same Makefile vars used for install to do the uninstall.

True. That is something I could live with.

Well, IMHO a package manager beats an uninstall target any time of a second. I know that I chose to checkinstall all projects I compiled myself so that I can be sure that no old version keeps lying around taking space for nothin'.

Ciao,
Dscho

#9 lore raw
In reply to Chris Wright
Quoted 11 lines · Chris Wright
Quoted 5 lines · * John W. Linville ([email protected]) wrote:
Quoted 2 lines

Sorry, I absolutely detest other peoples' Makefiles that has this target. Why would anybody want this?

Is this a serious question? To uninstall the binaries e.g. if you installed them in the wrong place?

Of course package manager will do better at this, but it is useful to be able to uninstall. However, I don't think Martin's external script with all the filenames hardcoded is the right approach. There are $(PROG) and $(SCRIPTS) which already know all these filenames.

The external script only removes the symlinks created by ./cmd-rename.sh

- Martin -