diff mbox series

[XEN,v3,16/25] libs/libs.mk: Remove the need for $(PKG_CONFIG_INST)

Message ID 20220624160422.53457-17-anthony.perard@citrix.com (mailing list archive)
State Superseded
Headers show
Series Toolstack build system improvement, toward non-recursive makefiles | expand

Commit Message

Anthony PERARD June 24, 2022, 4:04 p.m. UTC
We can simply use $(PKG_CONFIG) to set the parameters, and add it to
$(TARGETS) as necessary.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/libs.mk | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Comments

Jürgen Groß June 29, 2022, 10:22 a.m. UTC | #1
On 24.06.22 18:04, Anthony PERARD wrote:
> We can simply use $(PKG_CONFIG) to set the parameters, and add it to
> $(TARGETS) as necessary.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen
Bertrand Marquis July 5, 2022, 1:27 p.m. UTC | #2
Hi Anthony,

> On 24 Jun 2022, at 17:04, Anthony PERARD <anthony.perard@citrix.com> wrote:
> 
> We can simply use $(PKG_CONFIG) to set the parameters, and add it to
> $(TARGETS) as necessary.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand


> ---
> tools/libs/libs.mk | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
> index e02f91f95e..7aee449370 100644
> --- a/tools/libs/libs.mk
> +++ b/tools/libs/libs.mk
> @@ -37,10 +37,10 @@ PKG_CONFIG_LIB := $(LIB_FILE_NAME)
> PKG_CONFIG_REQPRIV := $(subst $(space),$(comma),$(strip $(foreach lib,$(patsubst ctrl,control,$(USELIBS_$(LIBNAME))),xen$(lib))))
> 
> ifneq ($(CONFIG_LIBXC_MINIOS),y)
> -PKG_CONFIG_INST := $(PKG_CONFIG)
> -$(PKG_CONFIG_INST): PKG_CONFIG_PREFIX = $(prefix)
> -$(PKG_CONFIG_INST): PKG_CONFIG_INCDIR = $(includedir)
> -$(PKG_CONFIG_INST): PKG_CONFIG_LIBDIR = $(libdir)
> +TARGETS += $(PKG_CONFIG)
> +$(PKG_CONFIG): PKG_CONFIG_PREFIX = $(prefix)
> +$(PKG_CONFIG): PKG_CONFIG_INCDIR = $(includedir)
> +$(PKG_CONFIG): PKG_CONFIG_LIBDIR = $(libdir)
> endif
> 
> PKG_CONFIG_LOCAL := $(PKG_CONFIG_DIR)/$(PKG_CONFIG)
> @@ -55,7 +55,7 @@ $(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_INCLUDE)
> $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR)
> 
> .PHONY: all
> -all: headers.chk $(TARGETS) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) libxen$(LIBNAME).map $(LIBHEADERS)
> +all: headers.chk $(TARGETS) $(PKG_CONFIG_LOCAL) libxen$(LIBNAME).map $(LIBHEADERS)
> 
> ifneq ($(NO_HEADERS_CHK),y)
> headers.chk:
> @@ -127,7 +127,6 @@ clean::
> 	rm -rf $(TARGETS) *~ $(DEPS_RM) $(OBJS-y) $(PIC_OBJS)
> 	rm -f lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) lib$(LIB_FILE_NAME).so.$(MAJOR)
> 	rm -f headers.chk headers.lst
> -	rm -f $(PKG_CONFIG)
> 
> .PHONY: distclean
> distclean: clean
> -- 
> Anthony PERARD
> 
>
diff mbox series

Patch

diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index e02f91f95e..7aee449370 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -37,10 +37,10 @@  PKG_CONFIG_LIB := $(LIB_FILE_NAME)
 PKG_CONFIG_REQPRIV := $(subst $(space),$(comma),$(strip $(foreach lib,$(patsubst ctrl,control,$(USELIBS_$(LIBNAME))),xen$(lib))))
 
 ifneq ($(CONFIG_LIBXC_MINIOS),y)
-PKG_CONFIG_INST := $(PKG_CONFIG)
-$(PKG_CONFIG_INST): PKG_CONFIG_PREFIX = $(prefix)
-$(PKG_CONFIG_INST): PKG_CONFIG_INCDIR = $(includedir)
-$(PKG_CONFIG_INST): PKG_CONFIG_LIBDIR = $(libdir)
+TARGETS += $(PKG_CONFIG)
+$(PKG_CONFIG): PKG_CONFIG_PREFIX = $(prefix)
+$(PKG_CONFIG): PKG_CONFIG_INCDIR = $(includedir)
+$(PKG_CONFIG): PKG_CONFIG_LIBDIR = $(libdir)
 endif
 
 PKG_CONFIG_LOCAL := $(PKG_CONFIG_DIR)/$(PKG_CONFIG)
@@ -55,7 +55,7 @@  $(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_INCLUDE)
 $(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR)
 
 .PHONY: all
-all: headers.chk $(TARGETS) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) libxen$(LIBNAME).map $(LIBHEADERS)
+all: headers.chk $(TARGETS) $(PKG_CONFIG_LOCAL) libxen$(LIBNAME).map $(LIBHEADERS)
 
 ifneq ($(NO_HEADERS_CHK),y)
 headers.chk:
@@ -127,7 +127,6 @@  clean::
 	rm -rf $(TARGETS) *~ $(DEPS_RM) $(OBJS-y) $(PIC_OBJS)
 	rm -f lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) lib$(LIB_FILE_NAME).so.$(MAJOR)
 	rm -f headers.chk headers.lst
-	rm -f $(PKG_CONFIG)
 
 .PHONY: distclean
 distclean: clean