Switch over to real Kbuild
Get series with b4
b4 am 20140219211131.GT19081@bill-the-catVersions newest first · linked by author and title
- v8 posting 6/60 of 38 patches 0 repliesNew
- v9 Latest0 of 38 patches 0 repliesNew
- v8 posting 5/60 of 38 patches 0 repliesSuperseded
Earlier versions · 4
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v8 posting 4/6 | 0 of 38 patches | 0 replies | Superseded | |
| v8 posting 3/6 | 0 of 38 patches | 0 replies | Superseded | |
| v8 posting 2/6 | 0 of 38 patches | 0 replies | Superseded | |
| v8 posting 1/6 | 0 of 38 patches | 0 replies | Superseded |
Patches in v9 No applies recorded yet
None of the 38 patches the cover letter announces are in this archive.
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v9 yet.
Cover letter [U-Boot] [PATCH v9 0/38] Switch over to real Kbuild
Quoted 427 lines · Masahiro Yamada
We switched to
Kbuildstyle makefiles at v2014.01-rc1 release. With that modification, we can write makefiles simpler. But it is NOT realKbuild. We need more progress.As the next step, this series imports (+ adjusts) build scripts from Linux Kernel under
scripts/directory.
By applying this series, we can get more advantages:
- short log
- perfect dependency tracking
- preparation to the next step,Kconfig
- other things...
KbuildwithoutKconfig
----------------------First of all, to make things clearer, let me explain the difference between "
Kbuild" and "Kconfig". They are, I think, sometimes confusing.
Kbuild- build system used for Linux Kernel.
Some features ofKbuildare:(a) We can describe makefiles simply.
Just add objects to "obj-y" like this:
obj-$(CONFIG_FOO) += foo.o(b) We can describe directory descending nicely. Add directories with a slash to "obj-y" like this:
obj-$(CONFIG_BAR) += bar/(c) Short log like follows:
CCcommon/foo.o
CCcommon/bar.o
LDcommon/built-in.o(d) Perfect dependency tracking
I think this is the biggest advantage.
To be honest, the dependency tracing of U-Boot build system was not reliable.
Kconfig- A tool to manage CONFIG macros.
We can handle the dependency among CONFIG macros.Kconfigallows us to modify CONFIG settings easily by "make config".
GUI interface are also available by "make menuconfig" All defined CONFIG macros are stored into ".config" fileI think most of U-boot developers are already familiar with above. (In most cases, they are Linux Kernel developers too.)
I definitely want to port both of these, but I want to do them separately:
Kbuildfirst. (If we doKbuildandKconfigat the same time, it might be messed up.)So, I want to do "
KbuildwithoutKconfig" in this series. The conventional tool (mkconfig + boards.cfg file) is used for board configuration.How to apply ?
--------------I confirmed this series can apply on commit
0876703cf.How to Build ?
--------------We can build the same as before.
Do board configuraton first and then run "make".$ make omap4_panda_config Configuring for omap4_panda board... $ make CROSS_COMPILE=arm-linux-gnueabi- GEN include/autoconf.mk.dep GEN include/autoconf.mk CC lib/asm-offsets.s GEN include/generated/generic-asm-offsets.h CC arch/arm/cpu/armv7/omap4/asm-offsets.s GEN include/generated/asm-offsets.h HOSTCC scripts/basic/fixdep ...You will find a difference at a glance: short log. If you need detail log message, please add "V=1". (You can also use "V=2")
Please note we can no longer use
$ make omap4_panda CROSS_COMPILE=arm-linux-gnueabi- to do board configuration and "make" at the same time.Instead, we can use Kbuild-ish way for that purpose:
$ make omap4_panda_config all CROSS_COMPILE=arm-linux-gnuabi-This series keeps the other features:
- Support out-of-tree build
You can use "O=<dir_name>" like this
$ mkdirbuild_dir
$ makeomap4_panda_configall O=build_dir CROSS_COMPILE=arm-linux-gnueabi-- Works with parallel make option
Add "-j" option for this. Compiling will get faster.- Of cource, SPL, TPL build are supported
(nand_splalso works. But "nand_spl" is obsolete and we should switch to "spl".
Until when should we continue to maintainnand_spl?)- Breaks no boards (except some boards which are already broken) I built all target boards to prove correctness of this series at least for compile test.
My Next Plan
------------- Import
Kconfig
Use "make config", "make menuconfig", "make defconfig", etc. in U-Boot.- More refactoring
Some parts of makefiles are still dirty.
I want to refactor more makefiles in follow-up patches.- Use "obj-m" for standalone program?? Loadable module?? I have not deceided about this yet.
Note
----- I marked dirty parts with "FIX ME".
In some board-specific config.mk files.
# FIX ME ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),) ccflags-y := -O2 endifIn the top Makefile # FIX ME cpp_flags := $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(UBOOTINCLUDE) $(NOSTDINC_FLAGS) c_flags := $(KBUILD_CFLAGS) $(cpp_flags)I will re-write them more nicely after other parts are prepared.
Run Test
--------- Tested for MPC5121 on an ifm AC14xx board,
Beagle (C4) board and Wand (quad) board by Gerhard Sittig- Tested for Zynq ZC706 board by me
Run test report for your board is welcome!
Changes for v9:
- Refactor "clean" and "clobber" rule
- Move the build rules ofinclude/autoconf.mkandinclude/autoconf.mk.depChanges for v8:
- Rebase on commit0876703c.
- Fix a typo in comment in 38/38Changes for v7:
- Fix a bug in spl build:
In v6, build failed if we try to build another SPL board without doing "make clobber".
For example,
$ makeomap3_beagle_config
$ make CROSS_COMPILE=<your_gcc_prefix>
$ makeam335x_evm_config
$ make CROSS_COMPILE=<your_gcc_prefix>
This failed in v6. We needed either "make clobber" or "make mrproper" before switching to another board.
Now, we can two or more boards continuously.Changes for v6:
- Rebase on the current u-boot/master
- Linux Kernel 3.13 was released on Jan. 20, so import build scripts from v3.13 to be breeding edge.
- Minor change in post/lib_powerpc/fpu/Makefile
- Includecmd_filesunder nand_spl/board/*/*/MakefileChanges for v5:
- Fix a bug reported by Gerhard Sittig:
"make tools" before running "make" failed at v4.
- Revive "env" target so that we can build only undertools/env/.
- Add a new patch at the tail:
38/38 "tools/env: cross-compilefw_printenvwithout setting HOSTCC"
- Describe "clobber" target shortly by deleteing "*.imx" and "*.map" with wildcard matching.
- Rebase on the current u-boot/masterChanges for v4:
- Add a new patch at the tail:
37/37 "kbuild: Do not generate .*.su files at the top directory"
- Change "checkstack" target toKbuildstyle
- Move the line whereU_BOOT_VERSIONis definedChanges for v3:
- Rebase on the current u-boot/master
- Add a new patch at the tail:
36/36 "board: sandburst: delete FORCEBUILD"Changes for v2:
- At version 1,nand_splboards got broken at 12 and fixed at 14. Fix this problem
- At version 1, sandbox got broken at 17 and fixed at 21.
Fix this problem
- Add a new patch at the tail:
35/35 "Kbuild: chech clean source and generateMakefilefor out-of-tree build"
- Rebase on v2014.01-rc2 tagMasahiro Yamada (38):
.gitignore: ingore files generated byKbuildMakefile.host.tmp: add a new script to refactor tools
tools: convert makefiles to kbuild style
board: samsung: refactor host programs
examples: Usescripts/Makefile.build
nand-spl: Usescripts/Makefile.build
Makfile: move suffix rules to Makefile.build
Makefile: move some variable definitions to the topMakefile
Makefile: moveBFD_ROOT_DIRtotools/gdb/Makefile
kbuild: import Kbuild.include from linux v3.13 tag
kbuild: Use Kbuild.include
Makefile: move more flags to the topMakefile
Makefile: refactor include path settings
Makefile: move more stuff to topMakefile
Makefile: move some flags to spl/Makefile
Makefile: move some flags to examples makefiles
kbuild: change out-of-tree build
kbuild: add dummy obj-y to create built-in.o
Makefile: renamescripts/Makefile.buildtoscripts/Makefile.build.tmp
kbuild: import more build scripts from Linux v3.13 tag
kbuild: use Linux Kernel build scripts
kbuild: delete temporary build scripts
kbuild: move some lines to more suitable place
kbuild: convert some make rules toKbuildstyle
kbuild: move include directives of board configuration files
kbuild: generate {spl,tpl}-autoconf.mk only when it is necessary
Makefile: remove a cleaning target "tidy"
kbuild: change the topMakefileto more Kbuild-ish structure
examples: move api/ and standalone/ entry to examples/Makefile
kbuild: refactorMakefileand spl/Makefile more
Makefile: Do not passMTD_VERSIONfrom the topMakefile
Makefile: refactor tools-all targets
kbuild: usescripts/Makefile.clean
kbuild: support simultaneous board configuration and "make all"
kbuild: check clean source and generateMakefilefor out-of-tree build
board: sandburst: delete FORCEBUILD
kbuild: Do not generate .*.su files at the top directorytools/env: cross-compilefw_printenvwithout setting HOSTCC.gitignore | 30 +- MAKEALL | 8 +- Makefile | 1299 +++++++++++++------- arch/arm/cpu/arm1136/config.mk | 2 +- arch/arm/cpu/arm926ejs/config.mk | 2 +- arch/arm/cpu/arm926ejs/davinci/config.mk | 2 +- arch/arm/cpu/armv7/am33xx/config.mk | 2 +- arch/arm/cpu/armv7/config.mk | 2 +- arch/arm/cpu/armv7/omap3/config.mk | 2 +- arch/arm/cpu/armv7/omap4/config.mk | 2 +- arch/arm/cpu/armv7/omap5/config.mk | 2 +- arch/arm/cpu/armv7/socfpga/config.mk | 2 +- arch/arm/cpu/armv7/tegra114/Makefile | 3 +- arch/arm/cpu/armv7/tegra30/Makefile | 3 +- arch/arm/imx-common/Makefile | 2 +- arch/blackfin/config.mk | 10 +- arch/blackfin/cpu/Makefile | 10 +- arch/blackfin/lib/Makefile | 5 +- arch/m68k/cpu/mcf5227x/Makefile | 2 +- arch/m68k/cpu/mcf523x/Makefile | 2 +- arch/m68k/cpu/mcf52x2/Makefile | 2 +- arch/m68k/cpu/mcf532x/Makefile | 2 +- arch/m68k/cpu/mcf5445x/Makefile | 2 +- arch/m68k/cpu/mcf547x_8x/Makefile | 2 +- arch/mips/cpu/mips32/config.mk | 2 +- arch/mips/cpu/mips64/config.mk | 2 +- arch/mips/cpu/xburst/config.mk | 2 +- arch/nds32/config.mk | 2 +- arch/nds32/cpu/n1213/Makefile | 3 + arch/powerpc/cpu/mpc8xx/Makefile | 2 +- arch/powerpc/lib/Makefile | 4 +- arch/sandbox/cpu/Makefile | 11 +- arch/sparc/config.mk | 3 +- arch/x86/lib/Makefile | 2 +- board/ait/cam_enc_4xx/config.mk | 2 +- board/avionic-design/medcom-wide/Makefile | 2 +- board/avionic-design/plutux/Makefile | 2 +- board/avionic-design/tec-ng/Makefile | 2 +- board/avionic-design/tec/Makefile | 2 +- board/bct-brettl2/config.mk | 7 +- board/bf518f-ezbrd/config.mk | 7 +- board/bf526-ezbrd/config.mk | 7 +- board/bf527-ad7160-eval/config.mk | 7 +- board/bf527-ezkit/config.mk | 7 +- board/bf527-sdp/config.mk | 7 +- board/bf533-ezkit/config.mk | 7 +- board/bf533-stamp/config.mk | 7 +- board/bf537-stamp/config.mk | 7 +- board/bf538f-ezkit/config.mk | 7 +- board/bf548-ezkit/config.mk | 7 +- board/bf561-acvilon/config.mk | 7 +- board/bf561-ezkit/config.mk | 7 +- board/br4/config.mk | 7 +- board/cm-bf527/config.mk | 7 +- board/cm-bf533/config.mk | 7 +- board/cm-bf537e/config.mk | 7 +- board/cm-bf537u/config.mk | 7 +- board/cm-bf548/config.mk | 7 +- board/cm-bf561/config.mk | 7 +- board/compal/paz00/Makefile | 2 +- board/compulab/trimslice/Makefile | 2 +- board/cray/L1/Makefile | 10 +- board/freescale/common/Makefile | 5 +- board/h2200/Makefile | 2 +- board/ip04/config.mk | 7 +- board/matrix_vision/mvblm7/Makefile | 4 +- board/matrix_vision/mvblx/Makefile | 2 +- board/matrix_vision/mvsmr/Makefile | 2 +- board/nvidia/common/Makefile | 2 +- board/pcs440ep/config.mk | 2 +- board/pr1/config.mk | 7 +- board/samsung/origen/Makefile | 23 +- .../origen/tools/{mkv310_image.c => mkorigenspl.c} | 0 board/samsung/smdkv310/Makefile | 16 +- .../tools/{mkv310_image.c => mksmdkv310spl.c} | 0 board/sandburst/karef/Makefile | 6 +- board/sandburst/metrobox/Makefile | 6 +- board/spear/common/Makefile | 5 +- board/spear/x600/Makefile | 5 +- board/st-ericsson/snowball/Makefile | 2 +- board/st-ericsson/u8500/Makefile | 2 +- board/tcm-bf518/config.mk | 7 +- board/tcm-bf537/config.mk | 7 +- common/Makefile | 11 +- config.mk | 333 +---- disk/Makefile | 2 +- doc/DocBook/Makefile | 73 +- drivers/bios_emulator/Makefile | 5 +- drivers/hwmon/Makefile | 2 +- drivers/net/npe/Makefile | 4 +- drivers/rtc/Makefile | 2 +- drivers/usb/musb-new/Makefile | 7 +- dts/Makefile | 20 +- examples/Makefile | 9 + examples/api/Makefile | 44 +- examples/standalone/Makefile | 74 +- fs/ubifs/Makefile | 2 +- fs/yaffs2/Makefile | 9 +- lib/Makefile | 2 +- lib/lzma/Makefile | 2 +- mkconfig | 2 +- nand_spl/board/amcc/acadia/Makefile | 45 +- nand_spl/board/amcc/bamboo/Makefile | 45 +- nand_spl/board/amcc/canyonlands/Makefile | 45 +- nand_spl/board/amcc/kilauea/Makefile | 43 +- nand_spl/board/amcc/sequoia/Makefile | 47 +- nand_spl/board/freescale/mpc8315erdb/Makefile | 47 +- nand_spl/board/freescale/mpc8536ds/Makefile | 59 +- nand_spl/board/freescale/mpc8569mds/Makefile | 59 +- nand_spl/board/freescale/mpc8572ds/Makefile | 59 +- nand_spl/board/freescale/p1023rds/Makefile | 60 +- nand_spl/board/freescale/p1_p2_rdb/Makefile | 59 +- nand_spl/board/sheldon/simpc8313/Makefile | 48 +- net/Makefile | 2 +- post/lib_powerpc/fpu/Makefile | 29 +- rules.mk | 51 - scripts/Kbuild.include | 284 +++++ scripts/Makefile | 2 + scripts/Makefile.build | 520 +++++++- scripts/Makefile.clean | 108 ++ scripts/Makefile.host | 170 +++ scripts/Makefile.lib | 375 ++++++ scripts/basic/.gitignore | 1 + scripts/basic/Makefile | 15 + scripts/basic/fixdep.c | 462 +++++++ scripts/mkmakefile | 59 + spl/Makefile | 197 +-- tools/.gitignore | 3 +- tools/Makefile | 373 ++---- tools/crc32.c | 1 + tools/easylogo/Makefile | 12 +- tools/env/.gitignore | 2 + tools/env/Makefile | 39 +- tools/env/README | 5 +- tools/env/crc32.c | 1 + tools/env/ctype.c | 1 + tools/env/env_attr.c | 1 + tools/env/env_flags.c | 1 + tools/env/linux_string.c | 1 + tools/env_embedded.c | 1 + tools/fdt.c | 1 + tools/fdt_ro.c | 1 + tools/fdt_rw.c | 1 + tools/fdt_strerror.c | 1 + tools/fdt_wip.c | 1 + tools/gdb/Makefile | 64 +- tools/image-fit.c | 1 + tools/image-sig.c | 1 + tools/image.c | 1 + tools/kernel-doc/Makefile | 21 +- tools/md5.c | 1 + tools/rsa-sign.c | 1 + tools/sha1.c | 1 + 153 files changed, 3682 insertions(+), 2058 deletions(-) rename board/samsung/origen/tools/{mkv310_image.c => mkorigenspl.c} (100%) rename board/samsung/smdkv310/tools/{mkv310_image.c => mksmdkv310spl.c} (100%) create mode 100644 examples/Makefile delete mode 100644 rules.mk create mode 100644 scripts/Kbuild.include create mode 100644 scripts/Makefile create mode 100644 scripts/Makefile.clean create mode 100644 scripts/Makefile.host create mode 100644 scripts/Makefile.lib create mode 100644 scripts/basic/.gitignore create mode 100644 scripts/basic/Makefile create mode 100644 scripts/basic/fixdep.c create mode 100644 scripts/mkmakefile create mode 100644 tools/crc32.c create mode 100644 tools/env/.gitignore create mode 100644 tools/env/crc32.c create mode 100644 tools/env/ctype.c create mode 100644 tools/env/env_attr.c create mode 100644 tools/env/env_flags.c create mode 100644 tools/env/linux_string.c create mode 100644 tools/env_embedded.c create mode 100644 tools/fdt.c create mode 100644 tools/fdt_ro.c create mode 100644 tools/fdt_rw.c
Quoted 8 lines
create mode 100644 tools/fdt_strerror.c create mode 100644 tools/fdt_wip.c create mode 100644 tools/image-fit.c create mode 100644 tools/image-sig.c create mode 100644 tools/image.c create mode 100644 tools/md5.c create mode 100644 tools/rsa-sign.c create mode 100644 tools/sha1.c
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140219/e159b498/attachment.pgp>