GBS Logo HOME Generic Build Support (GBS) - User Manual
The .gbs files - General Bottom Doc. Button

Contents Bottom Doc. Button Top Document Button Down Section Button Blank

General
Usage| General Syntax| End-Of-Line Comments| build-line-selection| Order of actions
Directives
.plugin| .include| .eol_comment| .builds| .exit| .end
Common Elements
COMMAND

General Bottom Doc. Button Top Document Button Down Section Button Up Section Button

Usage Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Blank

The .gbs files form together with the directory structure the backbone of GBS.
They contain meta-data and are used to control the behaviour of GBS.

General Syntax Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

End-Of-Line Comments Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

The usage of End-Of-Line Comments can be enabled and disabled by means of the .eol_comment directive.
Enabling the EOL Comments slows down parsing and should therefore be enabled with care.
It works similar as C and C++ // comments.

Syntax:

line # comments

Semantics:

#
The # must be surrounded by at least 1 white-space on both sides
The # , any characters following the # and any whitespace preceding the # will be removed.
Possibly remaining empty line will be skipped

Example

ENABLE = AKI # "Akiyama's criterion"
results in:
ENABLE = AKI

build-line-selection Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

The build-line-selection mechanism allows lines to be skipped depending on the current Build.
This mechanism is not enabled for all .gbs files.

Syntax:

line operator wild-build-list

Semantics:

line
The line that will candidate for the selection
operator
== | !=
wild-build-list
The Build(s) for which the scope is valid (==) or not (!=)
Wildcards are honoured

Example

comp1:file.o      != gnu
Means: line will be skipped for Build gnu
comp2:file.o      = gnu
Means: line will be included only for Build gnu

Note

It is practice to align the Build selections to the right of the lines.

Order of actions Bottom Doc. Button Top Document Button Down Section Button Up Section Button Blank Up Chapter Button

  1. Skip empty lines and lines starting with '#'
  2. Remove EOL-Comments if enabled
    Skip possibly resulting empty line
  3. Perform Build-Line-Selection and remove build-selection part
  4. Execute Directive / Line

Directives Bottom Doc. Button Top Document Button Down Section Button Up Section Button

    .plugin     .include     .eol_comment     .builds     .exit     .end

.plugin Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Blank

Purpose:

To define the plugin.
The plugin-directory associated with the defined plugin will be added to a possible include-path.
It is used to find the plugin directory with .include

Syntax:

.plugin plugin_name

Semantics:

plugin_name
The plugin-directory must exist

.include Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

Purpose:

To include text from another .gbs file

Syntax:

.include gbs_file
.include "gbs_file"
.include <plugin_gbs_file>

Semantics:

gbs_file
Absolute filepath is not allowed
'../' is not allowed
The file must be a .gbs file
The search-path depends on the type of the .gbs file
plugin_gbs_file
Absolute filepath is not allowed
'../' is not allowed
The file must be a .gbs file
The file will be taken from the plugin directory as specified by the .plugin directive

.eol_comment Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

Purpose:

To enable/disable EOL (End-Of-Line) Comments

Syntax:

.eol_comment enable
.eol_comment disable

Semantics:

General
The state (enabled/disabled) is propagated through includes.
Each main file starts in the disabled state.

.builds Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

Purpose:

To exclude generation of SRC files depending on the current Build
Only for glkbt files

Syntax:

.builds[!]=wild-build-comma-list

Semantics:

General
glkbt files only
The directive must be the first item in the file (after comments)
The build step will not be executed if the condition is false. A dummy output file will be created.
This is useful when a build step (like testing) should not be executed for specific Builds
Note
This mechanism works very similar to the build-line-selection, except no spaces are allowed.

.exit Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

Purpose:

To prematurely exit from a (included) file

Syntax:

.exit

Semantics:

General
The rest of the file will be skipped
This may be useful when testing a setup of a file and you do not want to comment out the rest of the file
You will get a warning.

.end Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

Purpose:

To prematurely exit from a (included) file

Syntax:

.end

Semantics:

General
The rest of the file will be skipped
This may be useful when you want to add extensive documentation and do not want it to slow down processing of the file.
It also gives you the possibility of free-format text (without leading '#')

Common Elements Bottom Doc. Button Top Document Button Down Section Button Up Section Button

    COMMAND

COMMAND Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Blank

Purpose

Used to execute a script, executable or builtin command.
Available in the plugin descriptors: audit.gbs, build.gbs and tool.gbs.

Syntax:

COMMAND = [ [ pre-condition ; ] ok_exit_values-comma-list ; ] command-definition

Semantics:

COMMAND
pre_condition
file_exists_condition | env_value_condition
The command will only be executed if the condition is true.
file_exists_condition
[ ! ] exists file_spec
env_value_condition
variable_name_in_uppercase =|==|!= value
ok_exit_values-comma-list
Specifies the exit values for the command that are considered OK.
Range specification (e.g.: 3-5) allowed. Default is 0.
command-definition
command | @user_script | >gbs_audit_script | .gbs_script echo_command | set_command
command
Single line command
user_script
Search for in User-Audit and then GBS-Audit
gbs_script
Relative from the GBS plugin/plugin directory
gbs_script
Take from GBS_SCRIPTS_PATH
echo_command
ECHO any_text
Prints any_text. EnvVars and positional parameters are replaced
set_command
SET variable_name_in_uppercase = any_value
Sets the EnvVar. In any_value EnvVars and positional parameters are replaced
Note that you can continue a long command on the next line by adding ' \' at the end.

The command may be called with parameters. Refer to the actual definition.

gbsfiles.html