diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2002-10-18 00:32:32 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-10-18 00:32:32 -0700 |
| commit | 367c46394099d2cd79ef899bc85337d158dcb5b5 (patch) | |
| tree | e85b9bc5c784a582c2fff3f7a16f7f0015c8978c /Rules.make | |
| parent | a1bed4d5ff69bcf8fa484ad1ab5ba54a08b2593f (diff) | |
| parent | 3932252874162e2c7f7b87ba91f34155b67404a5 (diff) | |
Merge bk://linux-bt.bkbits.net/bt-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux
Diffstat (limited to 'Rules.make')
| -rw-r--r-- | Rules.make | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/Rules.make b/Rules.make index affdf72286ae..56e62f97f333 100644 --- a/Rules.make +++ b/Rules.make @@ -87,6 +87,7 @@ obj-m := $(filter-out %/, $(obj-m)) # Subdirectories we need to descend into subdir-ym := $(sort $(subdir-y) $(subdir-m)) +subdir-ymn := $(sort $(subdir-ym) $(subdir-n) $(subdir-)) # export.o is never a composite object, since $(export-objs) has a # fixed meaning (== objects which EXPORT_SYMBOL()) @@ -113,6 +114,10 @@ real-objs-m := $(foreach m, $(obj-m), $(if $($(m:.o=-objs)),$($(m:.o=-objs)),$(m # Only build module versions for files which are selected to be built export-objs := $(filter $(export-objs),$(real-objs-y) $(real-objs-m)) +host-progs-single := $(foreach m,$(host-progs),$(if $($(m)-objs),,$(m))) +host-progs-multi := $(foreach m,$(host-progs),$(if $($(m)-objs),$(m))) +host-progs-multi-objs := $(foreach m,$(host-progs-multi),$($(m)-objs)) + # Add subdir path EXTRA_TARGETS := $(addprefix $(obj)/,$(EXTRA_TARGETS)) @@ -127,12 +132,19 @@ multi-used-m := $(addprefix $(obj)/,$(multi-used-m)) multi-objs-y := $(addprefix $(obj)/,$(multi-objs-y)) multi-objs-m := $(addprefix $(obj)/,$(multi-objs-m)) subdir-ym := $(addprefix $(obj)/,$(subdir-ym)) +subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn)) +clean-files := $(addprefix $(obj)/,$(clean-files)) +host-progs := $(addprefix $(obj)/,$(host-progs)) +host-progs-single := $(addprefix $(obj)/,$(host-progs-single)) +host-progs-multi := $(addprefix $(obj)/,$(host-progs-multi)) +host-progs-multi-objs := $(addprefix $(obj)/,$(host-progs-multi-objs)) # The temporary file to save gcc -MD generated dependencies must not # contain a comma depfile = $(subst $(comma),_,$(@D)/.$(@F).d) -# We're called for one of three purposes: +# We're called for one of four purposes: +# o subdirclean: Delete intermidiate files in the current directory # o fastdep: build module version files (.ver) for $(export-objs) in # the current directory # o modules_install: install the modules in the current directory @@ -142,6 +154,19 @@ depfile = $(subst $(comma),_,$(@D)/.$(@F).d) # When targets are given directly (like foo.o), we just build these # targets (That happens when someone does make some/dir/foo.[ois]) +ifeq ($(MAKECMDGOALS),subdirclean) + +__clean-files := $(wildcard $(EXTRA_TARGETS) $(host-progs) $(clean-files)) + +subdirclean: $(subdir-ymn) +ifneq ($(strip $(__clean-files) $(clean-rule)),) + rm -f $(__clean-files) + $(clean-rule) +else + @/bin/true +endif + +else ifeq ($(MAKECMDGOALS),fastdep) # =========================================================================== @@ -161,7 +186,7 @@ else # This sets version suffixes on exported symbols # --------------------------------------------------------------------------- -MODVERDIR := include/linux/modules/ +MODVERDIR := include/linux/modules # # Added the SMP separator to stop module accidents between uniprocessor @@ -399,14 +424,6 @@ targets += $(multi-used-y) $(multi-used-m) # Compile programs on the host # =========================================================================== -host-progs-single := $(foreach m,$(host-progs),$(if $($(m)-objs),,$(m))) -host-progs-multi := $(foreach m,$(host-progs),$(if $($(m)-objs),$(m))) -host-progs-multi-objs := $(foreach m,$(host-progs-multi),$($(m)-objs)) -host-progs := $(addprefix $(obj)/,$(host-progs)) -host-progs-single := $(addprefix $(obj)/,$(host-progs-single)) -host-progs-multi := $(addprefix $(obj)/,$(host-progs-multi)) -host-progs-multi-objs := $(addprefix $(obj)/,$(host-progs-multi-objs)) - quiet_cmd_host_cc__c = HOSTCC $(echo_target) cmd_host_cc__c = $(HOSTCC) -Wp,-MD,$(depfile) \ $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) \ @@ -431,6 +448,7 @@ $(host-progs-multi): %: $(host-progs-multi-objs) FORCE targets += $(host-progs-single) $(host-progs-multi-objs) $(host-progs-multi) +endif # ! subdirclean endif # ! modules_install endif # ! fastdep @@ -480,9 +498,9 @@ cmd_gzip = gzip -f -9 < $< > $@ # Descending # --------------------------------------------------------------------------- -.PHONY: $(subdir-ym) +.PHONY: $(subdir-ymn) -$(subdir-ym): +$(subdir-ymn): +@$(call descend,$@,$(MAKECMDGOALS)) # Add FORCE to the prequisites of a target to force it to be always rebuilt. |
