X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=scripts%2FMakefile.clean;h=cff33498fa16a8edcdd872bfaf2da13f6cbae4d2;hb=c1d370e167d66b10bca3b602d3740405469383de;hp=62351b630fabbec556e0da11779549149036e66a;hpb=2315c6e42278152360470124ce903ecb8c97270a;p=firefly-linux-kernel-4.4.55.git diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean index 62351b630fab..cff33498fa16 100644 --- a/scripts/Makefile.clean +++ b/scripts/Makefile.clean @@ -4,7 +4,7 @@ src := $(obj) -.PHONY: __clean +PHONY := __clean __clean: # Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir @@ -13,8 +13,8 @@ __clean: clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj # The filename Kbuild has precedence over Makefile -include $(if $(wildcard $(srctree)/$(src)/Kbuild), \ - $(srctree)/$(src)/Kbuild, $(srctree)/$(src)/Makefile) +kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) +include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile) # Figure out what we need to build from the various variables # ========================================================================== @@ -87,10 +87,16 @@ endif # Descending # --------------------------------------------------------------------------- -.PHONY: $(subdir-ymn) +PHONY += $(subdir-ymn) $(subdir-ymn): $(Q)$(MAKE) $(clean)=$@ # If quiet is set, only print short version of command cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1)) + + +# Declare the contents of the .PHONY variable as phony. We keep that +# information in a variable se we can use it in if_changed and friends. + +.PHONY: $(PHONY)