Skip to contentSkip to conversation

Makefile: allow 'make uninstall'

PATCH Applied Peter Maydell 5 participants 6 messages Jan 10, 2023 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: allow 'make uninstall'

Meson supports an "uninstall", so we can easily allow it to work by not suppressing the forwarding of it from Make to meson.

We originally suppressed this because Meson's 'uninstall' has a hole in it: it will remove everything that is installed by a mechanism meson knows about, but not things installed by "custom install scripts", and there is no "custom uninstall script" mechanism.

For QEMU, though, the only thing that was being installed by a custom install script was the LC_MESSAGES files handled by Meson's i18n module, and that code was fixed in Meson commit 487d45c1e5bfff0fbdb4, which is present in Meson 0.60.0 and later. Since we already require a Meson version newer than that, we're now safe to enable 'uninstall', as it will now correctly uninstall everything that was installed.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/109

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index a48103cc8a1..ce2f83a684f 100644
@@ -150,7 +150,7 @@ NINJAFLAGS = $(if $V,-v) $(if $(MAKE.n), -n) $(if $(MAKE.k), -k0) \
 ninja-cmd-goals = $(or $(MAKECMDGOALS), all)
 ninja-cmd-goals += $(foreach g, $(MAKECMDGOALS), $(.ninja-goals.$g))
 
-makefile-targets := build.ninja ctags TAGS cscope dist clean uninstall
+makefile-targets := build.ninja ctags TAGS cscope dist clean
 # "ninja -t targets" also lists all prerequisites.  If build system
 # files are marked as PHONY, however, Make will always try to execute
 # "ninja build.ninja".
Signature · 1 line
2.34.1
#2 lore raw
In reply to Peter Maydell
Quoted 3 lines · Peter Maydell

Meson supports an "uninstall", so we can easily allow it to work by not suppressing the forwarding of it from Make to meson.

Oops, sorry for the double-post; both emails are identical, so just ignore this second one.

-- PMM

Reviewed-by on v1 1/1
#3 lore raw
In reply to Peter Maydell
Quoted 16 lines · Peter Maydell

Meson supports an "uninstall", so we can easily allow it to work by not suppressing the forwarding of it from Make to meson.

We originally suppressed this because Meson's 'uninstall' has a hole in it: it will remove everything that is installed by a mechanism meson knows about, but not things installed by "custom install scripts", and there is no "custom uninstall script" mechanism.

For QEMU, though, the only thing that was being installed by a custom install script was the LC_MESSAGES files handled by Meson's i18n module, and that code was fixed in Meson commit 487d45c1e5bfff0fbdb4, which is present in Meson 0.60.0 and later. Since we already require a Meson version newer than that, we're now safe to enable 'uninstall', as it will now correctly uninstall everything that was installed.

Quoted 5 lines

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/109

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
Tested-by on v1 1/1
#4 lore raw
In reply to Peter Maydell
Quoted 16 lines · Peter Maydell

Meson supports an "uninstall", so we can easily allow it to work by not suppressing the forwarding of it from Make to meson.

We originally suppressed this because Meson's 'uninstall' has a hole in it: it will remove everything that is installed by a mechanism meson knows about, but not things installed by "custom install scripts", and there is no "custom uninstall script" mechanism.

For QEMU, though, the only thing that was being installed by a custom install script was the LC_MESSAGES files handled by Meson's i18n module, and that code was fixed in Meson commit 487d45c1e5bfff0fbdb4, which is present in Meson 0.60.0 and later. Since we already require a Meson version newer than that, we're now safe to enable 'uninstall', as it will now correctly uninstall everything that was installed.

Quoted 5 lines

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/109

---
  Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Works for me!

#5 lore raw
In reply to Peter Maydell

Am 10.01.23 um 16:13 schrieb Peter Maydell:

Quoted 16 lines

Meson supports an "uninstall", so we can easily allow it to work by not suppressing the forwarding of it from Make to meson.

We originally suppressed this because Meson's 'uninstall' has a hole in it: it will remove everything that is installed by a mechanism meson knows about, but not things installed by "custom install scripts", and there is no "custom uninstall script" mechanism.

For QEMU, though, the only thing that was being installed by a custom install script was the LC_MESSAGES files handled by Meson's i18n module, and that code was fixed in Meson commit 487d45c1e5bfff0fbdb4, which is present in Meson 0.60.0 and later. Since we already require a Meson version newer than that, we're now safe to enable 'uninstall', as it will now correctly uninstall everything that was installed.

Quoted 2 lines

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/109

Always missed that functionality. Thanks.