diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2002-10-18 01:14:15 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-10-18 01:14:15 -0700 |
| commit | 156fd4ebe8cb2dd87d8810b5a5a6ca1bc58ca9cb (patch) | |
| tree | 95c0649071178a1031de9a23e23446ebd3bdd27b | |
| parent | cf22459da9e131060b96476117b9b52a5b330596 (diff) | |
| parent | bb1ee97c475d679946312cbf055cd4dd764a2a31 (diff) | |
Merge http://linux-isdn.bkbits.net/linux-2.5.make
into home.transmeta.com:/home/torvalds/v2.5/linux
| -rw-r--r-- | Documentation/DocBook/Makefile | 5 | ||||
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | Rules.make | 24 | ||||
| -rw-r--r-- | arch/i386/Makefile | 2 | ||||
| -rw-r--r-- | scripts/Makefile.clean | 42 |
5 files changed, 59 insertions, 16 deletions
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile index 2e3a7333354e..dd49e638acd7 100644 --- a/Documentation/DocBook/Makefile +++ b/Documentation/DocBook/Makefile @@ -160,7 +160,8 @@ clean-files := $(DOCBOOKS) \ $(patsubst %.fig,%.png, $(IMG-parportbook)) \ $(C-procfs-example) -clean-rule := rm -rf $(patsubst %.html,%,$(HTML)) +ifneq ($(wildcard $(BOOKS)),) +clean-rule := rm -rf $(wildcard $(BOOKS)) +endif include $(TOPDIR)/Rules.make - @@ -698,7 +698,7 @@ MRPROPER_DIRS += \ clean-dirs += $(ALL_SUBDIRS) Documentation/DocBook scripts $(addprefix _clean_,$(clean-dirs)): - +@$(call descend,$(patsubst _clean_%,%,$@), subdirclean) + $(MAKE) MAKEFILES= -rR -f scripts/Makefile.clean obj=$(patsubst _clean_%,%,$@) quiet_cmd_rmclean = RM $$(CLEAN_FILES) cmd_rmclean = rm -f $(CLEAN_FILES) diff --git a/Rules.make b/Rules.make index 56e62f97f333..9343c984a820 100644 --- a/Rules.make +++ b/Rules.make @@ -1,3 +1,6 @@ + +ifndef no-rules.make + # # This file contains rules which are shared between multiple Makefiles. # @@ -163,7 +166,7 @@ ifneq ($(strip $(__clean-files) $(clean-rule)),) rm -f $(__clean-files) $(clean-rule) else - @/bin/true + @: endif else @@ -179,7 +182,7 @@ ifeq ($(strip $(export-objs)),) # --------------------------------------------------------------------------- fastdep: $(subdir-ym) - @/bin/true + @: else @@ -271,7 +274,7 @@ modules_install: $(subdir-ym) ifneq ($(obj-m),) $(call cmd,modules_install) else - @/bin/true + @: endif else # ! modules_install @@ -280,23 +283,18 @@ else # ! modules_install # Building # ========================================================================== -# If a Makefile does define neither O_TARGET nor L_TARGET, -# use a standard O_TARGET named "built-in.o" - -ifndef O_TARGET -ifndef L_TARGET -O_TARGET := $(obj)/built-in.o -endif -endif +# If a Makefile does not define a L_TARGET, link an object called "built-in.o" ifdef L_TARGET L_TARGET := $(obj)/$(L_TARGET) +else +O_TARGET := $(obj)/built-in.o endif first_rule: $(if $(KBUILD_BUILTIN),$(O_TARGET) $(L_TARGET) $(EXTRA_TARGETS)) \ $(if $(KBUILD_MODULES),$(obj-m)) \ $(subdir-ym) - @/bin/true + @: # Compile C sources (.c) # --------------------------------------------------------------------------- @@ -623,3 +621,5 @@ ifeq ($(KBUILD_VERBOSE),1) descend = echo '$(MAKE) -f $(1)/Makefile $(2)'; endif descend += $(MAKE) -f $(1)/Makefile obj=$(1) $(2) + +endif diff --git a/arch/i386/Makefile b/arch/i386/Makefile index dbd363bdb52f..f23a066d98d8 100644 --- a/arch/i386/Makefile +++ b/arch/i386/Makefile @@ -88,6 +88,6 @@ install: vmlinux +@$(call makeboot,BOOTIMAGE=$(BOOTIMAGE) install) archclean: - +@$(call makeboot,subdirclean) + $(MAKE) -rR -f scripts/Makefile.clean obj=arch/i386/boot archmrproper: diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean new file mode 100644 index 000000000000..d7bb2dfb88d8 --- /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 + @: +endif + +.PHONY: $(subdir-ymn) + +$(subdir-ymn): + $(MAKE) -rR -f scripts/Makefile.clean obj=$@ + |
