X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=scripts%2FKbuild.include;h=cdec22088423e42fc1a82357ef5f5fe41a0807be;hb=56c244382fdb793986097df8e29f9f9320bc2c60;hp=f247e691562d438816eed3e1f3eb52e75408b568;hpb=c985aafb60e972c0a6b8d0bd65e03af5890b748a;p=linux-2.6-microblaze.git diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index f247e691562d..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,13 +131,19 @@ make-cmd = $(call escsq,$(subst $(pound),$$(pound),$(subst $$,$$$$,$(cmd_$(1)))) # PHONY targets skipped in both cases. newer-prereqs = $(filter-out $(PHONY),$?) +# 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 $(newer-prereqs)$(cmd-check), \ +if_changed = $(if $(if-changed-cond), \ $(cmd); \ printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:) # Execute the command and also postprocess generated .d dependencies file. -if_changed_dep = $(if $(newer-prereqs)$(cmd-check),$(cmd_and_fixdep),@:) +if_changed_dep = $(if $(if-changed-cond),$(cmd_and_fixdep),@:) cmd_and_fixdep = \ $(cmd); \ @@ -146,7 +153,7 @@ cmd_and_fixdep = \ # Usage: $(call if_changed_rule,foo) # Will check if $(cmd_foo) or any of the prerequisites changed, # and if so will execute $(rule_foo). -if_changed_rule = $(if $(newer-prereqs)$(cmd-check),$(rule_$(1)),@:) +if_changed_rule = $(if $(if-changed-cond),$(rule_$(1)),@:) ### # why - tell why a target got built