Skip to contentSkip to conversation

kbuild: Unbreak cleaning external module build directory

PATCH In review Bart Van Assche 2 participants 2 messages Nov 18, 2012 – Dec 9, 2012 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: Unbreak cleaning external module build directory

Avoid that "$(MAKE) -C $(KDIR) M=$(PWD) clean" triggers the following error message when invoked from inside the Makefile of an external kernel module:

rm: cannot remove 'System.map': Permission denied
make[1]: *** [clean] Error 1

Cc Sam Ravnborg <[email protected]>
Cc Arnaud Lacombe <[email protected]>
Cc Nick Bowler <[email protected]>
Cc Richard Weinberger <[email protected]>
Cc Michal Marek <[email protected]>
---
 Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 9f6ca12..46b9be5 100644
@@ -1252,7 +1252,7 @@ scripts: ;
 endif # KBUILD_EXTMOD
 
 clean: $(clean-dirs)
-	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean
+	$(Q)$(if $(KBUILD_EXTMOD),,$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean)
 	$(call cmd,rmdirs)
 	$(call cmd,rmfiles)
 	@find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 6 lines · Bart Van Assche

Avoid that "$(MAKE) -C $(KDIR) M=$(PWD) clean" triggers the following error message when invoked from inside the Makefile of an external kernel module:

rm: cannot remove 'System.map': Permission denied
make[1]: *** [clean] Error 1

I just applied an earlier patch to fix this:
https://patchwork.kernel.org/patch/1663011/

Michal