Skip to content
Snippets Groups Projects
  1. Feb 19, 2014
    • Masahiro Yamada's avatar
      kbuild: change out-of-tree build · 9e414032
      Masahiro Yamada authored
      
      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: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
      Tested-by: default avatarGerhard Sittig <gsi@denx.de>
      9e414032
    • Masahiro Yamada's avatar
      kbuild: Use Kbuild.include · bf4b3de1
      Masahiro Yamada authored
      
      This commit adjusts some files to use Kbuild.include.
      
       - Use cc-option defined in Kbuild.include
          (Delete cc-option in config.mk)
       - Use cc-version defined in
          (Delete cc-version in config.mk)
       - Move binutils-version and dtc-version to Kbuild.include
           by analogy to cc-version
      
      This commit also adds srctree (same as SRCTREE)
      to use Kbuild scripts.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
      bf4b3de1
    • Masahiro Yamada's avatar
    • Masahiro Yamada's avatar
      Makfile: move suffix rules to Makefile.build · 5651ccff
      Masahiro Yamada authored
      
      This commit moves suffix rules from config.mk
      to scripts/Makefile.build, which will allow us
      to switch smoothly to real Kbuild.
      
      Note1:
      post/lib_powerpc/fpu/Makefile has
      its own rule to compile C sources.
      We need to tweak it to keep the same behavior.
      
      Note2:
      There are two file2 with the same name:
      arch/arm/lib/crt0.S and eamples/api/crt0.S.
      To keep the same build behavior,
      examples/api/Makefile also has to be treaked.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
      5651ccff
    • Masahiro Yamada's avatar
      4a20df39
    • Masahiro Yamada's avatar
      Makefile.host.tmp: add a new script to refactor tools · ad71fa99
      Masahiro Yamada authored
      
      This commit adds scripts/Makefile.host.tmp which will
      be used in the next commit to convert makefiles
      under tools/ directory to Kbuild style.
      
      Notice this script, scripts/Makefile.host.tmp
      is temporary.
      
      When switching over to real Kbuild,
      it will be replaced with scripts/Makefile.host of Linux Kernel.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
      ad71fa99
  2. Dec 13, 2013
    • Masahiro Yamada's avatar
      Makefile: Move some scripts imported from Linux · dd88ab32
      Masahiro Yamada authored
      
      We have some scripts imported from Linux Kernel:
      setlocalversion, checkstack.pl, checkpatch.pl, cleanpatch
      
      They are located under tools/ directory in U-Boot now.
      But they were originally located under scripts/ directory
      in Linux Kernel.
      
      This commit moves them to the original location.
      
      It is true that binutils-version.sh and dtc-version.sh
      do not originate in Linux Kernel, but they should
      be moved by analogy to gcc-version.sh.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
      dd88ab32
  3. Nov 17, 2013
  4. Oct 31, 2013
    • Masahiro Yamada's avatar
      Makefile: support descending down to subdirectories · ac7e7353
      Masahiro Yamada authored
      
      This patch tweaks scripts/Makefile.build to allow
      the build system to descend into subdirectories like Kbuild.
      
      To use this feature, use "obj-y += foo/" syntax.
      
      Example:
          obj-$(CONFIG_FOO) += foo/
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
      Cc: Simon Glass <sjg@chromium.org>
      ac7e7353
    • Masahiro Yamada's avatar
      Makefile: prepare for using Kbuild-style Makefile · ce28d7ac
      Masahiro Yamada authored
      
      Every makefile in sub directories has common lines
      at the top and the bottom.
      This commit pushes the common parts into script/Makefile.build.
      
      Going forward sub-makefiles only need to describe this part:
      
          COBJS := ...
          COBJS += ...
          SOBJS := ...
      
      But using obj-y is preferable to prepare for switching to Kbuild.
      
      The conventional (non-Kbuild) Makefile style is still supported.
      This is achieved by greping the Makefile before entering into it.
      U-Boot conventional sub makefiles always include some other makefiles.
      So the build system searches a line beginning with "include" keyword
      in the makefile in order to distinguish which style it is.
      If the Makefile include a "include" line, we assume it is a conventional
      U-Boot style. Otherwise, it is treated as a Kbuild-style makefile.
      
      With this tweak, we can switch sub-makefiles
      from U-Boot style to Kbuild style little by little.
      
      obj-y := foo/
      syntax (descending into the sub directory) is not supportd yet.
      It will be implemented in the upcomming commit.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
      Cc: Simon Glass <sjg@chromium.org>
      Cc: Tom Rini <trini@ti.com>
      ce28d7ac
Loading