diff options
| author | Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de> | 2002-10-23 10:26:57 -0500 |
|---|---|---|
| committer | Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de> | 2002-10-23 10:26:57 -0500 |
| commit | eea2541514a26d3ebb09ef5401b97b4a441ca8d4 (patch) | |
| tree | ad8d5fc6bd362929563066ad0055dd48d2fdaf07 | |
| parent | 35bce88fa68ca7048312502723abac2b423ed4f2 (diff) | |
kbuild: Switch "make modules_install" to fast mode ;)
Use the same way we came up with for "make clean" for
"make modules_install", gaining a nice speed-up.
Also, some cosmetics for scripts/Makefile.clean
| -rw-r--r-- | Makefile | 3 | ||||
| -rw-r--r-- | drivers/scsi/aic7xxx/Makefile | 5 | ||||
| -rw-r--r-- | scripts/Makefile.clean | 29 | ||||
| -rw-r--r-- | scripts/Makefile.modinst | 56 |
4 files changed, 82 insertions, 11 deletions
@@ -544,8 +544,7 @@ _modinst_post: .PHONY: $(patsubst %, _modinst_%, $(SUBDIRS)) $(patsubst %, _modinst_%, $(SUBDIRS)) : - +@$(call descend,$(patsubst _modinst_%,%,$@),modules_install) - + $(Q)$(MAKE) MAKEFILES= -rR -f scripts/Makefile.modinst obj=$(patsubst _modinst_%,%,$@) else # CONFIG_MODULES # Modules not configured diff --git a/drivers/scsi/aic7xxx/Makefile b/drivers/scsi/aic7xxx/Makefile index ea95d8a13309..56b2736a6b9f 100644 --- a/drivers/scsi/aic7xxx/Makefile +++ b/drivers/scsi/aic7xxx/Makefile @@ -24,8 +24,7 @@ endif clean-files := aic7xxx_seq.h aic7xxx_reg.h # Command to be executed upon make clean -# Note: Assignment without ':' to force late evaluation of $(src) -clean-rule = @$(MAKE) -C $(src)/aicasm clean +clean-rule := $(MAKE) -C $(src)/aicasm clean include $(TOPDIR)/Rules.make @@ -39,7 +38,7 @@ ifeq ($(CONFIG_AIC7XXX_BUILD_FIRMWARE),y) $(obj)/aic7xxx_seq.h: $(src)/aic7xxx.seq $(src)/aic7xxx.reg \ $(obj)/aicasm/aicasm - $(obj)/aicasm/aicasm -I. -r $(obj)/aic7xxx_reg.h \ + $(obj)/aicasm/aicasm -I$(obj) -r $(obj)/aic7xxx_reg.h \ -o $(obj)/aic7xxx_seq.h $(src)/aic7xxx.seq $(obj)/aic7xxx_reg.h: $(obj)/aix7xxx_seq.h diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean index 08ada532a4a1..14a71984c6e4 100644 --- a/scripts/Makefile.clean +++ b/scripts/Makefile.clean @@ -1,3 +1,6 @@ +# ========================================================================== +# Cleaning up +# ========================================================================== src := $(obj) @@ -8,6 +11,9 @@ __clean: include $(obj)/Makefile +# Figure out what we need to build from the various variables +# ========================================================================== + __subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y))) subdir-y += $(__subdir-y) __subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m))) @@ -17,26 +23,43 @@ subdir-n += $(__subdir-n) __subdir- := $(patsubst %/,%,$(filter %/, $(obj-))) subdir- += $(__subdir-) +# Subdirectories we need to descend into + subdir-ym := $(sort $(subdir-y) $(subdir-m)) subdir-ymn := $(sort $(subdir-ym) $(subdir-n) $(subdir-)) +# Add subdir path + 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)) +quiet_cmd_clean = CLEAN $(__cleanfiles) + cmd_clean = rm -f $(__clean-files); $(clean-rule) + __clean: $(subdir-ymn) ifneq ($(strip $(__clean-files) $(clean-rule)),) - rm -f $(__clean-files) - $(clean-rule) + $(call cmd,clean) else @: endif -.PHONY: $(subdir-ymn) +# =========================================================================== +# Generic stuff +# =========================================================================== + +# Descending +# --------------------------------------------------------------------------- +.PHONY: $(subdir-ymn) $(subdir-ymn): $(Q)$(MAKE) -rR -f scripts/Makefile.clean obj=$@ +# If quiet is set, only print short version of command + +cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1)) diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index 6e1fe0e5bcbd..6dcc5b132fb1 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst @@ -2,11 +2,47 @@ # Installing modules # ========================================================================== -quiet_cmd_modules_install = INSTALL $(obj-m) -cmd_modules_install = mkdir -p $(MODLIB)/kernel/$(obj); \ - cp $(obj-m) $(MODLIB)/kernel/$(obj) +src := $(obj) + +no-rules.make := 1 .PHONY: modules_install +modules_install: + +include .config + +#$(warning $(CONFIG_X86)) + +include $(obj)/Makefile + +# Figure out what we need to build from the various variables +# ========================================================================== + +# When an object is listed to be built compiled-in and modular, +# only build the compiled-in version + +obj-m := $(filter-out $(obj-y),$(obj-m)) + +__subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y))) +subdir-y += $(__subdir-y) +__subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m))) +subdir-m += $(__subdir-m) +obj-m := $(filter-out %/, $(obj-m)) + +# Subdirectories we need to descend into + +subdir-ym := $(sort $(subdir-y) $(subdir-m)) + +# Add subdir path + +obj-m := $(addprefix $(obj)/,$(obj-m)) +subdir-ym := $(addprefix $(obj)/,$(subdir-ym)) + +# ========================================================================== + +quiet_cmd_modules_install = INSTALL $(obj-m) + cmd_modules_install = mkdir -p $(MODLIB)/kernel/$(obj); \ + cp $(obj-m) $(MODLIB)/kernel/$(obj) modules_install: $(subdir-ym) ifneq ($(obj-m),) @@ -15,3 +51,17 @@ else @: endif +# =========================================================================== +# Generic stuff +# =========================================================================== + +# Descending +# --------------------------------------------------------------------------- + +.PHONY: $(subdir-ym) +$(subdir-ym): + $(Q)$(MAKE) -rR -f scripts/Makefile.modinst obj=$@ + +# If quiet is set, only print short version of command + +cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1)) |
