3.18.4. Project file contents

The project file is generated from the specified configuration options and describes the options used for each platform and the files that are required to build the model. File and directory names can be either absolute or relative to the project or repository file. You can use environment variables in file names.

Caution

Files and directories are processed in the order they are encountered in the project file. See File processing order for details.

An individual file can have both file and directory actions associated with it. See Directories in path statements.

Japanese or Korean characters must not be used in project filename paths, as they can lead to failure to find the specified libraries.

File or directory entries in project files can include filters to specify the following build options:

Host platform

Specifies the operating system as either:

  • "Linux"

  • "Win32" for a release version of the build

  • "Win32D" for a debug version of the build.

Compiler

Specifies the compiler to use as either:

  • "VC2005" for Microsoft VC++ 2005 SP1

  • "VC2008" for Microsoft VC++ 2008 SP1

  • "GCC3.4.3" for Linux.

Additional compiler options might be added in future product versions.

Note

For Microsoft VC++2005 and VC++2008, you must have service pack one (SP1) installed.

Action

Specifies the action to take for the specified file or directory as one or more of:

  • "lisa" to process the file as a LISA file. This action cannot be applied to directories.

  • "compile" to process the file as a C++ file

    If a directory is specified, all *.c, *.cpp, and *.cxx files in the directory are compiled.

  • "ignore" to exclude the file or directory from the build and deploy process, such as a disabled file or project notes.

  • "link" to link the file with existing files.

    If a directory is specified, on Windows all *.lib and *.obj files in the directory are added to the linker input. On Linux, all *.a and *.o files are added.

  • "deploy" to produce a deployable file.

    If a directory is specified, the entire directory and its subdirectories are recursively copied to the destination.

    Note

    "deploy" is the only action that acts recursively on subdirectories.

  • "incpath" to include the directory in the list of include search paths specified by the -I option for the compiler. This is the default action for a directory.

  • "libpath" to include the directory in the list of library search paths specified by the -L option for the compiler.

    Note

    "libpath" is the default action for directories.

The build options for the file or directory entries are not case sensitive.

For example, the my_file.lib file can specify host, compiler, and action as:

path = my_file.lib, platform="WIN32"|"Win32D", compiler="VC2008", action="link"|"deploy";

The compiler options cannot be ORed together, but they can be omitted to indicate that more than one compiler is permitted:

path = ../src/my_windows_code.cpp, platform = "win32";

File entries in the project file can have a compiler filter in addition to the platform and action filters:

path = ../lib/release_2005/my_lib.lib, platform = "win32", compiler="VC2005";
path = ../lib/my_lib.lib, platform = "win32", compiler="VC2008";
path = ../src/my_windows_code.cpp, platform = "win32"; // both compilers can be used

Directories in path statements

Project files can contain directories in the path statement. Directories are differentiated from normal files by including the trailing / character. Platform and compiler filters might apply.

If an action is specified for a file that indicates an action associated with a directory, the directory path is formed by removing the file name from the full path.

The path specification:

path = MyFile.lisa, actions="lisa|incpath|libpath"; 

causes MyFile.lisa to be used as the LISA source and the parent directory for MyFile.lisa to be added to both the include and library search paths.

If, for example, MyFile.lisa is in the directory C:/ARM/MyProjects/Project_1/, that directory path is added to the include and library search paths.

Example project file

Example 3.1 lists a typical project file and shows how the different configuration sections are used.

Example 3.1. Typical project file

sgproject "DualCoreSystem.sgproj"
{
TOP_LEVEL_COMPONENT = "DualCoreSystem";
ACTIVE_CONFIG_LINUX  = "";
ACTIVE_CONFIG_WINDOWS  = "Windows-Debug";

config "Linux-Debug"
{
     ADDITIONAL_COMPILER_SETTINGS = "-g -Wall";
     ADDITIONAL_LINKER_SETTINGS = "-L $(PVLIB_HOME)/lib/linux-pentium -lz -lSDL -lpthread -lpcap";
     BUILD_DIR = "./Linux-Debug";
     CONFIG_DESCRIPTION = "Linux Debug";
     CONFIG_NAME = "Linux-Debug";
     ENABLE_DEBUG_SUPPORT = "1";
     INCLUDE_DIRS = "$(PVLIB_HOME)/include";
     PLATFORM = "Linux";
}

config "Linux-Release"
{
     ADDITIONAL_COMPILER_SETTINGS = "-O3 -Wall";
     ADDITIONAL_LINKER_SETTINGS = "-L $(PVLIB_HOME)/lib/linux-pentium -lz -lSDL -lpthread -lpcap";
     BUILD_DIR = "./Linux-Release";
     CONFIG_DESCRIPTION = "Linux Release";
     CONFIG_NAME = "Linux-Release";
     INCLUDE_DIRS = "$(PVLIB_HOME)/include";
     PLATFORM = "Linux";
}
config "Windows-Debug"
{
     ADDITIONAL_COMPILER_SETTINGS = "/Od /RTCsu /Zi";
     ADDITIONAL_LINKER_SETTINGS = "/DEBUG";
     BUILD_DIR = "./Windows-Debug";
     CONFIG_DESCRIPTION = "Windows Debug. Linked to DEBUG runtime library";
     CONFIG_NAME = "Windows-Debug";
     ENABLE_DEBUG_SUPPORT = "1";
     INCLUDE_DIRS = "$(PVLIB_HOME)/include";
     PLATFORM = "Win32D";
}


config "Windows-Release"
{
     ADDITIONAL_COMPILER_SETTINGS = "/O2 /Ob1";
     BUILD_DIR = "./Windows-Release";
     CONFIG_DESCRIPTION = "Windows Release. Linked to RELEASE runtime library";
     CONFIG_NAME = "Windows-Release";
     INCLUDE_DIRS = "$(PVLIB_HOME)/include";
     PLATFORM = "Win32";
}

files
{
     path = "../LISA/DualCoreSystem.lisa";
     path = "$(PVLIB_HOME)/etc/sglib.sgrepo";
     path = MyFile.lisa, actions="lisa|incpath|libpath"; // use file as LISA source 
                                                         // and as library and include path
     path = MyDirectory/, actions = "compile|deploy;" // compile the entire directory and deploy it
     path = CommentFile.txt, actions = "ignore"; // exclude file from any action
}
}

Copyright © 2007-2009 ARM Limited. All rights reserved.ARM DUI 0370H
Non-Confidential