[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] tools/Makefile: Drop the use of $(file ...)


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 14 Sep 2020 10:24:20 +0100
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 14 Sep 2020 09:24:58 +0000
  • Ironport-sdr: vE1XTDUAdG6L9Q7iPLjGqI9XrlGFypNbakarcgwR4J64q2OKygrXOak7GmOCzIGKvOESIaHrba Dg1oJN77jK6X4TQQG6J2pySYHDiWggogFmPe3TKY4WZzrsdA1qDGs4HiXMECuBPTmXCxZL13zY 2Jo+uLgcrZejMHxSgwyaQKh3ND7bssTnm2c33Lyk+ZOWwKSrJ3Sfkwun0ofvhnaBKEsvcunF3P MTeZru0kEmzRYXIko2SPEqMZAQipIiRetHbFoW8YqyJGlWEQUDyNVVO3UUwm5kjH1yEfO9pe1f hsE=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

It is only available in make 4.0 and later, and not for example in CentOS 7.

Rewrite the logic to use echo and shell redirection, using a single capture
group to avoid having 12 different processes in quick succession each
appending one line to the file.

Fixes: 52dbd6f07cea7a ("tools: generate pkg-config files from make variables")
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Juergen Gross <jgross@xxxxxxxx>
CC: Ian Jackson <Ian.Jackson@xxxxxxxxxx>
CC: Wei Liu <wl@xxxxxxx>
---
 tools/Rules.mk | 52 ++++++++++++++++++++++++++++------------------------
 1 file changed, 28 insertions(+), 24 deletions(-)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 4fd91fa444..a71abb2e4f 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -186,29 +186,33 @@ $(PKG_CONFIG_DIR):
        mkdir -p $(PKG_CONFIG_DIR)
 
 $(PKG_CONFIG_DIR)/%.pc: Makefile $(XEN_ROOT)/tools/Rules.mk $(PKG_CONFIG_DIR)
-       $(file >$@,prefix=$(PKG_CONFIG_PREFIX))
-       $(file >>$@,includedir=$(PKG_CONFIG_INCDIR))
-       $(file >>$@,libdir=$(PKG_CONFIG_LIBDIR))
-       $(foreach var,$(PKG_CONFIG_VARS),$(file >>$@,$(var)))
-       $(file >>$@,)
-       $(file >>$@,Name: $(PKG_CONFIG_NAME))
-       $(file >>$@,Description: $(PKG_CONFIG_DESC))
-       $(file >>$@,Version: $(PKG_CONFIG_VERSION))
-       $(file >>$@,Cflags: -I$${includedir} $(CFLAGS_xeninclude))
-       $(file >>$@,Libs: -L$${libdir} $(PKG_CONFIG_USELIBS) 
-l$(PKG_CONFIG_LIB))
-       $(file >>$@,Libs.private: $(PKG_CONFIG_LIBSPRIV))
-       $(file >>$@,Requires.private: $(PKG_CONFIG_REQPRIV))
+       { \
+       echo "prefix=$(PKG_CONFIG_PREFIX)"; \
+       echo "includedir=$(PKG_CONFIG_INCDIR)"; \
+       echo "libdir=$(PKG_CONFIG_LIBDIR)"; \
+       $(foreach var,$(PKG_CONFIG_VARS),echo $(var);) \
+       echo ""; \
+       echo "Name: $(PKG_CONFIG_NAME)"; \
+       echo "Description: $(PKG_CONFIG_DESC)"; \
+       echo "Version: $(PKG_CONFIG_VERSION)"; \
+       echo "Cflags: -I\$${includedir} $(CFLAGS_xeninclude)"; \
+       echo "Libs: -L\$${libdir} $(PKG_CONFIG_USELIBS) -l$(PKG_CONFIG_LIB)"; \
+       echo "Libs.private: $(PKG_CONFIG_LIBSPRIV)"; \
+       echo "Requires.private: $(PKG_CONFIG_REQPRIV)"; \
+       } > $@
 
 %.pc: Makefile $(XEN_ROOT)/tools/Rules.mk
-       $(file >$@,prefix=$(PKG_CONFIG_PREFIX))
-       $(file >>$@,includedir=$(PKG_CONFIG_INCDIR))
-       $(file >>$@,libdir=$(PKG_CONFIG_LIBDIR))
-       $(foreach var,$(PKG_CONFIG_VARS),$(file >>$@,$(var)))
-       $(file >>$@,)
-       $(file >>$@,Name: $(PKG_CONFIG_NAME))
-       $(file >>$@,Description: $(PKG_CONFIG_DESC))
-       $(file >>$@,Version: $(PKG_CONFIG_VERSION))
-       $(file >>$@,Cflags: -I$${includedir})
-       $(file >>$@,Libs: -L$${libdir} -l$(PKG_CONFIG_LIB))
-       $(file >>$@,Libs.private: $(PKG_CONFIG_LIBSPRIV))
-       $(file >>$@,Requires.private: $(PKG_CONFIG_REQPRIV))
+       { \
+       echo "prefix=$(PKG_CONFIG_PREFIX)"; \
+       echo "includedir=$(PKG_CONFIG_INCDIR)"; \
+       echo "libdir=$(PKG_CONFIG_LIBDIR)"; \
+       $(foreach var,$(PKG_CONFIG_VARS),echo $(var);) \
+       echo ""; \
+       echo "Name: $(PKG_CONFIG_NAME)"; \
+       echo "Description: $(PKG_CONFIG_DESC)"; \
+       echo "Version: $(PKG_CONFIG_VERSION)"; \
+       echo "Cflags: -I\$${includedir}"; \
+       echo "Libs: -L\$${libdir} -l$(PKG_CONFIG_LIB)"; \
+       echo "Libs.private: $(PKG_CONFIG_LIBSPRIV)"; \
+       echo "Requires.private: $(PKG_CONFIG_REQPRIV)"; \
+       } > $@
-- 
2.11.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.