[U-Boot] [RFC PATCH 0/7] RFC: Add Kbuild system to U-Boot

Simon Glass sjg at chromium.org
Mon May 13 04:25:33 CEST 2013


Kbuild in U-Boot has been talked about for a while and I know of at least
one functioning attempt and mentions of independent progress. But I don't
see any patches on the mailing list and various people have suggested that
nothing is far advanced yet, so I decided to take a look.

For this effort, the goals are:

- Use Kbuild to build U-Boot, even if the existing CONFIG structure remains
- Provide access to Kconfig infrastructure so we can migrate to it
- Change as little U-Boot code as possible, particularly Makefiles

While some people regard U-Boot's config file approach as primitive, it is
very flexible. In practice many Linux build systems use a 'defconfig' which
is much the same thing, just without the comments. However, Kbuild/Kconfig
does provide some advantages:

- 'make menuconfig' and friends, an easy way to browse/change configuration
- More obvious information about configuration dependencies
- Configuration help within the Kconfig files, rather than a separate README
- The build prints the full path of each file built. Apart from the resulting
    clarity, this works nicely with IDEs/emacs which can open the correct
    file/line for each warning/error
- Welcoming and familiar to those coming from Linux
- Some other things

With respect to a migration path to full use of Kconfig for U-Boot, if that
is desired, I suggest it can be done incrementally. The scheme in this
series allows existing Makefiles to be used with only minor modification
(to fix those which don't follow convention and add information about
subdirectories). I think it is feasible to keep the config files and Kconfig
running together for a time.

This series is a pretty early and raw attempt to get Kbuild running in
U-Boot. I am not entirely comfortable with posting it, but decided that
what was missing from previous efforts was posted patches, so here they
are. A close review is not needed right now, but thoughts on the approach
would be very valuable.

This series is missing all sorts of things, some of them critical (SPL,
actual binary output, correct filename for 'u-boot' output, out-of-tree
building). It will also pollute your tree with various files that you will
need to manually remove afterwards.

But it does produce some sort of output for three boards (sandbox, seaboard,
smdk5250).

To get a verbose build, try 'make V=1'. By default only the filenames and
warnings/errors are printed.

To try it:

    make sandbox_config
    make
    size vmlinux
    ./vmlinux

You can use the existing build system with:

    make -f Makefile.legacy sandbox_config
    make -f Makefile.legacy
    size u-boot
    ./u-boot

If you omit the final patch, you can keep the existing build system in
place and have the Kconfig one separate, in Makefile.kbuild, for use with
'make -f Makefile.kbuild'.

There is only one build option, and that isn't really an option, but to
see it:

    make menuconfig

or (perhaps preceeded by 'sudo apt-get install libqt4-dev g++'):

    make xconfig


