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

[XEN PATCH v3 03/25] tools/examples: cleanup Makefile


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Fri, 24 Jun 2022 17:04:00 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 24 Jun 2022 16:04:53 +0000
  • Ironport-data: A9a23:4hcApa7sKFEclUjXW8oBQgxRtHHHchMFZxGqfqrLsTDasY5as4F+v moYXW2Ebv/cazb1eYsnO4y3801U6JWHzodmSFY6pS5mHi5G8cbLO4+Ufxz6V8+wwmwvb67FA +E2MISowBUcFyeEzvuVGuG96yE6j8lkf5KkYAL+EnkZqTRMFWFw03qPp8Zj2tQy2YbjX1vX0 T/Pi5a31GGNimYc3l08s8pvmDs31BglkGpF1rCWTakjUG72zxH5PrpGTU2CByKQrr1vNvy7X 47+IISRpQs1yfuP5uSNyd4XemVSKlLb0JPnZnB+A8BOiTAazsA+PzpS2FPxpi67hh3Q9+2dx umhurSvdgA2GbLlo9hecCNDMytaN61a55HYdC3XXcy7lyUqclPpyvRqSko3IZcZ6qB8BmQmG f4wcW5XKErZ3qTvnez9GrIEascLdaEHOKsWvG1gyjfIS+4rW5nZT43B5MNC3Sd2jcdLdRrbT 5VFM2I/NEmZC/FJEkZPOZ4lzd6HvHn+US9ir36pp6sU7kGGmWSd15CyaYGIK7RmX/59gUKwt m/AuWPjDXkyJNGZjDaI7H+oruvOhj/gHpIfEqWi8fxni0HVwXYcYCD6TnPi/6P/0BTnHYsCd QpEoULCsJTe6mS0cd7ieAKRm0LHnSQHe9B0Ge0m9y+Sn/+8DxmiOoQUctJQQIV46ZFuHmFyi Q/hc8DBXmI27uDMIZ6J3vLN9G7pZ3BIRYMXTXVcJTbp9eUPt23aYvjnat94WJC4gdTucd0b6 2Db9XNu71n/YCNi6klawbwkq2j1znQxZlRpjjg7p0r8hu+DWKarZpaz9X/Q5utaIYCSQzGp5 SZZxZDGvblRUcnVy0Rhpdnh+pnzv55p1xWM6WOD4rF7r2j9k5JdVdo4DM5CyLdBbZ9fJG6Bj L77sgJN/p5DVEaXgVtMS9vpUawClPG4ffy8D6y8RoceM/BZKV7clAkzNBH44owYuBV1+U3JE czAKpjE4LdzIfkP8QdasM9HgOFymHxhlDiNLX05pjz+uYejiLeuYe9tGDOzgioRt8tofC29H w5jCva3
  • Ironport-hdrordr: A9a23:9UybOqnS8xO8b5jM/HG4hFOHxnDpDfIU3DAbv31ZSRFFG/Fxl6 iV8sjzsiWE7gr5OUtQ4exoV5PhfZqxz/JICMwqTNKftWrdyQyVxeNZnOjfKlTbckWUnINgPO VbAsxD4bXLfCFHZK3BgTVQfexO/DD+ytHLudvj
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Don't check if a target exist before installing it. For directory,
install doesn't complain, and for file it would prevent from updating
them. Also remove the existing loop and instead install all files with
a single call to $(INSTALL_DATA).

Remove XEN_CONFIGS-y which isn't used.

Remove "build" target.

Add an empty line after the first comment. The comment isn't about
$(XEN_READMES), it is about the makefile as a whole.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---

Notes:
    v2:
    - remove existing loops in install targets and use a single call to
      $(INSTALL_DATA) to install multiple files.

 tools/examples/Makefile | 25 ++++++-------------------
 1 file changed, 6 insertions(+), 19 deletions(-)

diff --git a/tools/examples/Makefile b/tools/examples/Makefile
index 14e24f4cb3..c839bf5603 100644
--- a/tools/examples/Makefile
+++ b/tools/examples/Makefile
@@ -2,6 +2,7 @@ XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 # Xen configuration dir and configs to go there.
+
 XEN_READMES = README
 
 XEN_CONFIGS += xlexample.hvm
@@ -10,14 +11,9 @@ XEN_CONFIGS += xlexample.pvhlinux
 XEN_CONFIGS += xl.conf
 XEN_CONFIGS += cpupool
 
-XEN_CONFIGS += $(XEN_CONFIGS-y)
-
 .PHONY: all
 all:
 
-.PHONY: build
-build:
-
 .PHONY: install
 install: all install-readmes install-configs
 
@@ -26,12 +22,8 @@ uninstall: uninstall-readmes uninstall-configs
 
 .PHONY: install-readmes
 install-readmes:
-       [ -d $(DESTDIR)$(XEN_CONFIG_DIR) ] || \
-               $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
-       set -e; for i in $(XEN_READMES); \
-           do [ -e $(DESTDIR)$(XEN_CONFIG_DIR)/$$i ] || \
-           $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_CONFIG_DIR); \
-       done
+       $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
+       $(INSTALL_DATA) $(XEN_READMES) $(DESTDIR)$(XEN_CONFIG_DIR)
 
 .PHONY: uninstall-readmes
 uninstall-readmes:
@@ -39,14 +31,9 @@ uninstall-readmes:
 
 .PHONY: install-configs
 install-configs: $(XEN_CONFIGS)
-       [ -d $(DESTDIR)$(XEN_CONFIG_DIR) ] || \
-               $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
-       [ -d $(DESTDIR)$(XEN_CONFIG_DIR)/auto ] || \
-               $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)/auto
-       set -e; for i in $(XEN_CONFIGS); \
-           do [ -e $(DESTDIR)$(XEN_CONFIG_DIR)/$$i ] || \
-           $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_CONFIG_DIR); \
-       done
+       $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
+       $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)/auto
+       $(INSTALL_DATA) $(XEN_CONFIGS) $(DESTDIR)$(XEN_CONFIG_DIR)
 
 .PHONY: uninstall-configs
 uninstall-configs:
-- 
Anthony PERARD




 


Rackspace

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