Commit ab19f8794a66910ef9b33041ccfa05b6b12ab6c9
1 parent
437374e9a9
Exists in
master
and in
7 other branches
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 <davem@davemloft.net> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: David Miller <davem@davemloft.net>
Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff
Makefile
... | ... | @@ -1512,8 +1512,9 @@ |
1512 | 1512 | fi |
1513 | 1513 | |
1514 | 1514 | # Create temporary dir for module support files |
1515 | -cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR); rm -f $(MODVERDIR)/* | |
1516 | - | |
1515 | +# clean it up only when building all modules | |
1516 | +cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \ | |
1517 | + $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*) | |
1517 | 1518 | |
1518 | 1519 | a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ |
1519 | 1520 | $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ |