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| Creating automated testing| Exporting the executable| Generate in the Batch| Adding a Build (Debug)| Creating a non-GBS SubSystem| Try the GUI| 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:

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):
gbssettings → 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 Component 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):
gbssettings → Change Profile settings → General Settings
More info: Define your own editor

Create and edit the file

Now we create the file:

Adjust the Build-environment (if necessary)

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

Compile the file

Enter: gbsbuild hello.c
Repeat until no more errors:
Note: You need not be in the src directory when you execute a gbsbuild.
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

Creating automated testing Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

For testing we need a .glt file in the src directory

Create the .glt file

Run the .glt 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 gbssysbuild logfiles:

Adding a Build (Debug) Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

The previously defined Build 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 Build with gbsbuild and use swb to switch Builds.
Enter: gbssysbuild and observe how the system is generated for both Builds 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

Try the GUI Bottom Doc. Button Top Document Button Down Section Button Up Section Button Down Chapter Button Up Chapter Button

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

System

switch.gbs(.bat/.sh)

This file resides in the $GBS_SYSTEM_PATH directory.
It is a script that is executed every time GBS makes a System 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 System have been set.

The file consists of two parts:

Because the SITE part is always the same on a specific PC you can also put your Root definitions in a central file called site.gbs
create_system.html