kbuild: allow Kbuild to start from any directory
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Sat, 30 Mar 2019 12:04:14 +0000 (21:04 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 2 Apr 2019 14:27:15 +0000 (23:27 +0900)
commit25b146c5b8ceecd43c311552d325a4e403c639f2
treee8d022671481b5add2d94347c8f6355e24178f8f
parent6b1a9a02c72fdb6e1d67949bb01b66e07d88ace9
kbuild: allow Kbuild to start from any directory

Kbuild always runs in the top of the output directory.

If Make starts in the source directory with O=, it relocates the
working directory to the location specified by O=.

Also, users can start build from the output directory by using the
Makefile generated by scripts/mkmakefile.

With a little more effort, Kbuild will be able to start from any
directory path.

This commit allows to specify the source directory by using
the -f option.

For example, you can do:

  $ cd path/to/output/dir
  $ make -f path/to/source/dir/Makefile

Or, for the equivalent behavior, you can do:

  $ make O=path/to/output/dir -f path/to/source/dir/Makefile

KBUILD_SRC is now deprecated.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Kieran Bingham <kbingham@kernel.org>
Makefile