summaryrefslogtreecommitdiff
path: root/docs/how-openadk-works.txt
blob: fa4b98c2c2d88bbd1f090d8fe3f99d89e45641e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// -*- mode:doc; -*-
// vim: set syntax=asciidoc:

How OpenADK works
-----------------

As mentioned above, OpenADK is basically a set of Makefiles that
download, configure, and compile software with the correct options. It
also includes patches for various software packages and the Linux kernel. 

There is basically one Makefile per software package. Makefiles are split into
many different parts.

* The +toolchain/+ directory contains the Makefiles
  and associated files for all software related to the
  cross-compilation toolchain: +binutils+, +gcc+, +gdb+,
  +kernel-headers+ and +libc+.

* The +target/+ directory contains the definitions for all the processor
  architectures that are supported by OpenADK. +target/linux+ contains
  the meta-data for the Linux kernel configuration abstraction layer and
  the kernel patches.

* The +package/+ directory contains the Makefiles and
  associated files for all user-space tools and libraries that OpenADK can
  compile and add to the target root filesystem or to the host directory. There
  is one sub-directory per package.

* The +mk/+ directory contains some globally used Makefiles with
  the suffix +.mk+, these are used in all other Makefiles via include.

* The +adk/+ directory contains the Makefiles and
  associated files for software related to the generation of the
  host tools needed for +make menuconfig+ system.

* The +scripts/+ directory contains shell scripts for the creation of
  meta-data in OpenADK, install scripts and image creation scripts.

The configuration process is separated in following steps:

* Makefile is just a wrapper which calls the prerequisite shell script.

* The prerequisite shell script +scripts/prereq.sh+ checks if the host 
  system have all required software installed and tries to build GNU make 
  and bash if it is missing. It creates the +prereq.mk+ Makefile.

* Compile and run the OpenADK tools to generate the meta-data for the menu
  based configuration and creates the +package/Depends.mk+ Makefile to handle the 
  dependencies.

* Starts the menu based configuration system via +make menuconfig+.

The following steps are performed, once the configuration is done 
(mainly implemented in +mk/build.mk+):

* Create all the output directories: +host_<gnu_host_name>+, +target_<arch>_<libc>+, 
  +build_<arch>_<libc>+, +pkg_<arch>_<libc>+, etc. 

* Generate the host tools required for different tasks (encrypting passwords,
  compressing data, extracting archives, creating images, ..)

* Generate the cross-compilation toolchain (binutils, gcc, libc, gdb)

* Compile the Linux kernel

* Compile all the userspace packages, the boot loader and external kernel modules

* Generate the firmware images or archives

* Output a target specific help text