build: handle always-y and hostprogs-always-y
authorAnthony PERARD <anthony.perard@citrix.com>
Fri, 25 Feb 2022 10:04:42 +0000 (11:04 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 25 Feb 2022 10:04:42 +0000 (11:04 +0100)
This will be used for xen/tools/.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/Rules.mk
xen/scripts/Makefile.clean

index 13c1943da97e8f3d8a0a4c4ce7b9ccc406a9baf5..5f2368805b3644a6e87a487bbd2305ba5dad9561 100644 (file)
@@ -78,9 +78,17 @@ else
 obj-y    := $(filter-out %/, $(obj-y))
 endif
 
+# hostprogs-always-y += foo
+# ... is a shorthand for
+# hostprogs-y += foo
+# always-y  += foo
+hostprogs-y += $(hostprogs-always-y)
+always-y += $(hostprogs-always-y)
+
 # Add subdir path
 
 extra-y         := $(addprefix $(obj)/,$(extra-y))
+always-y        := $(addprefix $(obj)/,$(always-y))
 targets         := $(addprefix $(obj)/,$(targets))
 lib-y           := $(addprefix $(obj)/,$(lib-y))
 obj-y           := $(addprefix $(obj)/,$(obj-y))
@@ -283,7 +291,7 @@ targets += $(call intermediate_targets, .init.o, .o) \
 # Build
 # ---------------------------------------------------------------------------
 
-__build: $(targets-for-builtin) $(subdir-y)
+__build: $(targets-for-builtin) $(subdir-y) $(always-y)
        @:
 
 # Descending
index 156d6307cf837e896a72e5d2d6f95cb3de9647e8..c2689d4af5fa22df847074df21433ac6d333e807 100644 (file)
@@ -18,7 +18,8 @@ subdir-all := $(subdir-y) $(subdir-n) $(subdir-) \
               $(patsubst %/,%, $(filter %/, $(obj-y) $(obj-n) $(obj-)))
 
 __clean-files := \
-    $(clean-files) $(hostprogs-y) $(hostprogs-)
+    $(clean-files) $(hostprogs-y) $(hostprogs-) \
+    $(hostprogs-always-y) $(hostprogs-always-)
 
 __clean-files := $(wildcard $(__clean-files))