author: Masahiro Yamada <masahiroy@kernel.org> 2021-08-13 15:30:05 +0900
committer: Masahiro Yamada <masahiroy@kernel.org> 2021-09-03 08:17:19 +0900
commit: e1f86d7b4b2a5213b012c2b4fe3e5b6ad537686e
parent: 6796e80409b9031458e33dc39a3ac8aa3b93855b
Commit Summary:
Diffstat:
1 file changed, 5 insertions, 1 deletion
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index c3c975a92318..cdec22088423 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -57,6 +57,7 @@ kecho := $($(quiet)kecho)
# - If the content differ the new file is used
# - If they are equal no change, and no timestamp update
define filechk
+ $(check-FORCE)
$(Q)set -e; \
mkdir -p $(dir $@); \
trap "rm -f $(dot-target).tmp" EXIT; \
@@ -130,7 +131,11 @@ make-cmd = $(call escsq,$(subst $(pound),$$(pound),$(subst $$,$$$$,$(cmd_$(1))))
# PHONY targets skipped in both cases.
newer-prereqs = $(filter-out $(PHONY),$?)
-if-changed-cond = $(newer-prereqs)$(cmd-check)
+# It is a typical mistake to forget the FORCE prerequisite. Check it here so
+# no more breakage will slip in.
+check-FORCE = $(if $(filter FORCE, $^),,$(warning FORCE prerequisite is missing))
+
+if-changed-cond = $(newer-prereqs)$(cmd-check)$(check-FORCE)
# Execute command if command has changed or prerequisite(s) are updated.
if_changed = $(if $(if-changed-cond), \