From: Sam Ravnborg Date: Mon, 22 Oct 2007 09:23:07 +0000 (+0200) Subject: kbuild: fix modules_install after a 'make vmlinux' X-Git-Tag: upstream/snapshot3+hdmi~29372^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ab19f8794a66910ef9b33041ccfa05b6b12ab6c9;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git kbuild: fix modules_install after a 'make vmlinux' make vmlinux would delete the content of $(MODVERDIR) equals .tmp_versions. This caused a subsequent make modules_install to fail. Fix it so we clean the directory only for the modules build - but we still unconditionally create it so we can do: make dir/file.ko without a preceeding make modules. Reported by David Miller Signed-off-by: Sam Ravnborg Cc: David Miller --- diff --git a/Makefile b/Makefile index 50bb50d..f4238b2 100644 --- a/Makefile +++ b/Makefile @@ -1512,8 +1512,9 @@ quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) fi # Create temporary dir for module support files -cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR); rm -f $(MODVERDIR)/* - +# clean it up only when building all modules +cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \ + $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*) a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \