Changes between Version 11 and Version 12 of BuildSystem


Ignore:
Timestamp:
Nov 28, 2009, 4:08:11 PM (14 years ago)
Author:
becoulet
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BuildSystem

    v11 v12  
    44= Overview of the build process =
    55
    6 The build system take a configuration file, processes the dependancies, and compiles the desired kernel.
    7 
    8 Depending on the targeted architecture, the output file may be an ELF (.out), a plain binary file (.bin), an intel-hex file (.hex) or an object file (.o).
    9 
    10 The build system takes care of dependancies, file modifications, ...
     6The build system takes a build configuration file and compiles the desired kernel together with the application.
     7
     8The build system takes care of dependencies, file modifications, ... And is still simple to use for the beginner.
     9
     10Depending on the target architecture, the output file may be an ELF (.out), a plain binary file (.bin), an intel-hex file (.hex) or an object file (.o).
    1111
    1212= User point of view =
    1313
    14 == Makefile options (command line) ==
    15 
    16 When building with MutekH, several options may be used to change the behavior of the build system.
     14== Invocation ==
     15
     16When building MutekH, several options may be used to change the behavior of the build system.
    1717These options are given through variables when calling `make`, in the form:
     18
    1819{{{
    1920$ make VAR1=value1 VAR2=value2
    2021}}}
    2122
    22 The following options are mandatory:
     23Real build process invocation just need to specify build configuration to use:
     24
     25{{{
     26# using flat and simple build configuration file
     27$ make CONF=examples/hello/config_soclib_mipsel
     28}}}
     29{{{
     30# using sectioned build configuration file
     31$ make CONF=examples/hello/config BUILD=soclib-mipsel
     32}}}
     33
     34== Main variables ==
     35
     36The following option is mandatory:
    2337 `CONF=`::
    24    An absolute path to the root configuration file for the desired kernel instance.
     38   An absolute path to the build configuration file.
     39
     40The following option may be required depending on build configuration file:
     41 `BUILD=`::
     42   A colon separated list of build section names to consider in the build configuration file.
    2543
    2644The following options may be useful:
     
    5472   This prints the flags used for compilation
    5573
    56 The following targets are available to get help about configuration
     74The following targets are available to get help about configuration.
    5775
    5876 `listconfig`::
     
    6280 `showconfig`::
    6381   This prints detailed information about a given configuration token. Token must be specified with `TOKEN=` variable argument.
    64    {{{
    65 $ make showconfig TOKEN=CONFIG_PTHREAD
    66 }}}
     82
     83See usage below.
    6784
    6885== Build configuration files ==
     86
     87=== Content ===
    6988
    7089MutekH build configuration files contain tokens defining the kernel we are currently building. They must contain:
     
    7796 * ...
    7897
     98=== Basic syntax ===
     99
    79100Syntax is `token` '''space''' `value`. Tokens begin with `CONFIG_`. Value may be unspecified thus defaults to `defined`. e.g.
    80101{{{
     
    102123
    103124Most common values are `defined` and `undefined` to enable and disables features, but some tokens may need numerical or string values.
     125
     126Have a look to [source:trunk/mutekh/examples/hello] for examples of complete build configuration files.
     127
     128== Help display ==
     129
     130To display the list of all available tokens:
     131{{{
     132$ make CONF=path/to/config_file listconfig
     133$ make CONF=path/to/config_file listallconfig
     134}}}
     135
     136To display help about a specific token:
     137{{{
     138$ make CONF=path/to/config_file showconfig TOKEN=CONFIG_PTHREAD
     139}}}
     140
     141The [http://www.mutekh.org/www/mutekh_api/ MutekH API reference manual] describes all available configuration tokens too.
     142
     143=== Module declaration ===
    104144
    105145A build configuration file may declare a new module. Modules can be located anywhere outside of the main source tree. We must tell the build system the directory where the configuration lies. The path to the module directory is usually the same as its configuration file:
     
    110150}}}
    111151
    112 To display the list of all available tokens, do
    113 {{{
    114 $ make listallconfig
    115 }}}
    116 
    117 For a list of current available tokens depending on your configuration file, do
    118 {{{
    119 $ make CONF=path/to/config_file listconfig
    120 }}}
     152=== Advanced syntax ===
     153
     154Basic configuration is really simple. Complex applications or multiple target architectures require maintaining multiple configuration files which can be difficult and annoying. The directives presented here can be used to make things easier.
     155
     156Build configuration files may contains some directives:
     157
     158 `%section pattern [pattern ...]`::
     159   Start a section which will be conditionaly considered depending on the `BUILD` variable. `pattern` is a pattern matching expression which may contain text, hypens and wildcards (e.i. `text-text-*`). Wildcar match non-empty and non-hypens text.
     160 `%common`::
     161   Revert to unconditional common file part, default at beginning of a file.
     162 `%else`::
     163   Change current conditional state.
     164 `%include filename`::
     165   Include a configuration file, the new file always begin in `%common` state.
     166 `%types type [type ...]::
     167   Specify that the current section exhibits the given types. No more than one section can be in use with the same type.
     168 `%requiretypes type [type ...]`::
     169   All specified types must have been defined. May be used in sections or common part.
     170 `%set variable content`::
     171   Set a variable which can be expanded using {{{$(variable)}}} syntax. Environment is initially imported as variables. Moreover {{{$(CONFIGPATH)}}} and {{{$(CONFIGSECTION)}}} are predefined special variables.
     172 `%warning text`::
     173   Produce a warning message
     174 `%error text`::
     175   Produce an error message
     176
     177The `default` section name is in use when no section name is passed through the `BUILD` variable.
     178
     179Have a look to [source:trunk/mutekh/examples/hello/config] for an example of advanced build configuration file.
    121180
    122181= Developer point of view =