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>
70 lines
1.4 KiB
Makefile
70 lines
1.4 KiB
Makefile
#
|
|
# (C) Copyright 2000-2006
|
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
#
|
|
# SPDX-License-Identifier: GPL-2.0+
|
|
#
|
|
|
|
## Build a couple of necessary functions into a private libgcc
|
|
## if the user asked for it
|
|
ifdef USE_PRIVATE_LIBGCC
|
|
lib-y += _ashldi3.o
|
|
lib-y += _ashrdi3.o
|
|
lib-y += _lshrdi3.o
|
|
endif
|
|
|
|
MINIMAL=
|
|
|
|
ifdef CONFIG_SPL_BUILD
|
|
ifdef CONFIG_SPL_INIT_MINIMAL
|
|
MINIMAL=y
|
|
endif
|
|
endif
|
|
|
|
ifdef MINIMAL
|
|
obj-y += cache.o time.o
|
|
obj-y += ticks.o
|
|
else
|
|
|
|
obj-y += ppcstring.o
|
|
|
|
obj-y += ppccache.o
|
|
obj-y += ticks.o
|
|
obj-y += reloc.o
|
|
|
|
obj-$(CONFIG_BAT_RW) += bat_rw.o
|
|
ifndef CONFIG_SPL_BUILD
|
|
ifndef CONFIG_SYS_GENERIC_BOARD
|
|
obj-y += board.o
|
|
endif
|
|
endif
|
|
obj-$(CONFIG_CMD_BOOTM) += bootm.o
|
|
obj-y += cache.o
|
|
obj-y += extable.o
|
|
obj-y += interrupts.o
|
|
obj-$(CONFIG_CMD_KGDB) += kgdb.o
|
|
obj-$(CONFIG_CMD_IDE) += ide.o
|
|
obj-y += time.o
|
|
|
|
# Don't include the MPC5xxx special memcpy into the
|
|
# SPL U-Boot image. memcpy is used in the SPL NOR
|
|
# flash driver. And we need the real, fast memcpy
|
|
# here. We have no problems with unaligned access.
|
|
ifndef CONFIG_SPL_BUILD
|
|
# Workaround for local bus unaligned access problems
|
|
# on MPC512x and MPC5200
|
|
ifdef CONFIG_MPC512X
|
|
$(obj)/ppcstring.o: AFLAGS += -Dmemcpy=__memcpy
|
|
obj-y += memcpy_mpc5200.o
|
|
endif
|
|
ifdef CONFIG_MPC5200
|
|
$(obj)/ppcstring.o: AFLAGS += -Dmemcpy=__memcpy
|
|
obj-y += memcpy_mpc5200.o
|
|
endif
|
|
endif
|
|
|
|
endif # not minimal
|
|
|
|
ifdef CONFIG_SPL_BUILD
|
|
obj-$(CONFIG_SPL_FRAMEWORK) += spl.o
|
|
endif
|