GBS Logo Generic Build Support (GBS) - User Manual HOME
Generating Code

The difference between GBSGEN and GBSMAKE

gbsgen

gbsmake

Specifying Files in GBSGEN, GBSMAKE and GBSAUDIT

Syntax

The generic syntax to specify files in GBSGEN, GBSMAKE and GBSAUDIT is:

    [options1]... [ [[Component:][file]... [options2] ]...

The string is parsed left-to-right, setting the 'current-Component' as specified with Component:
Both Component and file may contain wild-cards.
file may be a comma-list, binding it to a possibly prefixed Component

e.g.: gbsgen *_test:*.c
Will generate all *.c files in all Components suffixed with '_test'
e.g.: gbsgen *_test:*.c,*.cpp main: *.glk *.glb
Will generate all *.c and *.cpp files in all Components suffixed with '_test' then all *.glk in 'main' and then all *.glb in 'main'.
e.g.: gbsgen *:*.*
Will generate all files in all Components (within the SubSystem), in the proper order.
For this particular purpose however you should use gbssysgen SubSystem.

gbsgen, gbsaudit

options1 if present, will be passed to all file-generations

options2 if present, will be passed to all file-generations preceding the options2

gbsmake

options1 if present, will be passed to 'make'

options2 cannot be present in gbsmake. Use the GBS_FLAGS_type to specify options with gbsmake.

Typical use of GBSGEN:

    gbsgen my_file.c -DTEST comp1.c  comp2:test.c -DTEST2

This results in:

  1. Compile my_file.c in the current Component with options -DTEST
  2. Compile comp1.c in the current Component
  3. Compile test.c in Component comp2 with options -DTEST2

Specifying FLAGS (-D)

There are predefined FLAGS for Debug-Mode, Debugger, Optimizer and Map-files
- Do not specify -G but DEBUGGER=YES
- Do not specify -DDEBUG but MODE=DEBUG
Full list:

Flags will be placed behind the generation scripts own flags in the following order

  1. (generation-scripts own flags)
  2. Flags in $GBS_BUILD_PATH/flags_type.gbs
  3. Flags in $GBS_BUILD_PATH/$GBS_TARGET/flags_type.gbs
  4. Flags in $GBS_COMPONENT_OPT_PATH/flags_type.gbs
  5. Flags in $GBS_COMPONENT_OPT_PATH/$GBS_TARGET/flags_type.gbs
  6. Flags in Env. variable GBS_FLAGS_TYPE (either pre-set or on command-line)
  7. Flags in GBS Command-line

Specifying Search Paths (for -I and -L)

Include Paths are passed to the generation scripts in the following order

  1. ../loc
  2. ../inc
  3. ../bld/$GBS_TARGET (Only for glkbt builds)
  4. as specified in $GBS_COMPONENT_PATH/scope.gbs:
    Component/inc or
    Component/inc and Component/bld/$GBS_TARGET
  5. as specified in $GBS_COMPONENT_OPT_PATH/$GBS_TARGET/incs_type.gbs
  6. as specified in $GBS_COMPONENT_OPT_PATH/incs_type.gbs
  7. as specified in $GBS_BUILD_PATH/incs_TYPE.gbs
  8. as specified in $GBS_BUILD_PATH/$GBS_TARGET/incs_TYPE.gbs
  9. as specified in $GBS_SYSBUILD_PATH/incs_TYPE.gbs
  10. as specified in $GBS_SYSBUILD_PATH/$GBS_TARGET/incs_TYPE.gbs
  11. as specified in the generation-script

Note that the contents of the incs_TYPE.gbs files must refer to directories outside the current (Sub)System.

Do not prefix directories (with -I or -L)