Simon Glass (7):
  Add some required Kconfig files
  arm: Allow start.o to come from any directory
  Tidy up Makefiles to use COBJS consistently
  Add Kconfig scripts and related material
  Adjust Kconfig scripts for use by U-Boot
  Enable Kconfig for U-Boot
  Switch over to Kbuild

 .gitignore                                 |    6 +
 Kconfig                                    |   11 +
 Makefile                                   | 2147 +++++++++++++++---------
 Makefile.legacy                            |  900 ++++++++++
 arch/Kconfig                               |    0
 arch/arm/Kconfig                           |    0
 arch/arm/Makefile                          |   20 +
 arch/arm/cpu/Makefile                      |   23 +
 arch/arm/cpu/armv7/Makefile                |   11 +-
 arch/arm/cpu/armv7/s5p-common/Makefile     |    3 +-
 arch/arm/cpu/tegra-common/Makefile         |    5 +-
 arch/arm/cpu/tegra20-common/Makefile       |    5 +-
 arch/arm/cpu/u-boot.lds                    |    2 +-
 arch/arm/lib/Makefile                      |    6 +-
 arch/sandbox/Kconfig                       |    8 +
 arch/sandbox/Makefile                      |   20 +
 arch/sandbox/cpu/Makefile                  |    2 +
 arch/sandbox/lib/Makefile                  |    4 +
 arch/x86/Kconfig                           |    0
 arch/x86/Makefile                          |   24 +
 config.mk                                  |    5 +
 doc/Makefile                               |   20 +
 drivers/Makefile                           |   47 +
 drivers/bios_emulator/Makefile             |    4 +
 drivers/bootcount/Makefile                 |    2 +-
 drivers/fpga/Makefile                      |    2 +-
 drivers/gpio/Makefile                      |    1 -
 drivers/mtd/Makefile                       |    2 +
 drivers/mtd/nand/Makefile                  |   21 +-
 drivers/mtd/ubi/Makefile                   |   10 +-
 drivers/power/Makefile                     |    2 +
 drivers/usb/Makefile                       |   26 +
 drivers/usb/gadget/Makefile                |    4 +-
 drivers/usb/musb-new/Makefile              |    4 +
 fs/Makefile                                |    4 +
 fs/ext4/Makefile                           |    5 +-
 fs/fat/Makefile                            |    5 +-
 fs/sandbox/Makefile                        |    5 +-
 include/linux/kconfig.h                    |   46 +
 init/Makefile                              |   21 +
 init/main.c                                |    0
 lib/Makefile                               |    3 +
 rules.mk                                   |   25 +
 scripts/Kbuild.include                     |  278 +++
 scripts/Makefile                           |   37 +
 scripts/Makefile.asm-generic               |   24 +
 scripts/Makefile.autoconf                  |   68 +
 scripts/Makefile.build                     |  479 ++++++
 scripts/Makefile.clean                     |  104 ++
 scripts/Makefile.host                      |  170 ++
 scripts/Makefile.lib                       |  380 +++++
 scripts/Makefile.modpost                   |  148 ++
 scripts/basic/.gitignore                   |    1 +
 scripts/basic/Makefile                     |   15 +
 scripts/basic/fixdep.c                     |  433 +++++
 scripts/gcc-goto.sh                        |   21 +
 scripts/kconfig/.gitignore                 |   22 +
 scripts/kconfig/Makefile                   |  336 ++++
 scripts/kconfig/POTFILES.in                |   12 +
 scripts/kconfig/check.sh                   |   14 +
 scripts/kconfig/conf.c                     |  701 ++++++++
 scripts/kconfig/confdata.c                 | 1164 +++++++++++++
 scripts/kconfig/expr.c                     | 1168 +++++++++++++
 scripts/kconfig/expr.h                     |  235 +++
 scripts/kconfig/gconf.c                    | 1542 +++++++++++++++++
 scripts/kconfig/gconf.glade                |  661 ++++++++
 scripts/kconfig/images.c                   |  326 ++++
 scripts/kconfig/kxgettext.c                |  235 +++
 scripts/kconfig/list.h                     |   91 +
 scripts/kconfig/lkc.h                      |  198 +++
 scripts/kconfig/lkc_proto.h                |   56 +
 scripts/kconfig/lxdialog/.gitignore        |    4 +
 scripts/kconfig/lxdialog/BIG.FAT.WARNING   |    4 +
 scripts/kconfig/lxdialog/check-lxdialog.sh |   85 +
 scripts/kconfig/lxdialog/checklist.c       |  332 ++++
 scripts/kconfig/lxdialog/dialog.h          |  236 +++
 scripts/kconfig/lxdialog/inputbox.c        |  301 ++++
 scripts/kconfig/lxdialog/menubox.c         |  436 +++++
 scripts/kconfig/lxdialog/textbox.c         |  408 +++++
 scripts/kconfig/lxdialog/util.c            |  664 ++++++++
 scripts/kconfig/lxdialog/yesno.c           |  114 ++
 scripts/kconfig/mconf.c                    |  963 +++++++++++
 scripts/kconfig/menu.c                     |  644 +++++++
 scripts/kconfig/merge_config.sh            |  142 ++
 scripts/kconfig/nconf.c                    | 1558 +++++++++++++++++
 scripts/kconfig/nconf.gui.c                |  654 ++++++++
 scripts/kconfig/nconf.h                    |   96 ++
 scripts/kconfig/qconf.cc                   | 1790 ++++++++++++++++++++
 scripts/kconfig/qconf.h                    |  337 ++++
 scripts/kconfig/streamline_config.pl       |  634 +++++++
 scripts/kconfig/symbol.c                   | 1310 +++++++++++++++
 scripts/kconfig/util.c                     |  159 ++
 scripts/kconfig/zconf.gperf                |   47 +
 scripts/kconfig/zconf.hash.c_shipped       |  286 ++++
 scripts/kconfig/zconf.l                    |  364 ++++
 scripts/kconfig/zconf.lex.c_shipped        | 2420 +++++++++++++++++++++++++++
 scripts/kconfig/zconf.tab.c_shipped        | 2504 ++++++++++++++++++++++++++++
 scripts/kconfig/zconf.y                    |  740 ++++++++
 scripts/link-vmlinux.sh                    |  227 +++
 scripts/mkcompile_h                        |  100 ++
 scripts/mksysmap                           |   45 +
 scripts/mod/.gitignore                     |    5 +
 scripts/mod/Makefile                       |   51 +
 scripts/mod/devicetable-offsets.c          |  178 ++
 scripts/mod/empty.c                        |    1 +
 scripts/mod/file2alias.c                   | 1236 ++++++++++++++
 scripts/mod/mk_elfconfig.c                 |   57 +
 scripts/mod/modpost.c                      | 2222 ++++++++++++++++++++++++
 scripts/mod/modpost.h                      |  187 +++
 scripts/mod/sumversion.c                   |  519 ++++++
 scripts/setlocalversion                    |  176 ++
 111 files changed, 33813 insertions(+), 803 deletions(-)
 create mode 100644 Kconfig
 create mode 100644 Makefile.legacy
 create mode 100644 arch/Kconfig
 create mode 100644 arch/arm/Kconfig
 create mode 100644 arch/arm/Makefile
 create mode 100644 arch/arm/cpu/Makefile
 create mode 100644 arch/sandbox/Kconfig
 create mode 100644 arch/sandbox/Makefile
 create mode 100644 arch/x86/Kconfig
 create mode 100644 arch/x86/Makefile
 create mode 100644 doc/Makefile
 create mode 100644 drivers/Makefile
 create mode 100644 drivers/usb/Makefile
 create mode 100644 include/linux/kconfig.h
 create mode 100644 init/Makefile
 create mode 100644 init/main.c
 create mode 100644 scripts/Kbuild.include
 create mode 100644 scripts/Makefile
 create mode 100644 scripts/Makefile.asm-generic
 create mode 100644 scripts/Makefile.autoconf
 create mode 100644 scripts/Makefile.build
 create mode 100644 scripts/Makefile.clean
 create mode 100644 scripts/Makefile.host
 create mode 100644 scripts/Makefile.lib
 create mode 100644 scripts/Makefile.modpost
 create mode 100644 scripts/basic/.gitignore
 create mode 100644 scripts/basic/Makefile
 create mode 100644 scripts/basic/fixdep.c
 create mode 100644 scripts/gcc-goto.sh
 create mode 100644 scripts/kconfig/.gitignore
 create mode 100644 scripts/kconfig/Makefile
 create mode 100644 scripts/kconfig/POTFILES.in
 create mode 100755 scripts/kconfig/check.sh
 create mode 100644 scripts/kconfig/conf.c
 create mode 100644 scripts/kconfig/confdata.c
 create mode 100644 scripts/kconfig/expr.c
 create mode 100644 scripts/kconfig/expr.h
 create mode 100644 scripts/kconfig/gconf.c
 create mode 100644 scripts/kconfig/gconf.glade
 create mode 100644 scripts/kconfig/images.c
 create mode 100644 scripts/kconfig/kxgettext.c
 create mode 100644 scripts/kconfig/list.h
 create mode 100644 scripts/kconfig/lkc.h
 create mode 100644 scripts/kconfig/lkc_proto.h
 create mode 100644 scripts/kconfig/lxdialog/.gitignore
 create mode 100644 scripts/kconfig/lxdialog/BIG.FAT.WARNING
 create mode 100644 scripts/kconfig/lxdialog/check-lxdialog.sh
 create mode 100644 scripts/kconfig/lxdialog/checklist.c
 create mode 100644 scripts/kconfig/lxdialog/dialog.h
 create mode 100644 scripts/kconfig/lxdialog/inputbox.c
 create mode 100644 scripts/kconfig/lxdialog/menubox.c
 create mode 100644 scripts/kconfig/lxdialog/textbox.c
 create mode 100644 scripts/kconfig/lxdialog/util.c
 create mode 100644 scripts/kconfig/lxdialog/yesno.c
 create mode 100644 scripts/kconfig/mconf.c
 create mode 100644 scripts/kconfig/menu.c
 create mode 100755 scripts/kconfig/merge_config.sh
 create mode 100644 scripts/kconfig/nconf.c
 create mode 100644 scripts/kconfig/nconf.gui.c
 create mode 100644 scripts/kconfig/nconf.h
 create mode 100644 scripts/kconfig/qconf.cc
 create mode 100644 scripts/kconfig/qconf.h
 create mode 100644 scripts/kconfig/streamline_config.pl
 create mode 100644 scripts/kconfig/symbol.c
 create mode 100644 scripts/kconfig/util.c
 create mode 100644 scripts/kconfig/zconf.gperf
 create mode 100644 scripts/kconfig/zconf.hash.c_shipped
 create mode 100644 scripts/kconfig/zconf.l
 create mode 100644 scripts/kconfig/zconf.lex.c_shipped
 create mode 100644 scripts/kconfig/zconf.tab.c_shipped
 create mode 100644 scripts/kconfig/zconf.y
 create mode 100644 scripts/link-vmlinux.sh
 create mode 100755 scripts/mkcompile_h
 create mode 100644 scripts/mksysmap
 create mode 100644 scripts/mod/.gitignore
 create mode 100644 scripts/mod/Makefile
 create mode 100644 scripts/mod/devicetable-offsets.c
 create mode 100644 scripts/mod/empty.c
 create mode 100644 scripts/mod/file2alias.c
 create mode 100644 scripts/mod/mk_elfconfig.c
 create mode 100644 scripts/mod/modpost.c
 create mode 100644 scripts/mod/modpost.h
 create mode 100644 scripts/mod/sumversion.c
 create mode 100755 scripts/setlocalversion

-- 
1.8.2.1



More information about the U-Boot mailing list