[U-Boot] [PATCH v2 0/6] Second step towards Kbuild: Descend down like Kbuild
Masahiro Yamada
yamada.m at jp.panasonic.com
Fri Sep 27 08:09:46 CEST 2013
I have been just wondering why the U-Boot top Makefile is so dirty.
It is sprinkled with SoC-specific code as follows:
ifneq ($(CONFIG_OMAP_COMMON),)
LIBS-y += $(CPUDIR)/omap-common/libomap-common.o
endif
ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs vf610))
LIBS-y += arch/$(ARCH)/imx-common/libimx-common.o
endif
ifeq ($(SOC),s5pc1xx)
LIBS-y += $(CPUDIR)/s5p-common/libs5p-common.o
endif
ifeq ($(SOC),exynos)
LIBS-y += $(CPUDIR)/s5p-common/libs5p-common.o
endif
ifneq ($(CONFIG_TEGRA),)
LIBS-y += arch/$(ARCH)/cpu/$(SOC)-common/lib$(SOC)-common.o
LIBS-y += arch/$(ARCH)/cpu/tegra-common/libcputegra-common.o
LIBS-y += $(CPUDIR)/tegra-common/libtegra-common.o
endif
And it describes drivers not right under the top directory, which should be essentially cared
by drivers/Makefile.
LIBS-y += drivers/bios_emulator/libatibiosemu.o
LIBS-y += drivers/block/libblock.o
LIBS-$(CONFIG_BOOTCOUNT_LIMIT) += drivers/bootcount/libbootcount.o
LIBS-y += drivers/crypto/libcrypto.o
LIBS-y += drivers/dma/libdma.o
...
This series adds the directory descending feature like Kbuild.
1/6 tweaks scripts/Makefile.build to support 'obj-y += foo/' syntax.
If the build system finds 'foo/' (trailed by a slash),
it visits foo directory.
2/6-6/6 demonstarate how we can refactor makefiles with this syntax.
2/6: Move some drivers LIBS from top Makefile to drivers/Makefile
3/6: Move some fs LIBS from top Makefile to fs/Makefile
4/6: Move Tegra specific lines from top Makefile under arch/arm/
5/6: Move OMAP specific lines from top Makefile under arch/arm/
6/6: Move Samsung SoC specific lines from top Makefile under arch/arm/
Note:
This series uses
[PATCH v2]First step towards Kbuild: Use Kbuild-style makefiles (19 patch files).
as a prerequisite. Please apply those patches first.
I believe no boards are broken by this refactoring.
In order to confirm my claim, I compiled all boards except
nds32 and nios2 architrecutures.
(I could not get an appropriate prebuilt cross compilers for those two arch.)
For arm, avr32, sandbox, x86, I could perfectly compile all boards
without any warnings.
For the other architectures, I could compile some boards and I could not
the others.
But the SUMMARY result is still the same after applying this series.
In addition I compared all the error messages and the warning messages
for all boards and they are the same.
This which means these patches do not introduce any additional errors, warnings.
Cc: Simon Glass <sjg at chromium.org>
Cc: Tom Rini <trini at ti.com>
Changes for v2:
1/6: No change
2/6: additionally refactor drivers/pcmcia drivers/rtc too
3/6, 4/6: No change
5/6: rebase on the master
6/6: No change
Masahiro Yamada (6):
Makefile: support descending down to subdirectories
drivers: move some drivers to drivers/Makefile
fs: move some file system to fs/Makefile
ARM: tegra: delete Tegra specific code from toplevel Makefile
ARM: omap: delete OMAP specific code from toplevel Makefile
ARM: s5pc, exynos: delete Samsung ARM SoC specific code from toplevel
Makefile
Makefile | 44 +++----------------------------------------
arch/arm/cpu/Makefile | 2 ++
arch/arm/cpu/arm720t/Makefile | 2 ++
arch/arm/cpu/armv7/Makefile | 9 +++++++++
board/LEOX/elpt860/u-boot.lds | 1 -
board/tqc/tqm8xx/u-boot.lds | 4 ++--
drivers/Makefile | 15 +++++++++++++++
fs/Makefile | 11 +++++++++++
scripts/Makefile.build | 15 +++++++++++++++
spl/Makefile | 14 +-------------
10 files changed, 60 insertions(+), 57 deletions(-)
create mode 100644 arch/arm/cpu/Makefile
create mode 100644 drivers/Makefile
--
1.8.1.2
More information about the U-Boot
mailing list