X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=scripts%2FMakefile.clean;h=cff33498fa16a8edcdd872bfaf2da13f6cbae4d2;hb=d9eea97a8782ef04badb8c44fd74bd1f9e04cba5;hp=b02ab1fb28e38d1e8f2aa3c830c6d10206707635;hpb=1a69f36a78895dad9a6b97ffa2d6d2b7c3975b5d;p=linux-2.6.git diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean index b02ab1fb2..cff33498f 100644 --- a/scripts/Makefile.clean +++ b/scripts/Makefile.clean @@ -4,10 +4,17 @@ src := $(obj) -.PHONY: __clean +PHONY := __clean __clean: -include $(obj)/Makefile +# Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir +# Usage: +# $(Q)$(MAKE) $(clean)=dir +clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj + +# The filename Kbuild has precedence over 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 # ========================================================================== @@ -80,7 +87,7 @@ endif # Descending # --------------------------------------------------------------------------- -.PHONY: $(subdir-ymn) +PHONY += $(subdir-ymn) $(subdir-ymn): $(Q)$(MAKE) $(clean)=$@ @@ -88,7 +95,8 @@ $(subdir-ymn): cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1)) -# Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir -# Usage: -# $(Q)$(MAKE) $(clean)=dir -clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj + +# 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)