9os

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 4ee196b1308105e974333a0db8191fdc7451220b
parent 4a549347c833366566dfb2bb396ace26afe8d5b8
Author: Roberto Vargas <roberto.vargas@arm.com>
Date:   Wed, 24 Apr 2019 11:30:14 +0100

[doc] Add documentation about the build system.

Change-Id: I1c04162d8c0631c9cbbc3769ebaf62d99a08b49b

Diffstat:
Mdoc/DESIGN | 44+++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/doc/DESIGN b/doc/DESIGN @@ -175,6 +175,48 @@ TBD 4) Build system --------------- -TBD +The rcode build system is based in fully portable POSIX Makefiles. They +are structured in a recursive fashion, having a Makefile per directory +that in case of being needed recurse in the appropiate subdirectories. +Every Makefile begins with lines similar to: + +.POSIX: +PROJECTDIR=../.. +include $(PROJECTDIR)/scripts/rules.mk + +The first line specifies to the make program that this is a POSIX +Makefile, switching on the POSIX mode of the tool in case of accepting +different modes. The second line specifies where is the root of the +project related to the current directory and the third line includes the +file rules.mk. The file rules.mk uses the definition of PROJECTDIR to +define a set of macros and rules that will be used by all the Makefiles +of the project. + +The build process depends of three variables: + + - CONF: This variable specifies the system configuration of + the target. By default it has the value "arm64-rcode". + + - TOOL: This variable specifies the toolchain used to build + the target. By default it has the value "gnu". + + - CROSS_COMPILE: This variable specifies a prefix used + for the binaries of the toolchain. By default it + has an empty value. + +There are several make variables that must be exported to the shell +because there are shell scripts that use them, and for this reason the +top Makefile generates the file scripts/env.sh which is sourced before +recursing. For this reason, some Makefiles may not work when make is +executed in one subdirectory (unless the user sources them in his shell). +Anyway, the build system only guarantees a correct build when make +is executed from the root directory of the project, otherwise some +dependencies may be not correctly tracked. + +There are several Makefiles (drivers, src/romfw, src/ramfw) that produce +a filed called builtin.o as target. This file is the composition of +all the object files compiled in that directory. This avoid having +dependencies between the top Makefile and the lower Makefiles as +the top Makefile doesn't need to know what object files must be linked. [0] http://www.simple-cc.org