diff options
| author | Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de> | 2002-10-16 12:10:27 -0500 |
|---|---|---|
| committer | Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de> | 2002-10-16 12:10:27 -0500 |
| commit | cb56ef33764ffe503aa1e1a0848ae097e200d954 (patch) | |
| tree | 5ed07a0b9feb9f8a168dddbe5702eaa820d37250 /scripts | |
| parent | 9af95a1093ae2ae41813ec5f2ca092dc9749af04 (diff) | |
kbuild: Speed up new "make clean/mrproper"
Do as little as possible apart from calling sub-makes and calling 'rm',
which makes things go quite a bit faster.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/Makefile.clean | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean new file mode 100644 index 000000000000..fa809a7e88ad --- /dev/null +++ b/scripts/Makefile.clean @@ -0,0 +1,42 @@ + +src := $(obj) + +no-rules.make := 1 + +.PHONY: __clean +__clean: + +include $(obj)/Makefile + +__subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y))) +subdir-y += $(__subdir-y) +__subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m))) +subdir-m += $(__subdir-m) +__subdir-n := $(patsubst %/,%,$(filter %/, $(obj-n))) +subdir-n += $(__subdir-n) +__subdir- := $(patsubst %/,%,$(filter %/, $(obj-))) +subdir- += $(__subdir-) + +subdir-ym := $(sort $(subdir-y) $(subdir-m)) +subdir-ymn := $(sort $(subdir-ym) $(subdir-n) $(subdir-)) + +EXTRA_TARGETS := $(addprefix $(obj)/,$(EXTRA_TARGETS)) +clean-files := $(addprefix $(obj)/,$(clean-files)) +host-progs := $(addprefix $(obj)/,$(host-progs)) +subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn)) + +__clean-files := $(wildcard $(EXTRA_TARGETS) $(host-progs) $(clean-files)) + +__clean: $(subdir-ymn) +ifneq ($(strip $(__clean-files) $(clean-rule)),) + rm -f $(__clean-files) + $(clean-rule) +else + @/bin/true +endif + +.PHONY: $(subdir-ymn) + +$(subdir-ymn): + $(MAKE) -rR -f scripts/Makefile.clean obj=$@ + |
