The Syntax of the Project.meta file
Config types
Three config types exist: ExecutableConfig, LibraryConfig and CustomConfig. Some elements are only valid for specific types.
Filter
Every element (except the Project element) in Project.meta has two attributes:
default: if set to “off”, this element is not taken into account. Default is “on”.
filter: The element can be removed/added explicitly regardless of the “default” attribute with the command line options
–do “filter name”
–omit “filter name”
Example:
PostSteps {
CommandLine "$(OutputDir)/$(ArtifactName)", filter: run, default: off
}
The executable is not executed by default unless “run” is specified on command line:
bake ... --do run
Notes
Specify the paths always relative to the current project root.
Keep the variable substitution in Project.meta in mind.
Use double quotes (”) if the strings have spaces or slashes.
Use hash marks (#) for comments.
Syntax
Project default: <name> { Description <text> RequiredBakeVersion minimum: <major.minor.patch>, maximum: <major.minor.patch> Responsible { Person <name>, email: <adr> } # 0..n configs ExecutableConfig | LibraryConfig | CustomConfig <name>, extends: <parent(s)>, mergeInc: yes|no, private: true|false { # Valid for all config types Description <text> IncludeDir <dir>, inherit: true|false, inject: front|back, system: true|false Set <variable>, value: <value> | cmd: <line>, env: true|false Dependency <project>, config: <name> ExternalLibrary <lib>, search: true|false UserLibrary <lib> ExternalLibrarySearchPath <path> PreSteps { Makefile <file>, lib: <lib>, target: <target>, pathTo: <paths>, noClean: true|false, changeWorkingDir: true|false, echo: on|off, independent: true|false, validExitCodes: <[array]> { Flags <flags> } CommandLine <line>, echo: on|off, independent: true|false, validExitCodes: <[array]> Sleep <seconds>, echo: on|off, independent: true|false MakeDir <directory>, echo: on|off Remove <file or directory>, echo: on|off Touch <file or directory>, echo: on|off Copy <file or directory>, to: <file or directory>, echo: on|off Move <file or directory>, to: <file or directory>, echo: on|off } PostSteps { # Same as for PreSteps } StartupSteps { # Same as for PreSteps } ExitSteps { # Same as for PreSteps } CleanSteps { # Same as for PreSteps } DefaultToolchain <basedOn>, outputDir: <dir>, outputDirPostfix: <postfix>, eclipseOrder: true|false { Compiler ASM | CPP | C, command: <cmd>, prefix: <prefix>, keepObjFileEndings: true|false { Flags <flags> Flags <define> InternalDefines <file> SrcFileEndings <endings> } Archiver command: <cmd>, prefix: <prefix> { Flags <flags> } Linker command: <cmd>, prefix: <prefix>, onlyDirectDeps: true|false { Flags <flags> LibPrefixFlags <flags> LibPostfixFlags <flags> } InternalIncludes <file> Docu <cmdLine> } Toolchain outputDir: <dir>, outputDirPostfix: <postfix> { Compiler ASM | CPP | C, command: <cmd>, cuda: true|false, prefix: <prefix> { Flags <flags>, add: <flags>, remove: <flags> Flags <define> <define> SrcFileEndings <file> } Archiver command: <cmd>, prefix: <prefix> { Flags <flags>, add: <flags>, remove: <flags> } Linker command: <cmd>, prefix: <prefix>, onlyDirectDeps: true|false { Flags <flags>, add: <flags>, remove: <flags> LibPrefixFlags <flags>, add: <flags>, remove: <flags> LibPostfixFlags <flags>, add: <flags>, remove: <flags> } Docu <cmdLine> } Prebuild { Except <project>, config: <name> } CompilationDB <filename> CompilationCheck include: <pattern> exclude: <pattern> ignore: <pattern> # Valid for ExecutableConfig and LibraryConfig Files <pattern>, compileOnly: true|false, linkDirectly: true|false { Flags <define> <flags>, add: <flags>, remove: <flags> Flags <define> } ExcludeFiles <pattern> ArtifactName <name> ArtifactExtension <ext> # Valid for ExecutableConfig LinkerScript <script> MapFile <name> # Valid for CustomConfig Makefile | CommandLine | Sleep | MakeDir | Remove | Touch | Copy | Move ... # zero of one of these } } Adapt toolchain: <name>, os: <name>, mainProject: <name>, mainConfig: <name> { # See Adapt documention for details. }
Project
Mandatory: yes, quantity: 1, default: -
default (Project)
Attribute of Project.
Default configuration which is used if not explicitly specified on command line or Dependency definition.
Examples:
# Project.meta:
Dependency canDriver # uses default config of canDriver project
# Command line:
bake -m folder/dir/projABC # builds default config of project projABC
Mandatory: no, quantity: 0..1, default: -
Description
Description of the project or config.
Mandatory: no, quantity: 0..1, default: -
RequiredBakeVersion
Mandatory: no, quantity: 0..1, default: -
Responsible
Specify all responsible persons of the project.
Mandatory: no, quantity: 0..1, default: -
Person
Person who is responsible for the project.
Mandatory: no, quantity: 0..1, default: -
email
Attribute of Person.
Use always double quotes (”) for the email address.
Mandatory: no, quantity: 0..1, default: -
ExecutableConfig
This is usually the main config of an application.
Mandatory: no, quantity: 0..n, default: -
LibraryConfig
This config is used for a source library. The library will be linked automatically to the executable.
Mandatory: no, quantity: 0..n, default: -
CustomConfig
Mandatory: no, quantity: 0..n, default: -
extends
Attribute of ExecutableConfig, LibraryConfig or CustomConfig.
Inherit settings from parent config(s). For more information see docu page Derive configs.
Mandatory: no, quantity: 0..1, default: -
mergeInc
Attribute of ExecutableConfig, LibraryConfig or CustomConfig.
See also Merge Includes.
Mandatory: no, quantity: 0..1, default: <unset>
private
Attribute of ExecutableConfig, LibraryConfig or CustomConfig.
If true, the config cannot be referenced directly outside of this project.
Mandatory: no, quantity: 0..1, default: false
IncludeDir
Specifies the include directories for the assembler, C and C++ compiler.
Use always relative paths, not absolute paths due to portability.
Use always “/” and not “\”.
Mandatory: no, quantity: 0..n, default: -
inherit
Attribute of IncludeDir.
Inherits the include to all projects, which depend on this project.
Mandatory: no, quantity: 0..1, default: false
inject
Attribute of IncludeDir or Dependency.
Injects the element to all childs, either at the front (e.g. for mocking code) or at the back.
Avoid to inject dependencies, it will get a mess.
Mandatory: no, quantity: 0..1, default: -
system
Attribute of IncludeDir.
Mandatory: no, quantity: 0..1, default: false
Set
Mandatory: no, quantity: 0..n, default: -
env
Attribute of Set.
Stores the variable also in system environment, which makes it available in everything which is executed by bake, e.g. in Pre- and PostSteps.
Mandatory: no, quantity: 0..1, default: false
Dependency
Mandatory: no, quantity: 0..n, default: -
config (Dependency)
Attribute of Dependency.
Config name of the dependent project.
Mandatory: no, quantity: 0..1, default: <default config of the dependent project>
ExternalLibrary
Mandatory: no, quantity: 0..n, default: -
search
Attribute of ExternalLibrary.
Mandatory: no, quantity: 0..n, default: -
UserLibrary
Mandatory: no, quantity: 0..n, default: -
ExternalLibrarySearchPath
Mandatory: no, quantity: 0..n, default: -
PreSteps
Mandatory: no, quantity: 0..1, default: -
PostSteps
Mandatory: no, quantity: 0..1, default: -
StartupSteps
Mandatory: no, quantity: 0..1, default: -
ExitSteps
Mandatory: no, quantity: 0..1, default: -
CleanSteps
Mandatory: no, quantity: 0..1, default: -
Makefile
Makefile to be started, e.g.: Makefile “subDir/makefile”
Before executing the makefile, bake sets the environment variables $(BAKE_XX_COMMAND) and $(BAKE_XX_FLAGS), whereas XX is one of CPP, C, ASM, AR or LD.
Mandatory: no, quantity in steps: 0..n, quantity in CustomConfig: 0..1, default: -
lib
Attribute of Makefile.
If the result of the makefile is a library which shall be linked to the executable, name it here.
Mandatory: no, quantity: 0..1, default: -
target
Attribute of Makefile.
The target of the makefile.
Mandatory: no, quantity: 0..1, default: all
pathTo
Attribute of Makefile.
Mandatory: no, quantity: 0..1, default: -
noClean
Attribute of Makefile.
If project is cleaned (e.g. with command line argument -c), the target “clean” will be executed unless noClean is set to true.
Mandatory: no, quantity: 0..1, default: false
changeWorkingDir
Attribute of Makefile.
If set to false, the working directory will be the project directory instead of the makefile directory.
Mandatory: no, quantity: 0..1, default: true
echo (CommandLine, Makefile, Sleep)
Attribute of Makefile, CommandLine and Sleep.
“on” means the command line is shown in output, “off” means the command line is not shown.
Mandatory: no, quantity: 0..1, default: on
independent
Attribute of Makefile, CommandLine and Sleep.
Mandatory: no, quantity: 0..1, default: false
validExitCodes
Attribute of Makefile and CommandLine.
Mandatory: no, quantity: 0..1, default: [0]
Flags (makefile)
Additional makefile flags.
Mandatory: no, quantity: 0..n, default: -j
CommandLine
A command to execute, e.g.:
CommandLine "ddump -Ruv -y 0xFFFFF -oRelease/application.bin Release/application.elf"
CommandLine "echo Hello world!"
The command line string cannot be wrapped into multiple lines. If the command line gets long and unreadable, use an array to split the string, e.g.
CommandLine ["myCommand --which is --very",
"--long and --can be splitted"]
The array is internally joined to an string again with spaces in between.
Mandatory: no, quantity in steps: 0..n, quantity in CustomConfig: 0..1, default: -
Sleep
Sleep in seconds, floats are allowed.
Mandatory: no, quantity: 0..n, default: 0.0
MakeDir
A file or folder will be created.
Mandatory: no, quantity: 0..n, default: -
Remove
A file or folder will be removed. Wildcards are supported. Examples:
Remove file1
Remove "x/y/*.txt"
Mandatory: no, quantity: 0..n, default: -
Touch
A file or folder will be touched.
Mandatory: no, quantity: 0..n, default: -
Copy
A file or folder will be moved. Wildcards are supported. Examples:
Copy file1, to: file2
Copy "x/y/*.txt", to: "a/b"
Copy "source/*", to: target
Mandatory: no, quantity: 0..n, default: -
Move
A file or folder will be copied. Wildcards are supported. Examples:
Move file1, to: file2
Move "x/y/*.txt", to: "a/b"
Move "source/*", to: target
Mandatory: no, quantity: 0..n, default: -
echo (MakeDir, Remove, Touch, Copy, Move)
Attribute of MakeDir, Remove, Touch, Copy and Move.
“on” means a debug output is shown.
Mandatory: no, quantity: 0..n, default: on
DefaultToolchain
Mandatory: in main config, quantity: 1, default: -
Toolchain
Toolchain settings for a specific config.’
Mandatory: no, quantity: 0..1, default: the DefaultToolchain settings from the main config
outputDir
Attribute of DefaultToolchain and Toolchain.
outputDirPostfix
Attribute of DefaultToolchain and Toolchain.
Mandatory: no, quantity: 0..1,, default: -
eclipseOrder
Attribute of DefaultToolchain.
Mandatory: no, quantity: 0..1, default: false
Compiler
Flags and defines can be specified independently for each compiler type (ASM, CPP, C).
Mandatory: no, quantity: 0..3, default: -
Archiver
Settings for the archiver.
Mandatory: no, quantity: 0..1, default: -
Linker
Settings for the linker.
Mandatory: no, quantity: 0..1, default: -
Docu
Command to build the documentation. e.g.: doxygen main.cfg
Mandatory: no, quantity: 0..1, default: -
command
Attribute of Compiler, Archiver, Linker.
Changes the predefined command, e.g. “gcc”.
Mandatory: no, quantity: 0..1, default: -
prefix
Attribute of Compiler, Archiver, Linker.
Mandatory: no, quantity: 0..1, default: $(CompilerPrefix), $(ArchiverPrefix) or $(LinkerPrefix)
keepObjFileEndings
Attribute of Compiler.
If false, the original source file endings will be cut off (e.g. file1.cpp to file1.o), otherwise kept (file1.cpp.o).
Mandatory: no, quantity: 0..1, default: false
SrcFileEndings
List of all source file endings with dot and comma separated which are handled by this CPP, C or ASM compiler, e.g. “.cpp, .c, .cxx”. The list must not be empty.
Mandatory: no, quantity: 0..1, default: -
onlyDirectDeps
Attribute of Linker.
If set to true, only first level libraries will be linked (not sub-dependencies from dependencies).
Mandatory: no, quantity: 0..1, default: false
cuda
Attribute of Compiler.
Mandatory: no, quantity: 0..1, default: false
Flags (DefaultToolchain)
Default flags.
Mandatory: no, quantity: 0..n, default: -
Flags (Toolchain)
Flags from the DefaultToolchain can be overwritten, extended or (partly) removed.
Mandatory: no, quantity: 0..n, default: Flags from DefaultToolchain”
Flags (Files)
Flags from the Toolchain can be overwritten, extended or (partly) removed, see above.
Mandatory: no, quantity: 0..n, default: -
Define (DefaultToolchain)
Defines which are valid for all files.
Mandatory: no, quantity: 0..n, default: -
Flags (Toolchain)
Defines which are valid for the files of this config.
Mandatory: no, quantity: 0..n, default: -
Define (Files)
Defines which are valid only for these specific files.
Mandatory: no, quantity: 0..n, default: -
LibPrefixFlags
Linker libs can be prefixed if needed, e.g. with “-Wl,–whole-archive”.
Mandatory: no, quantity: 0..n, default: -
LibPostfixFlags
Linker libs can be postfixed if needed, e.g. with “-Wl,–no-whole-archive”.
Mandatory: no, quantity: 0..n, default: -
InternalDefines
Mandatory: no, quantity: 0..1, default: -
InternalIncludes
Mandatory: no, quantity: 0..1, default: -
Files
Mandatory: no, quantity: 0..n, default: -
ExcludeFiles
Mandatory: no, quantity: 0..n, default: -
compileOnly
Attribute of Files.
If set to true, the files will not be archived or linked.
Mandatory: no, quantity: 0..1, default: false
linkDirectly
Attribute of Files.
If set to true, the files will not be archived but linked directly to the executable.
Mandatory: no, quantity: 0..1, default: false
Prebuild
Mandatory: no, quantity: 0..1, default: No project/config is skipped
Except
Defines a project which shall not be skipped. If project name is omitted, the current project is used.
Mandatory: no, quantity: 0..n, default: Every project is skipped
config (Except)
Attribute of Except.
Defines a config which shall not be skipped. If omitted, all configs of the appropriate project are not skipped.
Mandatory: no, quantity: 0..1, default: Every config is skipped
CompilationDB
Mandatory: no, quantity: 0..1, default: None. If CompilationDB is specified without an explicit filename, $(WorkspaceDir)/compile_commands.json is used.
CompilationCheck
Mandatory: no, quantity: 0..n, default: -
LinkerScript
Specifies the name including path of the linker script.
Mandatory: no, quantity: 0..1, default: -
MapFile
Mandatory: no, quantity: 0..1, default: No mapfile will be written
ArtifactName
Mandatory: no, quantity: 0..1, default executable: project name + toolchain dependent file ending, default library: ‘lib’ + project name + ‘.a’
ArtifactExtension
Mandatory: no, quantity: 0..1, default: toolchain dependent file ending