GBS Logo HOME Generic Build Support (GBS) - User Manual
Create a GBS-WA/System Bottom Doc. Button

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

Description
Before you start| Creating the GBS-WA| Creating a Subsystem| Creating a Component| Getting one file to compile| Creating the executable| Exporting the executable| Generate in the Batch| Adding a Target| Creating a non-GBS SubSystem| Interfacing with the outside-world

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

Creating a new GBS-WA is serious business.
A good understanding of the concept and principles of GBS is needed.
Once done however, things get extremely simple, convenient and fast.

This document will guide you to setup a simple non SCM-controlled 'Hello World' project to give you a taste of GBS.

Before you start Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Blank

Install GBS

Read:

Prepare

After Install it really helps if you have read: If you get stuck, read:
  • Top Level Directory Structure
  • Full Directory Structure
  • Procedures

    The project

    For the explanation below a 'Hello world' implementation is used as example: Linux: We will be using the native C/C++ compiler toolchain
    Windows: We will be using the MinGW toolchain

    Startup GBS

    Setup Editor

    Now is a good time to setup your editor if you have not yet done so. (Not required):
    gbssetup → Change Profile settings → General Settings
    More info: Define your own editor

    Creating the GBS-WA Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

    Make sure your 'Site' is defined in GBS
    We will now proceed to create a SubSystem in the current System.

    Creating a Subsystem Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

    We will now proceed to create a Component in the current SubSystem

    Creating a Component Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

    We will now proceed to create a file in the current Compionent and compile it

    Getting one file to compile Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

    Setup Editor

    If you have not setup your own editor, now is really the time to do so. (But you do not have to):
    gbssetup → Change Profile settings → General Settings
    More info: Define your own editor

    Create and edit the file

    Now we create the file:

    Adjust the Target-environment (if necessary)

    Try to compile the file with gbsgen hello.c
    It should compile, but if it fails that is probably because the GBSEXT_ EnvVars are not properly set:

    Compile the file

    Repeat until no more errors: Note: You need not be in the src directory when you execute a gbsgen.
    We will now proceed to create the executable

    Where am I?

    At any time you can enter gbs on the commandline. It will show you all currencies.

    Creating the executable Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

    For linking we need a .glk file in the src directory

    Create the .glk file

    Link and run the .glk file

    We will now proceed to export the executable

    Exporting the executable Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

    For the Export we will need an export.gbs file in the component.

    Create export.gbs file

    We will assume that this executable is for a customer called FOO

    Export the file

    Generate in the Batch Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

    If at a later stage you want to view your gbssysgen logfiles:

    Adding a Target Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

    The previously defined Target will generate our FINAL (non-debug) version.
    But we also want a DEBUG version: It is done now. You can generate single stuff for a single Target with gbsgen and use swt to switch Targets.
    Enter: gbssysgen and observe how the system is generated for both Targets in parallel.

    Creating a non-GBS SubSystem Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

    Create a 'make' Subsystem

    Interfacing with the outside-world Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

    System (Root)

    switch.gbs(.bat/.sh)

    This file resides in the $GBS_ROOT_PATH directory.
    It is a script that is executed every time GBS makes a System (Root) current.
    Its purpose is to define the particularities of the general building environment of the selected System.
    e.g.: Here you want to make sure you are using the proper environment for your particular System.
    Have a look at the contents of this file.
    It is maintained by the GBS Administrator and must be under SCM control.
    Note that at the moment of invocation all environment variables for that Root have been set.

    switch.usr(.bat./sh)

    This optional file also resides in the $GBS_ROOT_PATH directory.
    It is an optional script that is executed every time GBS makes a System current.
    And after the switch.gbs mentioned above has been executed.
    Its purpose is to enable a developer to (re-) define the particularities of the general building environment of the selected System.
    It is maintained by the Developer and must never be under SCM control.

    Note: If you change any of these two files you must swr . for them to take effect.