how-openadk-works.txt 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // -*- mode:doc; -*-
  2. // vim: set syntax=asciidoc:
  3. How OpenADK works
  4. -----------------
  5. As mentioned above, OpenADK is basically a set of Makefiles that
  6. download, configure, and compile software with the correct options. It
  7. also includes patches for various software packages and the Linux kernel.
  8. There is basically one Makefile per software package. Makefiles are split into
  9. many different parts.
  10. * The +toolchain/+ directory contains the Makefiles
  11. and associated files for all software related to the
  12. cross-compilation toolchain: +binutils+, +gcc+, +gdb+,
  13. +kernel-headers+ and +libc+.
  14. * The +target/+ directory contains the definitions for all the processor
  15. architectures that are supported by OpenADK. +target/linux+ contains
  16. the meta-data for the Linux kernel configuration abstraction layer and
  17. the kernel patches.
  18. * The +package/+ directory contains the Makefiles and
  19. associated files for all user-space tools and libraries that OpenADK can
  20. compile and add to the target root filesystem or to the host directory. There
  21. is one sub-directory per package.
  22. * The +mk/+ directory contains some globally used Makefiles with
  23. the suffix +.mk+, these are used in all other Makefiles via include.
  24. * The +adk/+ directory contains the Makefiles and
  25. associated files for software related to the generation of the
  26. host tools needed for +make menuconfig+ system.
  27. * The +scripts/+ directory contains shell scripts for the creation of
  28. meta-data in OpenADK, install scripts and image creation scripts.
  29. The configuration process is separated in following steps:
  30. * Makefile is just a wrapper which calls the prerequisite shell script.
  31. * The prerequisite shell script +scripts/prereq.sh+ checks if the host
  32. system have all required software installed and tries to build GNU make
  33. and bash if it is missing. It creates the +prereq.mk+ Makefile.
  34. * Compile and run the OpenADK tools to generate the meta-data for the menu
  35. based configuration and creates the +package/Depends.mk+ Makefile to handle the
  36. dependencies.
  37. * Starts the menu based configuration system via +make menuconfig+.
  38. The following steps are performed, once the configuration is done
  39. (mainly implemented in +mk/build.mk+):
  40. * Create all the output directories: +host_<gnu_host_name>+, +target_<arch>_<libc>+,
  41. +build_<arch>_<libc>+, +pkg_<arch>_<libc>+, etc.
  42. * Generate the host tools required for different tasks (encrypting passwords,
  43. compressing data, extracting archives, creating images, ..)
  44. * Generate the cross-compilation toolchain (binutils, gcc, libc, gdb)
  45. * Compile the Linux kernel
  46. * Compile all the userspace packages, the boot loader and external kernel modules
  47. * Generate the firmware images or archives
  48. * Output a target specific help text