summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>2002-10-18 06:29:36 -0500
committerKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>2002-10-18 06:29:36 -0500
commitbb1ee97c475d679946312cbf055cd4dd764a2a31 (patch)
tree1960b4adbe5bad704b1ad825219563b7519691ff
parent3932252874162e2c7f7b87ba91f34155b67404a5 (diff)
parent2cec3daac2214432db7052d725fcca1e5dec863b (diff)
Merge tp1.ruhr-uni-bochum.de:/home/kai/src/kernel/v2.5/linux-2.5
into tp1.ruhr-uni-bochum.de:/home/kai/src/kernel/v2.5/linux-2.5.make
-rw-r--r--Documentation/DocBook/Makefile5
-rw-r--r--Makefile2
-rw-r--r--Rules.make24
-rw-r--r--arch/i386/Makefile2
-rw-r--r--scripts/Makefile.clean42
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
-
diff --git a/Makefile b/Makefile
index 388e62bb287b..17c619c35339 100644
--- a/Makefile
+++ b/Makefile
@@ -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=$@
+