X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;ds=sidebyside;f=scripts%2FMakefile.clean;h=6f89fbb56256987bf0c002683f85941ccddc861a;hb=e4c822c7e98cdda78b10a696b030fc20b22dcab4;hp=9c978b7bbdf189b7cdb45ae95464b3f99bb3c899;hpb=2a691470345a0024dd7ffaf47ad3d0f5f4f41924;p=safe%2Fjmp%2Flinux-2.6 diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean index 9c978b7..6f89fbb 100644 --- a/scripts/Makefile.clean +++ b/scripts/Makefile.clean @@ -4,12 +4,17 @@ src := $(obj) -.PHONY: __clean +PHONY := __clean __clean: +# 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 -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 # ========================================================================== @@ -32,10 +37,10 @@ subdir-ymn := $(sort $(subdir-ym) $(subdir-n) $(subdir-)) subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn)) -# build a list of files to remove, usually releative to the current +# build a list of files to remove, usually relative to the current # directory -__clean-files := $(extra-y) $(EXTRA_TARGETS) $(always) \ +__clean-files := $(extra-y) $(always) \ $(targets) $(clean-files) \ $(host-progs) \ $(hostprogs-y) $(hostprogs-m) $(hostprogs-) @@ -82,7 +87,7 @@ endif # Descending # --------------------------------------------------------------------------- -.PHONY: $(subdir-ymn) +PHONY += $(subdir-ymn) $(subdir-ymn): $(Q)$(MAKE) $(clean)=$@ @@ -90,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)