linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild: Do not remove vmlinux when cleaning external module
@ 2012-10-29 11:23 Pawel Moll
  2012-11-10 12:59 ` Romain Francoise
  0 siblings, 1 reply; 3+ messages in thread
From: Pawel Moll @ 2012-10-29 11:23 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild, linux-kernel, Pawel Moll

Since commit 1f2bfbd00e466ff3489b2ca5cc75b1cccd14c123 "kbuild:
link of vmlinux moved to a script" make clean with M=<dir>
argument (so cleaning external module) removes vmlinux,
System.map and couple of other files from the *main* kernel
build directory! This not what was happening before and almost
certainly not what one would expect.

This patch moves makes the clean target of the script called
only when !KBUILD_EXTMOD.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
---
 Makefile |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 5be2ee8..fa16e12 100644
--- a/Makefile
+++ b/Makefile
@@ -1008,11 +1008,14 @@ clean: rm-dirs  := $(CLEAN_DIRS)
 clean: rm-files := $(CLEAN_FILES)
 clean-dirs      := $(addprefix _clean_, . $(vmlinux-alldirs) Documentation samples)
 
-PHONY += $(clean-dirs) clean archclean
+PHONY += $(clean-dirs) clean archclean vmlinuxclean
 $(clean-dirs):
 	$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
 
-clean: archclean
+vmlinuxclean:
+	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean
+
+clean: archclean vmlinuxclean
 
 # mrproper - Delete all generated files, including .config
 #
@@ -1239,7 +1242,6 @@ scripts: ;
 endif # KBUILD_EXTMOD
 
 clean: $(clean-dirs)
-	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean
 	$(call cmd,rmdirs)
 	$(call cmd,rmfiles)
 	@find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] kbuild: Do not remove vmlinux when cleaning external module
  2012-10-29 11:23 [PATCH] kbuild: Do not remove vmlinux when cleaning external module Pawel Moll
@ 2012-11-10 12:59 ` Romain Francoise
  2012-12-09 15:04   ` Michal Marek
  0 siblings, 1 reply; 3+ messages in thread
From: Romain Francoise @ 2012-11-10 12:59 UTC (permalink / raw)
  To: Pawel Moll; +Cc: Michal Marek, linux-kbuild, linux-kernel

Pawel Moll <pawel.moll@arm.com> writes:

> Since commit 1f2bfbd00e466ff3489b2ca5cc75b1cccd14c123 "kbuild:
> link of vmlinux moved to a script" make clean with M=<dir>
> argument (so cleaning external module) removes vmlinux,
> System.map and couple of other files from the *main* kernel
> build directory! This not what was happening before and almost
> certainly not what one would expect.

> This patch moves makes the clean target of the script called
> only when !KBUILD_EXTMOD.

Thanks, I have the same problem and this patch fixes it.

Michal, can you pick it up? It's not yet in kbuild.git, it seems.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kbuild: Do not remove vmlinux when cleaning external module
  2012-11-10 12:59 ` Romain Francoise
@ 2012-12-09 15:04   ` Michal Marek
  0 siblings, 0 replies; 3+ messages in thread
From: Michal Marek @ 2012-12-09 15:04 UTC (permalink / raw)
  To: Romain Francoise; +Cc: Pawel Moll, linux-kbuild, linux-kernel

On Sat, Nov 10, 2012 at 01:59:21PM +0100, Romain Francoise wrote:
> Pawel Moll <pawel.moll@arm.com> writes:
> 
> > Since commit 1f2bfbd00e466ff3489b2ca5cc75b1cccd14c123 "kbuild:
> > link of vmlinux moved to a script" make clean with M=<dir>
> > argument (so cleaning external module) removes vmlinux,
> > System.map and couple of other files from the *main* kernel
> > build directory! This not what was happening before and almost
> > certainly not what one would expect.
> 
> > This patch moves makes the clean target of the script called
> > only when !KBUILD_EXTMOD.
> 
> Thanks, I have the same problem and this patch fixes it.
> 
> Michal, can you pick it up? It's not yet in kbuild.git, it seems.

Sorry for the delay. I applied it to kbuild.git#kbuild now, with

Cc: stable@vger.kernel.org [v3.5+]

Michal

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-12-09 15:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-29 11:23 [PATCH] kbuild: Do not remove vmlinux when cleaning external module Pawel Moll
2012-11-10 12:59 ` Romain Francoise
2012-12-09 15:04   ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).