kbuild: change out-of-tree build
This commit changes the working directory where the build process occurs. Before this commit, build process occurred under the source tree for both in-tree and out-of-tree build. That's why we needed to add $(obj) prefix to all generated files in makefiles like follows: $(obj)u-boot.bin: $(obj)u-boot Here, $(obj) is empty for in-tree build, whereas it points to the output directory for out-of-tree build. And our old build system changes the current working directory with "make -C <sub-dir>" syntax when descending into the sub-directories. On the other hand, Kbuild uses a different idea to handle out-of-tree build and directory descending. The build process of Kbuild always occurs under the output tree. When "O=dir/to/store/output/files" is given, the build system changes the current working directory to that directory and restarts the make. Kbuild uses "make -f $(srctree)/scripts/Makefile.build obj=<sub-dir>" syntax for descending into sub-directories. (We can write it like "make $(obj)=<sub-dir>" with a shorthand.) This means the current working directory is always the top of the output directory. Signed-off-by:Masahiro Yamada <yamada.m@jp.panasonic.com> Tested-by:
Gerhard Sittig <gsi@denx.de>
Showing
- MAKEALL 4 additions, 2 deletionsMAKEALL
- Makefile 298 additions, 271 deletionsMakefile
- arch/arm/cpu/arm1136/config.mk 1 addition, 1 deletionarch/arm/cpu/arm1136/config.mk
- arch/arm/cpu/arm926ejs/config.mk 1 addition, 1 deletionarch/arm/cpu/arm926ejs/config.mk
- arch/arm/cpu/arm926ejs/davinci/config.mk 1 addition, 1 deletionarch/arm/cpu/arm926ejs/davinci/config.mk
- arch/arm/cpu/armv7/am33xx/config.mk 1 addition, 1 deletionarch/arm/cpu/armv7/am33xx/config.mk
- arch/arm/cpu/armv7/config.mk 1 addition, 1 deletionarch/arm/cpu/armv7/config.mk
- arch/arm/cpu/armv7/omap3/config.mk 1 addition, 1 deletionarch/arm/cpu/armv7/omap3/config.mk
- arch/arm/cpu/armv7/omap4/config.mk 1 addition, 1 deletionarch/arm/cpu/armv7/omap4/config.mk
- arch/arm/cpu/armv7/omap5/config.mk 1 addition, 1 deletionarch/arm/cpu/armv7/omap5/config.mk
- arch/arm/cpu/armv7/socfpga/config.mk 1 addition, 1 deletionarch/arm/cpu/armv7/socfpga/config.mk
- arch/blackfin/config.mk 5 additions, 5 deletionsarch/blackfin/config.mk
- arch/blackfin/cpu/Makefile 4 additions, 4 deletionsarch/blackfin/cpu/Makefile
- arch/mips/cpu/mips32/config.mk 1 addition, 1 deletionarch/mips/cpu/mips32/config.mk
- arch/mips/cpu/mips64/config.mk 1 addition, 1 deletionarch/mips/cpu/mips64/config.mk
- arch/mips/cpu/xburst/config.mk 1 addition, 1 deletionarch/mips/cpu/xburst/config.mk
- arch/nds32/config.mk 1 addition, 1 deletionarch/nds32/config.mk
- arch/powerpc/lib/Makefile 2 additions, 2 deletionsarch/powerpc/lib/Makefile
- arch/sandbox/cpu/Makefile 2 additions, 2 deletionsarch/sandbox/cpu/Makefile
- arch/sparc/config.mk 2 additions, 1 deletionarch/sparc/config.mk
Loading
Please register or sign in to comment