![]() |
![]() |
![]() |
![]() |
![]() |
Compile and Link an Application
Integration types
Cextreme comes with two different kind of integrations, Light and Threaded.
- Light Integration
- The Light Integration is a single threaded integration that requires very little interaction with the underlying OS. The SDL system runs as a single OS task, scheduling is handled by the standard kernel running a complete state transition at a time. The worst case scheduling latency is that of the longest transition.
- Threaded Integration
- The threaded integration can use multiple threads where the scheduling and communication in each thread is controlled by the SDL kernel, but scheduling and synchronization of data (such as input queues) between different threads make use of the underlying OS primitives. Worst case latency can be made as small as the underlying OS permits by carefully distributing OS threads in the system and setting different priorities for them. To be able to use the threaded integration a deployment diagram has to be created, see The Deployment Editor.
For a more in depth discussion of the different integration types, please refer to the Cadvanced documentation on the matter, Different Integration Models, since they are very similar.
Essential files
The essential files used for compilation and linking of an Cextreme Code Generator application are
- comp.opt: Defines commands for compiling, linking etc.
- make.opt or makeoptions: Contains compiler flags and compilation of the kernel.
- <compiler and integration dependant name>.m: This is the generated makefile for the application. The name depends on the choice of compiler and integration type, e.g. cl_appl_ce.m for light integration using Microsofts cl compiler.
- systemname_env.tpm: This is the generated template makefile for files that are not under full control of the code generator. This file is generated if template environment functions are generated.
comp.opt
The comp.opt file can be used to control the complete build process from a custom build script. The comp.opt file consists of five important lines (plus lines counted as comments). The syntax for the file is described in Creating a New Library, where a more detailed description of the complete make process can also be found. Below an overview for Cextreme Code Generator can be found.
- Line 1: The syntax for including make.opt in the generated makefile for the application.
- Line 2: Template for a compilation command.
- Line 3: Template for link command.
- Line 4: The command to be executed to start the make process. This should be a shell command that the build script will execute after it has finished the code generation.
- Line 5: Template for building a library.
systemname.m
When the code generator has finished the process of generating code it will execute the command defined in compt.opt at line 4. This usually is some\x7f thing like:
make -f systemname.m sctdir=<a directory>This will invoke the make facility with the generated makefile.
makeoptions (make.opt)
In the beginning of the generated makefile is an include statement, including the file makeoptions (make.opt) can be found. The variable sctdir, passed to make at the command line, is used to point out the directory where to find makeoptions.
The make program will process the makeoptions file, where it finds a number of settings for compiler, linker, and options for the compilation com\x7f mands for the kernel files. In the generated makefile it will then find the com\x7f pilation commands for the generated files and a command to link the object file to an executable.
system name_env.tpm
The template makefile mentioned above, is used to compile the files that are not directly under the control of the code generator. Such a file is generated if a file with template environment functions is generated. This file will have the name system name_env.tpm and handles compilation of the file with template environment functions. Targeting Expert lets you specify what template makefile to use. This can either be the generated one (use the file name *), or a user defined file. The contents of the specified template makefile is copied last into the generated makefile.
Adopting a compiler
If you need to adopt e.g. a cross compiler, you should do that by creating a new directory where a comp.opt and a makeoptions (or make.opt) file are placed. The easiest way is usually to copy existing comp.opt and makeoptions (or make.opt) files to a new directory and modify them.
http://www.ibm.com/rational |
![]() |
![]() |
![]() |
![]() |