tools/examples: cleanup Makefile
authorAnthony PERARD <anthony.perard@citrix.com>
Mon, 11 Jul 2022 10:13:24 +0000 (12:13 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 11 Jul 2022 10:13:24 +0000 (12:13 +0200)
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@citrix.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
tools/examples/Makefile

index 14e24f4cb3185ae578ca49350708f58ee832bff8..c839bf5603329b62d6b3cafb716c55ae37af993e 100644 (file)
@@ -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: