# Add uninstall target to Makefile

9 messages from 2005-09-16 to 2005-09-18. Participants: Martin Atukunda, Junio C Hamano, John W. Linville, Chris Wright, Johannes Schindelin.
Thread: https://gitlist.dev/t/1827

## Martin Atukunda, 2005-09-16 12:58

Subject: Add uninstall target to Makefile
Message-ID: <20050916125814.GA8084@igloo.ds.co.ug>
URL: https://gitlist.dev/e/20050916125814.GA8084%40igloo.ds.co.ug

```

Add the uninstall target to the Makefile.

Signed-off-by: Martin Atukunda <matlads@dsmagic.com>
--- 

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/remove-cmd-rename.sh b/remove-cmd-rename.sh
new file mode 100644
--- /dev/null
+++ b/remove-cmd-rename.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+d="$1"
+test -d "$d" || exit
+
+while read name
+do
+	rm  -f "$d/$name"
+done <<\EOF
+git-add-script
+git-archimport-script
+git-bisect-script
+git-branch-script
+git-checkout-script
+git-cherry-pick-script
+git-clone-script
+git-commit-script
+git-count-objects-script
+git-cvsimport-script
+git-diff-script
+git-send-email-script
+git-fetch-script
+git-format-patch-script
+git-log-script
+git-ls-remote-script
+git-merge-one-file-script
+git-octopus-script
+git-parse-remote-script
+git-prune-script
+git-pull-script
+git-push-script
+git-rebase-script
+git-relink-script
+git-rename-script
+git-repack-script
+git-request-pull-script
+git-reset-script
+git-resolve-script
+git-revert-script
+git-sh-setup-script
+git-status-script
+git-tag-script
+git-verify-tag-script
+git-http-pull
+git-local-pull
+git-checkout-cache
+git-diff-cache
+git-merge-cache
+git-update-cache
+git-convert-cache
+git-fsck-cache
+EOF

```

## Junio C Hamano, 2005-09-16 17:08

Subject: Re: Add uninstall target to Makefile
Message-ID: <7vfys5ndor.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vfys5ndor.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20050916125814.GA8084@igloo.ds.co.ug>

```
Martin Atukunda <matlads@dsmagic.com> writes:

> Add the uninstall target to the Makefile.

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

```

## John W. Linville, 2005-09-16 17:54

Subject: Re: Add uninstall target to Makefile
Message-ID: <20050916175402.GC22825@tuxdriver.com>
URL: https://gitlist.dev/e/20050916175402.GC22825%40tuxdriver.com
In-Reply-To: <7vfys5ndor.fsf@assigned-by-dhcp.cox.net>

```
On Fri, Sep 16, 2005 at 10:08:04AM -0700, Junio C Hamano wrote:
> Martin Atukunda <matlads@dsmagic.com> writes:
> 
> > 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?
-- 
John W. Linville
linville@tuxdriver.com

```

## Junio C Hamano, 2005-09-16 18:01

Subject: Re: Add uninstall target to Makefile
Message-ID: <7v1x3oopsg.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v1x3oopsg.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <12c511ca0509161021249c89a9@mail.gmail.com>

```
Tony Luck <tony.luck@gmail.com> writes:

> 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.

```

## Chris Wright, 2005-09-16 18:08

Subject: Re: Add uninstall target to Makefile
Message-ID: <20050916180810.GK8041@shell0.pdx.osdl.net>
URL: https://gitlist.dev/e/20050916180810.GK8041%40shell0.pdx.osdl.net
In-Reply-To: <20050916175402.GC22825@tuxdriver.com>

```
* John W. Linville (linville@tuxdriver.com) wrote:
> > 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

```

## John W. Linville, 2005-09-16 19:19

Subject: Re: Add uninstall target to Makefile
Message-ID: <20050916191953.GD22825@tuxdriver.com>
URL: https://gitlist.dev/e/20050916191953.GD22825%40tuxdriver.com
In-Reply-To: <20050916180810.GK8041@shell0.pdx.osdl.net>

```
On Fri, Sep 16, 2005 at 11:08:10AM -0700, Chris Wright wrote:

> 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
-- 
John W. Linville
linville@tuxdriver.com

```

## Junio C Hamano, 2005-09-16 23:05

Subject: Re: Add uninstall target to Makefile
Message-ID: <7vu0gkfwak.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vu0gkfwak.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20050916191953.GD22825@tuxdriver.com>

```
"John W. Linville" <linville@tuxdriver.com> writes:

> On Fri, Sep 16, 2005 at 11:08:10AM -0700, Chris Wright wrote:
>
>> 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.

```

## Johannes Schindelin, 2005-09-16 23:37

Subject: Re: Add uninstall target to Makefile
Message-ID: <Pine.LNX.4.63.0509170135110.13233@wgmdd8.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0509170135110.13233%40wgmdd8.biozentrum.uni-wuerzburg.de
In-Reply-To: <7vu0gkfwak.fsf@assigned-by-dhcp.cox.net>

```
Hi,

On Fri, 16 Sep 2005, Junio C Hamano wrote:

> "John W. Linville" <linville@tuxdriver.com> writes:
> 
> > On Fri, Sep 16, 2005 at 11:08:10AM -0700, Chris Wright wrote:
> >
> >> 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.

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

```

## Martin Atukunda, 2005-09-18 10:03

Subject: Re: Add uninstall target to Makefile
Message-ID: <20050918100300.GA9890@igloo.ds.co.ug>
URL: https://gitlist.dev/e/20050918100300.GA9890%40igloo.ds.co.ug
In-Reply-To: <20050916180810.GK8041@shell0.pdx.osdl.net>

```

On Fri, Sep 16, 2005 at 11:08:10AM -0700, Chris Wright wrote:
> * John W. Linville (linville@tuxdriver.com) wrote:
> > > 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 -

```
