]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - Makefile
kbuild: fix single target build for external module
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 21 Nov 2018 23:11:54 +0000 (08:11 +0900)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:22:19 +0000 (14:22 -0300)
commitefc6a66942a7e75ea26e935a035a0e16ab5fc2e3
tree1889133787ca401a77ca784083c7071202f43d12
parentb8b8b1310091b31264691962f66caf3da50e5e90
kbuild: fix single target build for external module

BugLink: https://bugs.launchpad.net/bugs/1857158
[ Upstream commit e07db28eea38ed4e332b3a89f3995c86b713cb5b ]

Building a single target in an external module fails due to missing
.tmp_versions directory.

For example,

  $ make -C /lib/modules/$(uname -r)/build M=$PWD foo.o

will fail in the following way:

  CC [M]  /home/masahiro/foo/foo.o
/bin/sh: 1: cannot create /home/masahiro/foo/.tmp_versions/foo.mod: Directory nonexistent

This is because $(cmd_crmodverdir) is executed only before building
/, %/, %.ko single targets of external modules. Create .tmp_versions
in the 'prepare' target.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Makefile