diff mbox series

[2/2] tools/libs: fix uninstall rule for header files

Message ID 74c629db-0f63-aba0-f294-9668c29b8f70@suse.com (mailing list archive)
State New, archived
Headers show
Series tools/libs: fix build rules to correctly deal with multiple public headers | expand

Commit Message

Jan Beulich Oct. 19, 2020, 7:21 a.m. UTC
This again was working right only as long as $(LIBHEADER) consisted of
just one entry.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
An alternative would be to use $(addprefix ) without any shell loop.

Comments

Jan Beulich Oct. 29, 2020, 1:47 p.m. UTC | #1
On 19.10.2020 09:21, Jan Beulich wrote:
> This again was working right only as long as $(LIBHEADER) consisted of
> just one entry.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

While patch 1 has become irrelevant with Juergen's more complete
change, this one is still applicable afaict.

Jan

> ---
> An alternative would be to use $(addprefix ) without any shell loop.
> 
> --- a/tools/libs/libs.mk
> +++ b/tools/libs/libs.mk
> @@ -107,7 +107,7 @@ install: build
>  .PHONY: uninstall
>  uninstall:
>  	rm -f $(DESTDIR)$(PKG_INSTALLDIR)/$(LIB_FILE_NAME).pc
> -	for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$(LIBHEADER); done
> +	for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$$i; done
>  	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so
>  	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR)
>  	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR)
> 
>
Bertrand Marquis Oct. 29, 2020, 3:24 p.m. UTC | #2
> On 19 Oct 2020, at 08:21, Jan Beulich <jbeulich@suse.com> wrote:
> 
> This again was working right only as long as $(LIBHEADER) consisted of
> just one entry.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

The change is obviously fixing a bug :-) and the double $ is required to protect from make.

Cheers
Bertrand


> ---
> An alternative would be to use $(addprefix ) without any shell loop.
> 
> --- a/tools/libs/libs.mk
> +++ b/tools/libs/libs.mk
> @@ -107,7 +107,7 @@ install: build
> .PHONY: uninstall
> uninstall:
> 	rm -f $(DESTDIR)$(PKG_INSTALLDIR)/$(LIB_FILE_NAME).pc
> -	for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$(LIBHEADER); done
> +	for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$$i; done
> 	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so
> 	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR)
> 	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR)
> 
>
Jan Beulich Nov. 23, 2020, 1:23 p.m. UTC | #3
On 29.10.2020 16:24, Bertrand Marquis wrote:
>> On 19 Oct 2020, at 08:21, Jan Beulich <jbeulich@suse.com> wrote:
>>
>> This again was working right only as long as $(LIBHEADER) consisted of
>> just one entry.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
> 
> The change is obviously fixing a bug :-) and the double $ is required to protect from make.

I'll give it a day or two more to get an ack (or any negative
form of feedback), but I guess I'll go ahead and commit this
with just Bertrand's R-b otherwise.

Jan
diff mbox series

Patch

--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -107,7 +107,7 @@  install: build
 .PHONY: uninstall
 uninstall:
 	rm -f $(DESTDIR)$(PKG_INSTALLDIR)/$(LIB_FILE_NAME).pc
-	for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$(LIBHEADER); done
+	for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$$i; done
 	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so
 	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR)
 	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR)