diff options
author | Andrew Morton <akpm@osdl.org> | 2004-04-12 19:21:59 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-04-12 19:21:59 -0700 |
commit | 24b5a6a3025278a1717798901f665114a1655831 (patch) | |
tree | 3b5d5e7a805bfec00c488432d8a72668accb59c6 /Makefile | |
parent | 8a358cff5aab455c3f820e600c1c4e4af511efea (diff) | |
download | history-24b5a6a3025278a1717798901f665114a1655831.tar.gz |
[PATCH] kbuild: Create .tmp_versions when building external modules
From: Sam Ravnborg <sam@ravnborg.org>
When building external modules the $PWD/.tmp_versions directory is used.
The .tmp_versions directory in the kernel tree cannot be used because this
would clutter up the kernel tree especially when more than one external
module is being build for the same kernel tree.
This patch make sure to create $PWD/.tmp_versions, and to delete it during
make clean. It also removes warning about 'messed with SUBDIRS', this is
no longer relevant when .tmp_versions is made outside the kernel tree.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/Makefile b/Makefile index 6139d83a3e32b..6fc37635b2cac 100644 --- a/Makefile +++ b/Makefile @@ -787,12 +787,6 @@ endef # make mrproper Delete the current configuration, and all generated files # make distclean Remove editor backup files, patch leftover files and the like -quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN $(wildcard $(rm-dirs))) - cmd_rmdirs = rm -rf $(rm-dirs) - -quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files))) - cmd_rmfiles = rm -f $(rm-files) - # Directories & files removed with 'make clean' CLEAN_DIRS += $(MODVERDIR) CLEAN_FILES += vmlinux System.map kernel.spec \ @@ -951,9 +945,12 @@ else # KBUILD_EXTMOD # We are always building modules KBUILD_MODULES := 1 +.PHONY: crmodverdir +crmodverdir: FORCE + $(Q)mkdir -p $(MODVERDIR) .PHONY: $(KBUILD_EXTMOD) -$(KBUILD_EXTMOD): FORCE +$(KBUILD_EXTMOD): crmodverdir FORCE $(Q)$(MAKE) $(build)=$@ .PHONY: modules @@ -971,7 +968,9 @@ clean-dirs := _clean_$(KBUILD_EXTMOD) $(clean-dirs): $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) +clean: rm-dirs := $(MODVERDIR) clean: $(clean-dirs) + $(call cmd,rmdirs) @find $(KBUILD_EXTMOD) $(RCS_FIND_IGNORE) \ \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \ @@ -1058,6 +1057,13 @@ endif #ifeq ($(mixed-targets),1) # FIXME Should go into a make.lib or something # =========================================================================== +quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN $(wildcard $(rm-dirs))) + cmd_rmdirs = rm -rf $(rm-dirs) + +quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files))) + cmd_rmfiles = rm -f $(rm-files) + + a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(AFLAGS_KERNEL) \ $(NOSTDINC_FLAGS) $(CPPFLAGS) \ $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) |